commit ccf8649b3bf4c3936b988b06c9c247ae0c4a0652281cdd48b4658c5855c741f6 Author: Jan Engelhardt Date: Thu Oct 13 18:57:29 2022 +0000 Accepting request 1008900 from home:badshah400:Staging We need to maintain version 2.x of Catch2 at least until most upstream packages catch up to Catch2 >= 3. See comments on sr#1005804 for rationale. OBS-URL: https://build.opensuse.org/request/show/1008900 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/Catch2-2?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Catch2-2.13.9.tar.gz b/Catch2-2.13.9.tar.gz new file mode 100644 index 0000000..036c5c7 --- /dev/null +++ b/Catch2-2.13.9.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06dbc7620e3b96c2b69d57bf337028bf245a211b3cddb843835bfe258f427a52 +size 661915 diff --git a/Catch2-2.changes b/Catch2-2.changes new file mode 100644 index 0000000..5859690 --- /dev/null +++ b/Catch2-2.changes @@ -0,0 +1,10 @@ +------------------------------------------------------------------- +Sat Oct 8 04:21:27 UTC 2022 - Atri Bhattacharya + +- Initial package: + * Branch off from obs://devel:libraries:c_c++/Catch2 at version + 2.13.9 and rename src package to Catch2-2. + * Catch2-2-devel: Add 'Provides: Catch2-devel = %{version}' + and 'Conflicts: Catch2-devel >= 3'. + * Drop CMAKE_RELEASE_TYPE=Release to use default + 'RelWithDebInfo' value from %cmake macro. diff --git a/Catch2-2.spec b/Catch2-2.spec new file mode 100644 index 0000000..c7c282b --- /dev/null +++ b/Catch2-2.spec @@ -0,0 +1,79 @@ +# +# spec file for package Catch2-2 +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define srcname Catch2 +Name: Catch2-2 +Version: 2.13.9 +Release: 0 +Summary: A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD +License: BSL-1.0 +URL: https://github.com/catchorg/Catch2/ +Source: https://github.com/catchorg/%{srcname}/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz +#PATCH-FIX-OPENSUSE fix-pragmas-old-gcc.patch -- Fix usage of gcc pragmas for old gcc version on Leap gh#catchorg/Catch2#2416 +Patch0: fix-pragmas-old-gcc.patch +BuildRequires: cmake >= 3.5 +BuildRequires: gcc-c++ >= 6 +BuildRequires: pkgconfig + +%description +Catch2 stands for C++ Automated Test Cases in a Header and is a multi-paradigm +test framework for C++. which also supports Objective-C (and maybe C). +It is primarily distributed as a single header file, although certain +extensions may require additional headers. + +This package provides version 2.x of Catch2. + +%package devel +Summary: A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD +Conflicts: Catch2-devel >= 3 +Provides: Catch2-devel = %{version} + +%description devel +Catch2 stands for C++ Automated Test Cases in a Header and is a multi-paradigm +test framework for C++. which also supports Objective-C (and maybe C). +It is primarily distributed as a single header file, although certain +extensions may require additional headers. + +This package provides version 2.x of Catch2. + +%prep +%autosetup -p1 -n %{srcname}-%{version} + +%build +%cmake \ + -DCMAKE_INSTALL_DOCDIR:PATH=%{_defaultdocdir}/%{name} \ + -DPKGCONFIG_INSTALL_DIR:PATH=%{_libdir}/pkgconfig \ + -DCATCH_BUILD_EXAMPLES:BOOL=ON +%cmake_build + +%install +%cmake_install + +%check +%ctest + +%files devel +%license LICENSE.txt +%doc README.md CODE_OF_CONDUCT.md +%doc %{_defaultdocdir}/%{name} +%{_datadir}/%{srcname}/ +%{_includedir}/catch2/ +%{_libdir}/cmake/%{srcname}/ +%{_libdir}/pkgconfig/catch2.pc + +%changelog diff --git a/fix-pragmas-old-gcc.patch b/fix-pragmas-old-gcc.patch new file mode 100644 index 0000000..ee20f5e --- /dev/null +++ b/fix-pragmas-old-gcc.patch @@ -0,0 +1,21 @@ +diff -Nur Catch2-2.13.9/projects/SelfTest/UsageTests/Message.tests.cpp new/projects/SelfTest/UsageTests/Message.tests.cpp +--- Catch2-2.13.9/projects/SelfTest/UsageTests/Message.tests.cpp 2022-04-12 22:38:17.000000000 +0200 ++++ new/projects/SelfTest/UsageTests/Message.tests.cpp 2022-04-26 14:20:39.792719016 +0200 +@@ -243,7 +243,7 @@ + + // Clang and gcc have different names for this warning, and clang also + // warns about an unused value +-#if defined(__GNUG__) && !defined(__clang__) ++#if defined(__GNUG__) && __GNUG__ >= 8 && !defined(__clang__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wcomma-subscript" + #elif defined(__clang__) +@@ -262,7 +262,7 @@ + SUCCEED(); + } + +-#ifdef __GNUG__ ++#if defined(__GNUG__) && __GNUG__ >= 8 + #pragma GCC diagnostic pop + #endif +