Created attachment 237956 [details] archivers/zstd: convert to cmake Currently zstd builds with gmake and it leads to skip install critical cmake configs which are hardly required to detect zstd in recent cmake-based programs. As good example we have a consumers of minizip-ng which is required to build latest OpenImageIO releases and hardlinked to zstd.
This breaks make test :( pc file is missing -pthread (might be fixed by https://github.com/facebook/zstd/commit/a0b09d0ff735d34fd99029bb59ffff2874565b42) It also causes a circular dependency with libarchive which cmake's depends on. Alpine Linux already had its fun with it... https://git.alpinelinux.org/aports/log/main/zstd Personally I would preferred Meson and this workaround simply because it builds much faster but maintainer wanted to stick with gmake. I guess we can use Alpine's workaround too even if it's not ideal.
(In reply to Daniel Engberg from comment #1) No more a circular dependencies. Cmake is not requre a ports libarchive but use a system one since https://cgit.freebsd.org/ports/commit/?id=cbdb82ae536d83e4c7ffa8ef4b6fb150afe3f1c7
I overlooked https://cgit.freebsd.org/ports/tree/devel/cmake-core/files/InitialCache.cmake sorry for the noise
(In reply to Dima Panov from comment #0) I changed to gmake because it is the official support. [1] https://github.com/facebook/zstd/blob/dev/README.md#build-instructions
(In reply to Po-Chuan Hsieh from comment #4) Cmake is also a standard supported way to satisfy the requirements of consumers. I have no issues with gmake buit it not generate required cmake configs :(
Created attachment 238284 [details] convert to cmake Patch v2, with incorporated upstream fix for pc-file generation
There's another take on it https://git.alpinelinux.org/aports/tree/main/zstd/ Notes in https://git.alpinelinux.org/aports/tree/main/zstd/APKBUILD#n55 worth considering
...and here's the tree with release variants of cmake files https://git.alpinelinux.org/aports/tree/main/zstd?id=1108d0b36495b2f0ab5212c9b1649561ff6fca55
Created attachment 240116 [details] Patch for zstd Update to 1.5.4 * Use upstream's short test for "make test" * Use verbose output by default during build * Tweak Makefile to follow Porters Handbook more closely * Install CMake files (taken from CMake build framework) Changelog: https://github.com/facebook/zstd/releases/tag/v1.5.4 Compile and runtime tested on FreeBSD 13.1-STABLE (amd64) (make, make test, make check-plist) Poudriere testport OK 12.3-RELEASE (amd64) Poudriere testport OK 13.1-RELEASE (i386)
This would be a good compromise no? :)
Created attachment 240158 [details] zstd 1.5.4 pure cmake Just to have a choice here -- converted to cmake to keep less patches and generate corrresponding configs by native way
Friendly ping.
Dima, Can you do an exp-run yourself or request one? It would be nice to get this in before branching q2 and have at least 1 week of "testing" in tree.
(In reply to Daniel Engberg from comment #13) I use it in my usual everyday build with no issues Can run full exp-run at my buildbox, sure
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=72ad532057c9f9fb6fa370c80f663c005e9dd021 commit 72ad532057c9f9fb6fa370c80f663c005e9dd021 Author: Daniel Engberg <diizzy@FreeBSD.org> AuthorDate: 2023-04-05 06:12:08 +0000 Commit: Daniel Engberg <diizzy@FreeBSD.org> CommitDate: 2023-04-05 06:12:14 +0000 archivers/zstd: Add CMake config files and adjust Makefile - Use upstream's short test for "make test" - Use verbose output by default during build * Tweak Makefile to follow Porters Handbook more closely * Install CMake files (taken from CMake build framework) PR: 267652 Reported by: fluffy Approved by: portmgr (maintainer timeout, 1+ month) archivers/zstd/Makefile | 45 ++++++-- archivers/zstd/distinfo | 2 +- archivers/zstd/files/zstdConfig.cmake.in (new) | 1 + .../zstd/files/zstdConfigVersion.cmake.in (new) | 70 +++++++++++++ .../files/zstdTargets-BUILD_TYPE.cmake.in (new) | 29 ++++++ archivers/zstd/files/zstdTargets.cmake.in (new) | 115 +++++++++++++++++++++ archivers/zstd/pkg-plist | 6 +- 7 files changed, 257 insertions(+), 11 deletions(-)
Not really fixed since 1.5.4 got pushed before this PR but at fixes the issue for now at least.