From: leahneukirchen <leahneukirchen@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] zstd: clean up template.
Date: Tue, 29 Aug 2023 18:34:03 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-45817@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 836 bytes --]
There is a new pull request by leahneukirchen against master on the void-packages repository
https://github.com/leahneukirchen/void-packages zstd-cleanup
https://github.com/void-linux/void-packages/pull/45817
zstd: clean up template.
The zstd template had multiple issues:
- Since not all targets where built in do_build, compilation happened in do_install.
- Both zstd(1) and pzstd(1) statically linked libzstd.
- The libzstd.a library was meant to have multi-threading support, but was overwritten by a single-threaded version as a side-effect.
We patch pzstd to use dynamic linking and use "zstd-dll" for zstd.
In the future we may want to consider using cmake or ninja, but as it's a bootstrap package I've kept it on make.
A patch file from https://github.com/void-linux/void-packages/pull/45817.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-zstd-cleanup-45817.patch --]
[-- Type: text/x-diff, Size: 2137 bytes --]
From b10e35469b821278d866b6c3a766fad57896e699 Mon Sep 17 00:00:00 2001
From: Leah Neukirchen <leah@vuxu.org>
Date: Tue, 29 Aug 2023 18:25:20 +0200
Subject: [PATCH] zstd: clean up template.
The zstd template had multiple issues:
- Since not all targets where built in do_build, compilation happened in
do_install.
- Both zstd(1) and pzstd(1) statically linked libzstd.
- The libzstd.a library was meant to have multi-threading support,
but was overwritten by a single-threaded version as a side-effect.
We patch pzstd to use dynamic linking and use "zstd-dll" for zstd.
---
srcpkgs/zstd/patches/dynamic-pzstd.patch | 15 +++++++++++++++
srcpkgs/zstd/template | 3 ++-
2 files changed, 17 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/zstd/patches/dynamic-pzstd.patch
diff --git a/srcpkgs/zstd/patches/dynamic-pzstd.patch b/srcpkgs/zstd/patches/dynamic-pzstd.patch
new file mode 100644
index 0000000000000..df4de8d309f7d
--- /dev/null
+++ b/srcpkgs/zstd/patches/dynamic-pzstd.patch
@@ -0,0 +1,15 @@
+Dynamically link pzstd against libzstd.so.
+
+--- a/contrib/pzstd/Makefile
++++ b/contrib/pzstd/Makefile
+@@ -167,8 +167,8 @@
+ $(TESTPROG) ./test/RoundTripTest$(EXT) $(TESTFLAGS)
+
+ # Build the main binary
+-pzstd$(EXT): main.o $(PROGDIR)/util.o Options.o Pzstd.o SkippableFrame.o $(ZSTDDIR)/libzstd.a
+- $(LD_COMMAND)
++pzstd$(EXT): main.o $(PROGDIR)/util.o Options.o Pzstd.o SkippableFrame.o
++ $(LD_COMMAND) -L../../lib -lzstd
+
+ # Target that depends on all the tests
+ .PHONY: tests
diff --git a/srcpkgs/zstd/template b/srcpkgs/zstd/template
index ae47769408118..32f9d44c4c3d0 100644
--- a/srcpkgs/zstd/template
+++ b/srcpkgs/zstd/template
@@ -1,7 +1,7 @@
# Template file for 'zstd'
pkgname=zstd
version=1.5.5
-revision=1
+revision=2
bootstrap=yes
makedepends="zlib-devel liblzma-devel liblz4-devel"
checkdepends="gtest-devel tar"
@@ -15,6 +15,7 @@ checksum=9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4
do_build() {
make ${makejobs} PREFIX=/usr lib-mt
+ make ${makejobs} PREFIX=/usr -C programs zstd-dll
make ${makejobs} PREFIX=/usr -C contrib/pzstd
}
next reply other threads:[~2023-08-29 16:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-29 16:34 leahneukirchen [this message]
2023-08-31 0:58 ` sgn
2023-08-31 1:22 ` sgn
2023-08-31 11:56 ` leahneukirchen
2023-08-31 15:52 ` sgn
2023-08-31 15:56 ` [PR PATCH] [Merged]: " leahneukirchen
2023-08-31 15:56 ` leahneukirchen
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=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-45817@inbox.vuxu.org \
--to=leahneukirchen@users.noreply.github.com \
--cc=ml@inbox.vuxu.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;
as well as URLs for NNTP newsgroup(s).