public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/zstd] f44: use a single cmake build, not separate static and shared
@ 2026-11-24 20:56 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-11-24 20:56 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/zstd
            Branch : f44
            Commit : aaddd724456f6fc53e106776b8cc1e12fff762b7
            Author : Pádraig Brady <P@draigBrady.com>
            Date   : 2026-11-24T17:35:53+00:00
            Stats  : +6/-11 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/zstd/c/aaddd724456f6fc53e106776b8cc1e12fff762b7?branch=f44

            Log:
            use a single cmake build, not separate static and shared

This was previously proposed at
https://src.fedoraproject.org/rpms/zstd/pull-request/8

Leverage upstream commit https://github.com/meta/zstd/pull/4494
to support a single cmake build and to move the two static
CMake export files from libzstd-devel to libzstd-static.

---
diff --git a/zstd.spec b/zstd.spec
index 4ee5f25..5909278 100644
--- a/zstd.spec
+++ b/zstd.spec
@@ -76,23 +76,15 @@ export ASMFLAGS="%{build_cflags}"
 export CPPFLAGS=-DZSTD_DISABLE_ASM
 %endif
 %global _vpath_srcdir build/cmake
-%global _vpath_builddir build/shared
 %ifarch x86_64
 # Fail the shared library link if an input lacks IBT or SHSTK.
 %global cet_check -DCMAKE_SHARED_LINKER_FLAGS="$LDFLAGS -Wl,-z,cet-report=error"
 %endif
-%cmake %{?with_pzstd:-DZSTD_BUILD_CONTRIB=ON} -DZSTD_BUILD_STATIC=NO -DZSTD_PROGRAMS_LINK_SHARED=YES \
-    %{?cet_check}
-%cmake_build
-%global _vpath_builddir build/static
-%cmake %{?with_pzstd:-DZSTD_BUILD_CONTRIB=ON} -DZSTD_BUILD_SHARED=NO -DBUILD_TESTING=YES
+%cmake %{?with_pzstd:-DZSTD_BUILD_CONTRIB=ON} \
+    -DZSTD_PROGRAMS_LINK_SHARED=YES -DBUILD_TESTING=YES %{?cet_check}
 %cmake_build
 
 %install
-%global _vpath_builddir build/static
-%cmake_install
-# Install shared second so that cmake config files reference the shared library
-%global _vpath_builddir build/shared
 %cmake_install
 %if %{with pzstd}
 install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1
@@ -101,7 +93,8 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1
 %check
 execstack %{_vpath_builddir}/lib/libzstd.so.1
 
-%global _vpath_builddir build/static
+# Run the build-tree zstd against the matching shared library.
+export LD_LIBRARY_PATH="$PWD/%{_vpath_builddir}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
 %ctest --verbose
 %if %{with pzstd} && %{with gtest}
 # No pzstd tests with the cmake build at the moment
@@ -142,9 +135,11 @@ make PZSTD_CXX_STD=-std=c++17 -C contrib/pzstd tests check
 %{_libdir}/pkgconfig/libzstd.pc
 %{_libdir}/libzstd.so
 %{_libdir}/cmake/zstd/
+%exclude %{_libdir}/cmake/zstd/zstdTargets_static*.cmake
 
 %files -n lib%{name}-static
 %{_libdir}/libzstd.a
+%{_libdir}/cmake/zstd/zstdTargets_static*.cmake
 
 %ldconfig_scriptlets -n lib%{name}
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-24 20:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 20:56 [rpms/zstd] f44: use a single cmake build, not separate static and shared 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox