From 7d1176404f3fc4419cc3025b183ea2b1dd947261 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 21 Jan 2025 11:59:26 -0500 Subject: [PATCH 01/10] Backport to EPEL8 --- variant-lite.spec | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/variant-lite.spec b/variant-lite.spec index f8fc289..95a5d04 100644 --- a/variant-lite.spec +++ b/variant-lite.spec @@ -2,11 +2,11 @@ # 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 tests 1 +%bcond_without tests Name: variant-lite Version: 2.0.0 @@ -70,18 +70,14 @@ ln -s /usr/include/lest test/lest %endif -%conf -%cmake %{?!with_tests:-DVARIANT_LITE_OPT_BUILD_TESTS:BOOL=OFF} - - %build +%cmake %{?!with_tests:-DVARIANT_LITE_OPT_BUILD_TESTS:BOOL=OFF} %if %{with regenerate} %{python3} script/generate_header.py \ %{?max_types:--max-types %{max_types}} \ %{?max_args:--max-args %{max_args}} \ --verbose %endif - %cmake_build From 3c08422139493abe5c5e3cbb9f896d5a9c43945c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 11 May 2025 08:08:25 -0400 Subject: [PATCH 02/10] Fix an error in the .rpmlintrc file --- variant-lite.rpmlintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") From 2bcfa4b3ee5ca30af9471af18cdfb5ed8e853695 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 19:58:05 +0000 Subject: [PATCH 03/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 0b18cdca11b702021ce174710c98ba30096b6bbc Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 28 Sep 2025 21:29:16 +0100 Subject: [PATCH 04/10] Backport patch for Clang 17 and/or C++17 --- ...-disable-C-17-tests-since-they-fail-.patch | 29 ---- ...index-tag-definitions-for-compatibil.patch | 144 ++++++++++++++++++ variant-lite.spec | 10 +- 3 files changed, 152 insertions(+), 31 deletions(-) delete mode 100644 0001-Downstream-patch-disable-C-17-tests-since-they-fail-.patch create mode 100644 0001-Updated-variant-index-tag-definitions-for-compatibil.patch 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/0001-Updated-variant-index-tag-definitions-for-compatibil.patch b/0001-Updated-variant-index-tag-definitions-for-compatibil.patch new file mode 100644 index 0000000..063670f --- /dev/null +++ b/0001-Updated-variant-index-tag-definitions-for-compatibil.patch @@ -0,0 +1,144 @@ +From a313db950eabb32c7ccbafe548b1f9a1f04e0c97 Mon Sep 17 00:00:00 2001 +From: Tigran Geghamyan +Date: Tue, 23 Sep 2025 00:20:22 -0700 +Subject: [PATCH] Updated variant index tag definitions for compatibiliy with + clang compiler + +--- + include/nonstd/variant.hpp | 4 ++-- + template/variant.hpp | 4 ++-- + test/CMakeLists.txt | 2 ++ + test/variant.t.cpp | 42 +++++++++++++++++++++++++++++++++++++- + 4 files changed, 47 insertions(+), 5 deletions(-) + +diff --git a/include/nonstd/variant.hpp b/include/nonstd/variant.hpp +index 54b0504..32ba860 100644 +--- a/include/nonstd/variant.hpp ++++ b/include/nonstd/variant.hpp +@@ -193,8 +193,8 @@ struct index_tag_t {}; + template< std::size_t K > + inline void index_tag ( index_tag_t = index_tag_t() ) { } + +-#define variant_index_tag_t(K) void(&)( nonstd::variants::detail::index_tag_t ) +-#define variant_index_tag(K) nonstd::variants::detail::index_tag ++#define variant_index_tag_t(K) nonstd::variants::detail::index_tag_t* ++#define variant_index_tag(K) nullptr + + } // namespace detail + } // namespace variants +diff --git a/template/variant.hpp b/template/variant.hpp +index 5410571..e63249a 100644 +--- a/template/variant.hpp ++++ b/template/variant.hpp +@@ -193,8 +193,8 @@ struct index_tag_t {}; + template< std::size_t K > + inline void index_tag ( index_tag_t = index_tag_t() ) { } + +-#define variant_index_tag_t(K) void(&)( nonstd::variants::detail::index_tag_t ) +-#define variant_index_tag(K) nonstd::variants::detail::index_tag ++#define variant_index_tag_t(K) nonstd::variants::detail::index_tag_t* ++#define variant_index_tag(K) nullptr + + } // namespace detail + } // namespace variants +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index c4f8b4a..df8f35d 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -57,6 +57,8 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang" ) + set( OPTIONS -Wall -Wextra -Wconversion -Wsign-conversion -Wno-missing-braces -fno-elide-constructors ) + set( DEFINITIONS ${DEFCMN} ) + ++ set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0" ) ++ + # GNU: available -std flags depends on version + if( CMAKE_CXX_COMPILER_ID MATCHES "GNU" ) + message( STATUS "Matched: GNU") +diff --git a/test/variant.t.cpp b/test/variant.t.cpp +index 7838095..f3bc58a 100644 +--- a/test/variant.t.cpp ++++ b/test/variant.t.cpp +@@ -24,6 +24,30 @@ const void * test_nullptr = nullptr; + const void * test_nullptr = variant_nullptr; + #endif + ++// half-open range [lo..hi): ++// Note: variant_BETWEEN() is not be available when std::variant is used: ++#define variant_t_BETWEEN( v, lo, hi ) ( (lo) <= (v) && (v) < (hi) ) ++ ++#ifndef variant_COMPILER_VERSION ++# define variant_COMPILER_VERSION( major, minor, patch ) ( 10 * ( 10 * (major) + (minor) ) + (patch) ) ++#endif ++ ++#ifndef variant_COMPILER_CLANG_VERSION ++# if defined(__clang__) ++# define variant_COMPILER_CLANG_VERSION variant_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__) ++# else ++# define variant_COMPILER_CLANG_VERSION 0 ++# endif ++#endif ++ ++#ifndef variant_COMPILER_GNUC_VERSION ++# if defined(__GNUC__) && !defined(__clang__) ++# define variant_COMPILER_GNUC_VERSION variant_COMPILER_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) ++# else ++# define variant_COMPILER_GNUC_VERSION 0 ++# endif ++#endif ++ + // The following tracer code originates as Oracle from Optional by + // Andrzej Krzemienski, https://github.com/akrzemi1/Optional. + +@@ -515,6 +539,13 @@ CASE( "variant: Allows to move-construct from element (C++11)" ) + + CASE( "variant: Allows to convert-copy-construct from element" ) + { ++#if ( defined(_MSC_VER) && variant_t_BETWEEN(_MSC_VER, 1920, 1930 ) && variant_USES_STD_VARIANT ) ++ EXPECT( !!"variant: no convert-copy-construct from element with std::variant (VS2019/VC142/1920)" ); ++#elif ( variant_USES_STD_VARIANT && variant_COMPILER_GNUC_VERSION >= 1010 ) ++ EXPECT( !!"variant: no convert-copy-construct from element with GCC 10.1 or later" ); ++#elif ( variant_USES_STD_VARIANT && variant_COMPILER_CLANG_VERSION >= 1100 ) ++ EXPECT( !!"variant: no convert-copy-construct from element with Clang 11 or later" ); ++#else + int i = 7; + + variant var1( i ); +@@ -525,17 +556,26 @@ CASE( "variant: Allows to convert-copy-construct from element" ) + + EXPECT( var2.index() == 0u ); + EXPECT( get<0>(var2) == lest::approx(7) ); ++#endif + } + + CASE( "variant: Allows to convert-move-construct from element (C++11)" ) + { + #if variant_CPP11_OR_GREATER ++#if ( defined(_MSC_VER) && variant_t_BETWEEN(_MSC_VER, 1920, 1930 ) && variant_USES_STD_VARIANT ) ++ EXPECT( !!"variant: no convert-copy-construct from element with std::variant (VS2019/VC142/1920)" ); ++#elif ( variant_USES_STD_VARIANT && variant_COMPILER_GNUC_VERSION >= 1010 ) ++ EXPECT( !!"variant: no convert-copy-construct from element with GCC 10.1 or later" ); ++#elif ( variant_USES_STD_VARIANT && variant_COMPILER_CLANG_VERSION >= 1100 ) ++ EXPECT( !!"variant: no convert-copy-construct from element with Clang 11 or later" ); ++#else + struct Int { operator int() { return 7; } }; + + variant var( Int{} ); + + EXPECT( var.index() == 0u ); + EXPECT( get<0>(var) == lest::approx(7) ); ++#endif + #else + EXPECT( !!"variant: move-construction is not available (no C++11)" ); + #endif +@@ -1628,7 +1668,7 @@ namespace issue_31 { + CopyOnly( CopyOnly const & ) {} + CopyOnly & operator=( CopyOnly const & ) { return *this; } + +-#if variant_CPP11_OR_GREATER ++#if variant_CPP11_OR_GREATER && !(variant_USES_STD_VARIANT && defined(_LIBCPP_VERSION)) + CopyOnly( CopyOnly && ) = delete; + CopyOnly & operator=( CopyOnly && ) = delete; + #endif +-- +2.51.0 + diff --git a/variant-lite.spec b/variant-lite.spec index f8fc289..3197d16 100644 --- a/variant-lite.spec +++ b/variant-lite.spec @@ -17,9 +17,15 @@ 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 +# Updated variant index tag definitions for compatibility with clang +# https://github.com/martinmoene/variant-lite/pull/56 +# Cherry-picked on v2.0.0. +# +# Fixes: +# +# Tests fail to compile (GCC 14) # https://github.com/martinmoene/variant-lite/issues/50 -Patch: 0001-Downstream-patch-disable-C-17-tests-since-they-fail-.patch +Patch: 0001-Updated-variant-index-tag-definitions-for-compatibil.patch BuildRequires: gcc-c++ BuildRequires: cmake From 40e237127601998092d13253e9bb76b1fc042334 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 2 Oct 2025 09:38:30 +0100 Subject: [PATCH 05/10] Update to 3.0.0 (close RHBZ#2400955) --- .gitignore | 1 + ...index-tag-definitions-for-compatibil.patch | 144 ------------------ sources | 2 +- variant-lite.spec | 15 +- 4 files changed, 3 insertions(+), 159 deletions(-) delete mode 100644 0001-Updated-variant-index-tag-definitions-for-compatibil.patch 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-Updated-variant-index-tag-definitions-for-compatibil.patch b/0001-Updated-variant-index-tag-definitions-for-compatibil.patch deleted file mode 100644 index 063670f..0000000 --- a/0001-Updated-variant-index-tag-definitions-for-compatibil.patch +++ /dev/null @@ -1,144 +0,0 @@ -From a313db950eabb32c7ccbafe548b1f9a1f04e0c97 Mon Sep 17 00:00:00 2001 -From: Tigran Geghamyan -Date: Tue, 23 Sep 2025 00:20:22 -0700 -Subject: [PATCH] Updated variant index tag definitions for compatibiliy with - clang compiler - ---- - include/nonstd/variant.hpp | 4 ++-- - template/variant.hpp | 4 ++-- - test/CMakeLists.txt | 2 ++ - test/variant.t.cpp | 42 +++++++++++++++++++++++++++++++++++++- - 4 files changed, 47 insertions(+), 5 deletions(-) - -diff --git a/include/nonstd/variant.hpp b/include/nonstd/variant.hpp -index 54b0504..32ba860 100644 ---- a/include/nonstd/variant.hpp -+++ b/include/nonstd/variant.hpp -@@ -193,8 +193,8 @@ struct index_tag_t {}; - template< std::size_t K > - inline void index_tag ( index_tag_t = index_tag_t() ) { } - --#define variant_index_tag_t(K) void(&)( nonstd::variants::detail::index_tag_t ) --#define variant_index_tag(K) nonstd::variants::detail::index_tag -+#define variant_index_tag_t(K) nonstd::variants::detail::index_tag_t* -+#define variant_index_tag(K) nullptr - - } // namespace detail - } // namespace variants -diff --git a/template/variant.hpp b/template/variant.hpp -index 5410571..e63249a 100644 ---- a/template/variant.hpp -+++ b/template/variant.hpp -@@ -193,8 +193,8 @@ struct index_tag_t {}; - template< std::size_t K > - inline void index_tag ( index_tag_t = index_tag_t() ) { } - --#define variant_index_tag_t(K) void(&)( nonstd::variants::detail::index_tag_t ) --#define variant_index_tag(K) nonstd::variants::detail::index_tag -+#define variant_index_tag_t(K) nonstd::variants::detail::index_tag_t* -+#define variant_index_tag(K) nullptr - - } // namespace detail - } // namespace variants -diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt -index c4f8b4a..df8f35d 100644 ---- a/test/CMakeLists.txt -+++ b/test/CMakeLists.txt -@@ -57,6 +57,8 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang" ) - set( OPTIONS -Wall -Wextra -Wconversion -Wsign-conversion -Wno-missing-braces -fno-elide-constructors ) - set( DEFINITIONS ${DEFCMN} ) - -+ set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0" ) -+ - # GNU: available -std flags depends on version - if( CMAKE_CXX_COMPILER_ID MATCHES "GNU" ) - message( STATUS "Matched: GNU") -diff --git a/test/variant.t.cpp b/test/variant.t.cpp -index 7838095..f3bc58a 100644 ---- a/test/variant.t.cpp -+++ b/test/variant.t.cpp -@@ -24,6 +24,30 @@ const void * test_nullptr = nullptr; - const void * test_nullptr = variant_nullptr; - #endif - -+// half-open range [lo..hi): -+// Note: variant_BETWEEN() is not be available when std::variant is used: -+#define variant_t_BETWEEN( v, lo, hi ) ( (lo) <= (v) && (v) < (hi) ) -+ -+#ifndef variant_COMPILER_VERSION -+# define variant_COMPILER_VERSION( major, minor, patch ) ( 10 * ( 10 * (major) + (minor) ) + (patch) ) -+#endif -+ -+#ifndef variant_COMPILER_CLANG_VERSION -+# if defined(__clang__) -+# define variant_COMPILER_CLANG_VERSION variant_COMPILER_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__) -+# else -+# define variant_COMPILER_CLANG_VERSION 0 -+# endif -+#endif -+ -+#ifndef variant_COMPILER_GNUC_VERSION -+# if defined(__GNUC__) && !defined(__clang__) -+# define variant_COMPILER_GNUC_VERSION variant_COMPILER_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) -+# else -+# define variant_COMPILER_GNUC_VERSION 0 -+# endif -+#endif -+ - // The following tracer code originates as Oracle from Optional by - // Andrzej Krzemienski, https://github.com/akrzemi1/Optional. - -@@ -515,6 +539,13 @@ CASE( "variant: Allows to move-construct from element (C++11)" ) - - CASE( "variant: Allows to convert-copy-construct from element" ) - { -+#if ( defined(_MSC_VER) && variant_t_BETWEEN(_MSC_VER, 1920, 1930 ) && variant_USES_STD_VARIANT ) -+ EXPECT( !!"variant: no convert-copy-construct from element with std::variant (VS2019/VC142/1920)" ); -+#elif ( variant_USES_STD_VARIANT && variant_COMPILER_GNUC_VERSION >= 1010 ) -+ EXPECT( !!"variant: no convert-copy-construct from element with GCC 10.1 or later" ); -+#elif ( variant_USES_STD_VARIANT && variant_COMPILER_CLANG_VERSION >= 1100 ) -+ EXPECT( !!"variant: no convert-copy-construct from element with Clang 11 or later" ); -+#else - int i = 7; - - variant var1( i ); -@@ -525,17 +556,26 @@ CASE( "variant: Allows to convert-copy-construct from element" ) - - EXPECT( var2.index() == 0u ); - EXPECT( get<0>(var2) == lest::approx(7) ); -+#endif - } - - CASE( "variant: Allows to convert-move-construct from element (C++11)" ) - { - #if variant_CPP11_OR_GREATER -+#if ( defined(_MSC_VER) && variant_t_BETWEEN(_MSC_VER, 1920, 1930 ) && variant_USES_STD_VARIANT ) -+ EXPECT( !!"variant: no convert-copy-construct from element with std::variant (VS2019/VC142/1920)" ); -+#elif ( variant_USES_STD_VARIANT && variant_COMPILER_GNUC_VERSION >= 1010 ) -+ EXPECT( !!"variant: no convert-copy-construct from element with GCC 10.1 or later" ); -+#elif ( variant_USES_STD_VARIANT && variant_COMPILER_CLANG_VERSION >= 1100 ) -+ EXPECT( !!"variant: no convert-copy-construct from element with Clang 11 or later" ); -+#else - struct Int { operator int() { return 7; } }; - - variant var( Int{} ); - - EXPECT( var.index() == 0u ); - EXPECT( get<0>(var) == lest::approx(7) ); -+#endif - #else - EXPECT( !!"variant: move-construction is not available (no C++11)" ); - #endif -@@ -1628,7 +1668,7 @@ namespace issue_31 { - CopyOnly( CopyOnly const & ) {} - CopyOnly & operator=( CopyOnly const & ) { return *this; } - --#if variant_CPP11_OR_GREATER -+#if variant_CPP11_OR_GREATER && !(variant_USES_STD_VARIANT && defined(_LIBCPP_VERSION)) - CopyOnly( CopyOnly && ) = delete; - CopyOnly & operator=( CopyOnly && ) = delete; - #endif --- -2.51.0 - 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.spec b/variant-lite.spec index 3197d16..3a53836 100644 --- a/variant-lite.spec +++ b/variant-lite.spec @@ -9,7 +9,7 @@ %bcond tests 1 Name: variant-lite -Version: 2.0.0 +Version: 3.0.0 Release: %autorelease Summary: Represent a type-safe union @@ -17,16 +17,6 @@ License: BSL-1.0 URL: https://github.com/martinmoene/variant-lite Source: %{url}/archive/v%{version}/variant-lite-%{version}.tar.gz -# Updated variant index tag definitions for compatibility with clang -# https://github.com/martinmoene/variant-lite/pull/56 -# Cherry-picked on v2.0.0. -# -# Fixes: -# -# Tests fail to compile (GCC 14) -# https://github.com/martinmoene/variant-lite/issues/50 -Patch: 0001-Updated-variant-index-tag-definitions-for-compatibil.patch - BuildRequires: gcc-c++ BuildRequires: cmake @@ -103,9 +93,6 @@ ln -s /usr/include/lest test/lest %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/ From 88641cd57911fca64c087cc8eb03ae2c1138fe75 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 19:47:21 +0000 Subject: [PATCH 06/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From c41f12d53a07a7e7bf11f73f5d62a314493a0731 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 8 May 2026 21:32:18 +0100 Subject: [PATCH 07/10] Use long pyproject options --- variant-lite.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variant-lite.spec b/variant-lite.spec index 3a53836..2814d58 100644 --- a/variant-lite.spec +++ b/variant-lite.spec @@ -62,7 +62,7 @@ ln -s /usr/include/lest test/lest %if %{with regenerate} %generate_buildrequires -%pyproject_buildrequires -N +%pyproject_buildrequires --no-use-build-system %endif From 2446c066290ab751db75400f3884e12462578564 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 19 May 2026 22:35:00 +0100 Subject: [PATCH 08/10] Use various long options --- variant-lite.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/variant-lite.spec b/variant-lite.spec index 2814d58..132f62e 100644 --- a/variant-lite.spec +++ b/variant-lite.spec @@ -56,8 +56,8 @@ developing applications that use %{name}. %autosetup -n variant-lite-%{version} -p1 # 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} From d452e29e72a01b89a3214a48e79a2e7fda002a54 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 19 May 2026 22:36:45 +0100 Subject: [PATCH 09/10] Use the cmake declarative buildsystem --- variant-lite.spec | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/variant-lite.spec b/variant-lite.spec index 132f62e..704fd0b 100644 --- a/variant-lite.spec +++ b/variant-lite.spec @@ -6,7 +6,7 @@ %dnl %global max_types 16 %dnl %global max_types 5 -%bcond tests 1 +%bcond ctest 1 Name: variant-lite Version: 3.0.0 @@ -17,15 +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} + } + 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 @@ -52,44 +56,26 @@ 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 --recursive --verbose test/lest ln --symbolic /usr/include/lest test/lest %if %{with regenerate} -%generate_buildrequires +%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 From f095ff7b074be0723fcfb55abe65be482cff4f61 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 08:22:11 +0000 Subject: [PATCH 10/10] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild