diff --git a/.gitignore b/.gitignore index c14c025..64c96ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ /variant-lite-2.0.0.tar.gz -/variant-lite-3.0.0.tar.gz diff --git a/0001-Downstream-patch-disable-C-17-tests-since-they-fail-.patch b/0001-Downstream-patch-disable-C-17-tests-since-they-fail-.patch new file mode 100644 index 0000000..e06eda9 --- /dev/null +++ b/0001-Downstream-patch-disable-C-17-tests-since-they-fail-.patch @@ -0,0 +1,29 @@ +From d99e39b73945750d5db93ab20c61e47ad186e16d Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Mon, 20 Jan 2025 14:05:16 -0500 +Subject: [PATCH] Downstream patch: disable C++17 tests since they fail to + compile on GCC 14 + +https://github.com/martinmoene/variant-lite/issues/50 +--- + test/CMakeLists.txt | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index c0ab071..9c5602a 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -68,7 +68,9 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang" ) + set( HAS_CPP14_FLAG TRUE ) + endif() + if( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.1.0 ) +- set( HAS_CPP17_FLAG TRUE ) ++ # Downstream patch: disable C++17 tests since they fail to compile on GCC 14 ++ # https://github.com/martinmoene/variant-lite/issues/50 ++ set( HAS_CPP17_FLAG FALSE ) + endif() + + # AppleClang: available -std flags depends on version +-- +2.48.1 + diff --git a/sources b/sources index 37c7879..3a5638e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (variant-lite-3.0.0.tar.gz) = e85f27179a997777e3f9ad1db5f424f0838c474904c9df6a6b9cce817ca57144b0e23d561b9514edd97f8fff88b2a372c5afccc46a15b35e4b7d287e6b197a9e +SHA512 (variant-lite-2.0.0.tar.gz) = dd255d3664b42305e58c14a0bfc7d6ba54462656001e4e79c14fdb64a6f54b57a00ec3cf10d006614c849528529c6897031df4b52a49ecb91531e89d366d6a9c diff --git a/variant-lite.rpmlintrc b/variant-lite.rpmlintrc index 93f22bd..826c1d0 100644 --- a/variant-lite.rpmlintrc +++ b/variant-lite.rpmlintrc @@ -1,2 +1,2 @@ # CMake files for this header-only library still go under %{_libdir}: -addFilter(r"variant-lite-devel\..*: only-non-binary-in-usr-lib") +addFilter(r"optional-lite-devel\..*: only-non-binary-in-usr-lib") diff --git a/variant-lite.spec b/variant-lite.spec index 704fd0b..95a5d04 100644 --- a/variant-lite.spec +++ b/variant-lite.spec @@ -2,14 +2,14 @@ # numbers of args and/or types? Packaging guidelines don’t *require* us to do # this, and there is probably no benefit in this case, but it is nice to # demonstrate how it can be done if needed. -%bcond regenerate 0 -%dnl %global max_types 16 -%dnl %global max_types 5 +%bcond_with regenerate +# %%global max_types 16 +# %%global max_types 5 -%bcond ctest 1 +%bcond_without tests Name: variant-lite -Version: 3.0.0 +Version: 2.0.0 Release: %autorelease Summary: Represent a type-safe union @@ -17,19 +17,19 @@ License: BSL-1.0 URL: https://github.com/martinmoene/variant-lite Source: %{url}/archive/v%{version}/variant-lite-%{version}.tar.gz -BuildSystem: cmake -BuildOption(conf): %{shrink: - -DVARIANT_LITE_OPT_BUILD_TESTS:BOOL=%{?with_ctest:ON}%{?!with_ctest:OFF} - } +# Downstream patch: disable C++17 tests since they fail to compile on GCC 14 +# https://github.com/martinmoene/variant-lite/issues/50 +Patch: 0001-Downstream-patch-disable-C-17-tests-since-they-fail-.patch BuildRequires: gcc-c++ +BuildRequires: cmake %if %{with regenerate} BuildRequires: python3-devel BuildRequires: %{py3_dist jinja2} %endif -%if %{with ctest} +%if %{with tests} # Required for testing; bundled upstream, unbundled in %%prep. # Header-only library (-static required by policy) BuildRequires: lest-devel lest-static @@ -56,29 +56,46 @@ The %{name}-devel package contains libraries and header files for developing applications that use %{name}. -%prep -a +%prep +%autosetup -n variant-lite-%{version} -p1 + # Unbundle lest -rm --recursive --verbose test/lest -ln --symbolic /usr/include/lest test/lest +rm -rvf test/lest +ln -s /usr/include/lest test/lest %if %{with regenerate} -%generate_buildrequires -a -%pyproject_buildrequires --no-use-build-system +%generate_buildrequires +%pyproject_buildrequires -N %endif +%build +%cmake %{?!with_tests:-DVARIANT_LITE_OPT_BUILD_TESTS:BOOL=OFF} %if %{with regenerate} -%build -p %{python3} script/generate_header.py \ %{?max_types:--max-types %{max_types}} \ %{?max_args:--max-args %{max_args}} \ --verbose %endif +%cmake_build + + +%install +%cmake_install + + +%check +%if %{with tests} +%ctest +%endif %files devel %license LICENSE.txt +# We don’t package CHANGES.txt because it was never updated after “version +# 0.0.0-alpha 2016-10-23.” If we did, we would need to fix its encoding, +# https://github.com/martinmoene/variant-lite/pull/51. %doc README.md %doc example/