public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/zstd] f44: use a single cmake build, not separate static and shared
Date: Tue, 24 Nov 2026 20:56:14 GMT [thread overview]
Message-ID: <179555377480.1.6196973648430792685.rpms-zstd-aaddd724456f@fedoraproject.org> (raw)
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}
reply other threads:[~2026-11-24 20:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179555377480.1.6196973648430792685.rpms-zstd-aaddd724456f@fedoraproject.org \
--to=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox