]> git.pld-linux.org Git - packages/criterion.git/commitdiff
- added shared-nanopb patch and system_nanopb bcond (off currently, tests fail with...
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 13 Jan 2023 20:03:24 +0000 (21:03 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Fri, 13 Jan 2023 20:03:24 +0000 (21:03 +0100)
criterion-shared-nanopb.patch [new file with mode: 0644]
criterion.spec

diff --git a/criterion-shared-nanopb.patch b/criterion-shared-nanopb.patch
new file mode 100644 (file)
index 0000000..f4b7708
--- /dev/null
@@ -0,0 +1,11 @@
+--- criterion-2.4.1/meson.build.orig   2022-04-26 08:55:00.518896600 +0200
++++ criterion-2.4.1/meson.build        2022-11-21 20:40:59.950706878 +0100
+@@ -174,7 +174,7 @@ else
+       config.set('NN_REQREP_H', '<nanomsg/reqrep.h>')
+ endif
+-nanopb = dependency('nanopb', required: false, method: 'cmake', modules: ['nanopb::protobuf-nanopb-static'])
++nanopb = dependency('nanopb', required: false, method: 'cmake', modules: ['nanopb::protobuf-nanopb'])
+ must_regenerate_pb = nanopb.found()
+ if not nanopb.found()
+       nanopb_proj = cmake.subproject('nanopb',
index 7d1e6c5437b007dd88f489742df9325ea201a68e..e551d5001d3fd1575db7cca1733c0f4fbc8bdfa4 100644 (file)
@@ -1,9 +1,11 @@
 # TODO:
 # - system boxfort (when released): https://github.com/diacritic/BoxFort
+# - system nanopb (0.4.5 bundled)
 # - system libcsptr (when some post-2017 release made): https://github.com/Snaipe/libcsptr
 #
 # Conditional build:
 %bcond_without tests           # build without tests
+%bcond_with    system_nanopb   # system nanopb (tests fail with nanopb 0.4.7)
 #
 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
@@ -16,14 +18,17 @@ Group:              Libraries
 Source0:       https://github.com/Snaipe/Criterion/releases/download/v%{version}/%{name}-%{version}.tar.xz
 # Source0-md5: 93e91812837a68524d76339409ed2008
 Patch0:                x32.patch
+Patch1:                %{name}-shared-nanopb.patch
 URL:           https://github.com/Snaipe/Criterion
 BuildRequires: dyncall >= 1.0
 BuildRequires: libffi-devel
 BuildRequires: libgit2-devel
 BuildRequires: meson >= 0.51.0
 BuildRequires: nanomsg-devel >= 1.0.0
+%{?with_system_nanopb:BuildRequires:   nanopb-devel >= 0.4.5}
 BuildRequires: ninja
 BuildRequires: rpmbuild(macros) >= 1.736
+BuildRequires: sed >= 4.0
 BuildRequires: tar >= 1:1.22
 BuildRequires: xz
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -48,15 +53,34 @@ Header files for criterion library.
 %description devel -l pl.UTF-8
 Pliki nagłówkowe biblioteki criterion.
 
+%package static
+Summary:       Static criterion libraries
+Summary(pl.UTF-8):     Statyczne biblioteki criterion
+Group:         Development/Libraries
+Requires:      %{name} = %{version}-%{release}
+
+%description static
+Static criterion libraries.
+
+%description static -l pl.UTF-8
+Statyczne biblioteki criterion.
+
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+
+%if %{without system_nanopb}
+%{__sed} -i -e '/dependency.*nanopb/ s/nanopb::protobuf-nanopb/notfound::protobuf-nanopb/' meson.build
+%endif
 
 %build
 %meson build \
+       --default-library=shared \
        -Dtests=%{__true_false tests}
 
 %ninja_build -C build
+
 %{?with_tests:%ninja_test -C build}
 
 %install
@@ -83,3 +107,10 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_libdir}/libcriterion.so
 %{_includedir}/criterion
 %{_pkgconfigdir}/criterion.pc
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libcriterion.a
+%if %{without system_nanopb}
+%{_libdir}/libprotobuf_nanopb_static.a
+%endif
This page took 0.065017 seconds and 4 git commands to generate.