Bug 276754 - multimedia/libzen: Use proper upstream versioning and switch to CMake
Summary: multimedia/libzen: Use proper upstream versioning and switch to CMake
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: Daniel Engberg
URL: https://github.com/MediaArea/ZenLib/r...
Keywords:
Depends on:
Blocks: 276755
  Show dependency treegraph
 
Reported: 2024-01-31 23:05 UTC by Daniel Engberg
Modified: 2024-03-28 22:28 UTC (History)
0 users

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


Attachments
Patch for libzen (3.09 KB, patch)
2024-01-31 23:05 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2024-01-31 23:05:28 UTC
Created attachment 248105 [details]
Patch for libzen

* Use proper upstream version [1] and what other distros are using [2]
* Switch to separate source archives
* Switch to CMake which brings us much closer to other distributions
* Sanitize source code

1: https://github.com/MediaArea/ZenLib
2: https://repology.org/project/libzen/versions , https://repology.org/project/zenlib/versions

Compile and runtime tested on FreeBSD 14.0-RELEASE (amd64) (make, make check-plist)
Poudriere testport OK 14.0-RELEASE (amd64)
Poudriere testport OK 13.2-RELEASE (amd64)
Comment 1 Po-Chuan Hsieh freebsd_committer freebsd_triage 2024-02-13 08:38:59 UTC
The versioning is totally incorrect. If you check it more carefully, you'll see that mediainfo is not using libzen 0.4.41.

Again, libzen is an internal/personal library used by upstream only for mediainfo project. The correct one is the snapshot used in the all-in-one tarball, not 0.4.41. We should use the libzen from the same tarball of mediainfo to avoid any compatibility issue. That's why I'm against using the so-called source archives.

I split mediainfo into 3 ports just to simply the Makefile. Otherwise, it should simply be 1 port which builds the library and the app. That's what CLI_Compile.sh does.

I'll update this port later when I'm available (after catching up with the huge amount of commits).
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2024-02-13 21:18:09 UTC
Actually this patch makes the port correspond to the correct source the port claims to provide.

diizzy@freebsd-dev:~/mediainfo % fetch "https://mediaarea.net/download/source/libzen/0.4.41/libzen_0.4.41.tar.xz"
libzen_0.4.41.tar.xz                                   115 kB  954 kBps    00s
diizzy@freebsd-dev:~/mediainfo % tar xf libzen_0.4.41.tar.xz
diizzy@freebsd-dev:~/mediainfo % fetch "https://github.com/MediaArea/ZenLib/archive/refs/tags/v0.4.41.tar.gz"
fetch: https://github.com/MediaArea/ZenLib/archive/refs/tags/v0.4.41.tar.gz: size of remote file is not known
v0.4.41.tar.gz                                         154 kB 1741 kBps    00s
diizzy@freebsd-dev:~/mediainfo % tar xf v0.4.41.tar.gz
diizzy@freebsd-dev:~/mediainfo % diff -r ZenLib-0.4.41 ZenLib
Only in ZenLib-0.4.41: .github
Only in ZenLib-0.4.41: .gitignore

You're correct that the latest bundled archive does not provide 0.4.41 but a snapshot of master branch for libzen. Even if we were go with the snapshots the current versioning is incorrect and should follow Porters Handbook. Upstream also uses the same version schema for libzen and nonot Year.Month.
https://mediaarea.net/fr/MediaInfo/Download/Debian

They also recognize using Git Tags,
https://mediaarea.net/fr/MediaInfo/Download/Arch_Linux

There are also other projects using libzen but I don't see how that is relevant to reporting correct version.
Examples: https://gitlab.com/cubocore/coreapps/coreinfo
https://pkgs.alpinelinux.org/package/edge/community/x86/coreinfo

Best regards,
Daniel
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-03-28 22:27:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1a2f57d29bcc8c5cd27973998909c5e519f90457

commit 1a2f57d29bcc8c5cd27973998909c5e519f90457
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2024-03-28 22:06:52 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2024-03-28 22:25:58 +0000

    multimedia/libzen: Adjust package version

    Upstream bundles libzen (named ZenLib upstream) both separately and
    as a all-in-one bundle with mediainfo (multimedia/mediainfo) releases.
    Libzen do not share the same versioning schema as mediainfo and hence
    shouldn't use it. Upstream bundles snapshots of libzen however only
    release versions are tracked (current version is defined as 0.4.41).
    Current release bundle archive ships the latest commit of libzen
    available and following Porters Handbook append commit date to
    release version. Worth noting is that separate version provided
    on upstream's download page corresponds to the tagged version on
    GitHub.

    Sources:
    https://github.com/MediaArea/ZenLib
    https://mediaarea.net/en/MediaInfo/Download/Source

    PR:             276754
    Approved by:    portmgr (maintainer timeout, 1+ month)

 multimedia/libzen/Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)