From 286f29000ce0445f13928bfd6fa3d107325b5932 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Wed, 6 May 2020 10:19:58 +0200 Subject: [PATCH] - fix miscompiled library on x32 - added tests - rel 5 --- criterion.spec | 16 ++++++++++++++-- x32.patch | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 x32.patch diff --git a/criterion.spec b/criterion.spec index 1ed1c18..129b84f 100644 --- a/criterion.spec +++ b/criterion.spec @@ -1,17 +1,23 @@ # TODO: # - system boxfort (when released): https://github.com/diacritic/BoxFort # - system libcsptr (when some post-2017 release made): https://github.com/Snaipe/libcsptr +# +# Conditional build: +%bcond_without tests # build without tests +# Summary: A cross-platform C and C++ unit testing framework for the 21th century Summary(pl.UTF-8): Wieloplatformowy szkielet do testów jednostkowych dla C i C++ w XXI wieku Name: criterion Version: 2.3.3 -Release: 4 +Release: 5 License: LGPL v2.1+ Group: Libraries #Source0Download: https://github.com/Snaipe/Criterion/releases Source0: https://github.com/Snaipe/Criterion/releases/download/v%{version}/%{name}-v%{version}.tar.bz2 # Source0-md5: 0305dbb5e00f04fd65b22e9ad82ba952 Patch0: %{name}-libdir.patch +Patch1: x32.patch +Patch2: no-cram.patch URL: https://github.com/Snaipe/Criterion BuildRequires: cmake >= 2.8.0 BuildRequires: dyncall >= 1.0 @@ -42,13 +48,19 @@ Pliki nagłówkowe biblioteki criterion. %prep %setup -q -n %{name}-v%{version} %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build install -d build cd build -%cmake .. +%cmake .. \ + %{cmake_on_off tests CTESTS} + %{__make} +%{?with_tests:%{__make} criterion_tests test} + %install rm -rf $RPM_BUILD_ROOT diff --git a/x32.patch b/x32.patch new file mode 100644 index 0000000..936d557 --- /dev/null +++ b/x32.patch @@ -0,0 +1,18 @@ +--- criterion-v2.3.3/dependencies/boxfort/CMakeLists.txt~ 2018-11-05 02:19:59.000000000 +0100 ++++ criterion-v2.3.3/dependencies/boxfort/CMakeLists.txt 2020-05-06 09:01:11.433286507 +0200 +@@ -70,9 +70,15 @@ + else () + set (BXF_ABI "systemv") + endif () ++ if (CMAKE_C_COMPILER_ABI MATCHES "ELF X32") ++ set (BXF_ARCH "x86_64") ++ set (BXF_BITS 32) ++ set (BXF_ARCH_x86_64 1) ++ else () + set (BXF_ARCH "x86_64") + set (BXF_BITS 64) + set (BXF_ARCH_x86_64 1) ++ endif () + elseif (_ARCH MATCHES "${ARM32}") + set (BXF_ARCH "arm") + set (BXF_ABI "arm") -- 2.44.0