Bug 267652 - archivers/zstd: Update to 1.5.4
Summary: archivers/zstd: Update to 1.5.4
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL: https://github.com/facebook/zstd/rele...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-08 20:16 UTC by Dima Panov
Modified: 2023-04-05 06:16 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
archivers/zstd: convert to cmake (2.50 KB, patch)
2022-11-08 20:16 UTC, Dima Panov
no flags Details | Diff
convert to cmake (2.67 KB, patch)
2022-11-23 21:48 UTC, Dima Panov
no flags Details | Diff
Patch for zstd (13.67 KB, patch)
2023-02-12 20:56 UTC, Daniel Engberg
no flags Details | Diff
zstd 1.5.4 pure cmake (3.26 KB, patch)
2023-02-14 16:52 UTC, Dima Panov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dima Panov freebsd_committer freebsd_triage 2022-11-08 20:16:56 UTC
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.
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2022-11-08 23:26:29 UTC
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.
Comment 2 Dima Panov freebsd_committer freebsd_triage 2022-11-09 04:26:09 UTC
(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
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2022-11-09 11:07:52 UTC
I overlooked https://cgit.freebsd.org/ports/tree/devel/cmake-core/files/InitialCache.cmake sorry for the noise
Comment 4 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-11-23 21:20:58 UTC
(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
Comment 5 Dima Panov freebsd_committer freebsd_triage 2022-11-23 21:40:54 UTC
(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 :(
Comment 6 Dima Panov freebsd_committer freebsd_triage 2022-11-23 21:48:50 UTC
Created attachment 238284 [details]
convert to cmake

Patch v2, with incorporated upstream fix for pc-file generation
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2023-02-11 06:16:02 UTC
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
Comment 8 Daniel Engberg freebsd_committer freebsd_triage 2023-02-11 06:18:28 UTC
...and here's the tree with release variants of cmake files
https://git.alpinelinux.org/aports/tree/main/zstd?id=1108d0b36495b2f0ab5212c9b1649561ff6fca55
Comment 9 Daniel Engberg freebsd_committer freebsd_triage 2023-02-12 20:56:16 UTC
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)
Comment 10 Daniel Engberg freebsd_committer freebsd_triage 2023-02-12 20:58:24 UTC
This would be a good compromise no? :)
Comment 11 Dima Panov freebsd_committer freebsd_triage 2023-02-14 16:52:01 UTC
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
Comment 12 Dima Panov freebsd_committer freebsd_triage 2023-03-04 11:44:31 UTC
Friendly ping.
Comment 13 Daniel Engberg freebsd_committer freebsd_triage 2023-03-13 09:07:47 UTC
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.
Comment 14 Dima Panov freebsd_committer freebsd_triage 2023-03-13 14:57:20 UTC
(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
Comment 15 commit-hook freebsd_committer freebsd_triage 2023-04-05 06:15:26 UTC
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(-)
Comment 16 Daniel Engberg freebsd_committer freebsd_triage 2023-04-05 06:16:47 UTC
Not really fixed since 1.5.4 got pushed before this PR but at fixes the issue for now at least.