* [PR PATCH] zstd: clean up template.
@ 2023-08-29 16:34 leahneukirchen
2023-08-31 0:58 ` sgn
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: leahneukirchen @ 2023-08-29 16:34 UTC (permalink / raw)
To: ml
[-- 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
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: zstd: clean up template.
2023-08-29 16:34 [PR PATCH] zstd: clean up template leahneukirchen
@ 2023-08-31 0:58 ` sgn
2023-08-31 1:22 ` sgn
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2023-08-31 0:58 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 359 bytes --]
New comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/pull/45817#issuecomment-1700134425
Comment:
We can use `cmake` build-style because that one use `cmake-bootstrap`, which vendored their own version of `libzstd`;
and either:
- split the build for bootstrap; or
- require `cmake` in bootstrap (foreign) environment
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: zstd: clean up template.
2023-08-29 16:34 [PR PATCH] zstd: clean up template leahneukirchen
2023-08-31 0:58 ` sgn
@ 2023-08-31 1:22 ` sgn
2023-08-31 11:56 ` leahneukirchen
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2023-08-31 1:22 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 254 bytes --]
New comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/pull/45817#issuecomment-1700180969
Comment:
Ah, `cmake` can find its modules by relative path, too. I may look into add `cmake-bootstrap` to the bootstrap path.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: zstd: clean up template.
2023-08-29 16:34 [PR PATCH] zstd: clean up template leahneukirchen
2023-08-31 0:58 ` sgn
2023-08-31 1:22 ` sgn
@ 2023-08-31 11:56 ` leahneukirchen
2023-08-31 15:52 ` sgn
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: leahneukirchen @ 2023-08-31 11:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 224 bytes --]
New comment by leahneukirchen on void-packages repository
https://github.com/void-linux/void-packages/pull/45817#issuecomment-1700899914
Comment:
AFAICS nothing else uses cmake yet, so let's stick to the Makefile for now?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: zstd: clean up template.
2023-08-29 16:34 [PR PATCH] zstd: clean up template leahneukirchen
` (2 preceding siblings ...)
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
5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2023-08-31 15:52 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
New comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/pull/45817#issuecomment-1701301938
Comment:
`1.5.5` doesn't support `cmake` yet,anyway. So, we must stick with `Makefile`. There's ccache that uses `cmake`, but we delayed it until stage1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PR PATCH] [Merged]: zstd: clean up template.
2023-08-29 16:34 [PR PATCH] zstd: clean up template leahneukirchen
` (3 preceding siblings ...)
2023-08-31 15:52 ` sgn
@ 2023-08-31 15:56 ` leahneukirchen
2023-08-31 15:56 ` leahneukirchen
5 siblings, 0 replies; 7+ messages in thread
From: leahneukirchen @ 2023-08-31 15:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 666 bytes --]
There's a merged pull request on the void-packages repository
zstd: clean up template.
https://github.com/void-linux/void-packages/pull/45817
Description:
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: zstd: clean up template.
2023-08-29 16:34 [PR PATCH] zstd: clean up template leahneukirchen
` (4 preceding siblings ...)
2023-08-31 15:56 ` [PR PATCH] [Merged]: " leahneukirchen
@ 2023-08-31 15:56 ` leahneukirchen
5 siblings, 0 replies; 7+ messages in thread
From: leahneukirchen @ 2023-08-31 15:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 273 bytes --]
New comment by leahneukirchen on void-packages repository
https://github.com/void-linux/void-packages/pull/45817#issuecomment-1701308354
Comment:
it does (also ninja): https://gitlab.archlinux.org/archlinux/packaging/packages/zstd/-/blob/main/PKGBUILD?ref_type=heads#L35
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-08-31 15:56 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-29 16:34 [PR PATCH] zstd: clean up template leahneukirchen
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
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).