Compare commits

..

1 commit

Author SHA1 Message Date
Benjamin A. Beasley
7d1176404f Backport to EPEL8 2025-01-21 12:19:35 -05:00
5 changed files with 64 additions and 19 deletions

1
.gitignore vendored
View file

@ -1,2 +1 @@
/variant-lite-2.0.0.tar.gz
/variant-lite-3.0.0.tar.gz

View file

@ -0,0 +1,29 @@
From d99e39b73945750d5db93ab20c61e47ad186e16d Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
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

View file

@ -1 +1 @@
SHA512 (variant-lite-3.0.0.tar.gz) = e85f27179a997777e3f9ad1db5f424f0838c474904c9df6a6b9cce817ca57144b0e23d561b9514edd97f8fff88b2a372c5afccc46a15b35e4b7d287e6b197a9e
SHA512 (variant-lite-2.0.0.tar.gz) = dd255d3664b42305e58c14a0bfc7d6ba54462656001e4e79c14fdb64a6f54b57a00ec3cf10d006614c849528529c6897031df4b52a49ecb91531e89d366d6a9c

View file

@ -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")

View file

@ -2,14 +2,14 @@
# numbers of args and/or types? Packaging guidelines dont *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 dont 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/