diff --git a/.gitignore b/.gitignore index 64c96ce..c14c025 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /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 deleted file mode 100644 index e06eda9..0000000 --- a/0001-Downstream-patch-disable-C-17-tests-since-they-fail-.patch +++ /dev/null @@ -1,29 +0,0 @@ -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 3a5638e..37c7879 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (variant-lite-2.0.0.tar.gz) = dd255d3664b42305e58c14a0bfc7d6ba54462656001e4e79c14fdb64a6f54b57a00ec3cf10d006614c849528529c6897031df4b52a49ecb91531e89d366d6a9c +SHA512 (variant-lite-3.0.0.tar.gz) = e85f27179a997777e3f9ad1db5f424f0838c474904c9df6a6b9cce817ca57144b0e23d561b9514edd97f8fff88b2a372c5afccc46a15b35e4b7d287e6b197a9e diff --git a/variant-lite.rpmlintrc b/variant-lite.rpmlintrc index 826c1d0..93f22bd 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"optional-lite-devel\..*: only-non-binary-in-usr-lib") +addFilter(r"variant-lite-devel\..*: only-non-binary-in-usr-lib") diff --git a/variant-lite.spec b/variant-lite.spec index f8fc289..704fd0b 100644 --- a/variant-lite.spec +++ b/variant-lite.spec @@ -6,10 +6,10 @@ %dnl %global max_types 16 %dnl %global max_types 5 -%bcond tests 1 +%bcond ctest 1 Name: variant-lite -Version: 2.0.0 +Version: 3.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 -# 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 +BuildSystem: cmake +BuildOption(conf): %{shrink: + -DVARIANT_LITE_OPT_BUILD_TESTS:BOOL=%{?with_ctest:ON}%{?!with_ctest:OFF} + } BuildRequires: gcc-c++ -BuildRequires: cmake %if %{with regenerate} BuildRequires: python3-devel BuildRequires: %{py3_dist jinja2} %endif -%if %{with tests} +%if %{with ctest} # Required for testing; bundled upstream, unbundled in %%prep. # Header-only library (-static required by policy) BuildRequires: lest-devel lest-static @@ -56,50 +56,29 @@ The %{name}-devel package contains libraries and header files for developing applications that use %{name}. -%prep -%autosetup -n variant-lite-%{version} -p1 - +%prep -a # Unbundle lest -rm -rvf test/lest -ln -s /usr/include/lest test/lest +rm --recursive --verbose test/lest +ln --symbolic /usr/include/lest test/lest %if %{with regenerate} -%generate_buildrequires -%pyproject_buildrequires -N +%generate_buildrequires -a +%pyproject_buildrequires --no-use-build-system %endif -%conf -%cmake %{?!with_tests:-DVARIANT_LITE_OPT_BUILD_TESTS:BOOL=OFF} - - -%build %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/