Bug 290637 - archivers/brotli: Update to 1.2.0
Summary: archivers/brotli: Update to 1.2.0
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: Sergey A. Osokin
URL: https://github.com/google/brotli/rele...
Keywords:
Depends on: 290726
Blocks: 290725
  Show dependency treegraph
 
Reported: 2025-10-28 18:14 UTC by Daniel Engberg
Modified: 2025-11-16 23:27 UTC (History)
3 users (show)

See Also:
osa: maintainer-feedback+


Attachments
Patch for brotli (2.14 KB, patch)
2025-10-28 18:14 UTC, Daniel Engberg
no flags Details | Diff
Patch for brotli v2 (5.12 KB, patch)
2025-11-09 12:43 UTC, Daniel Engberg
no flags Details | Diff
Patch for brotli v3 (5.01 KB, patch)
2025-11-09 12:47 UTC, Daniel Engberg
no flags Details | Diff
Patch for brotli v4 (4.82 KB, patch)
2025-11-11 19:46 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 2025-10-28 18:14:09 UTC
Created attachment 264978 [details]
Patch for brotli

Compile and runtime tested on FreeBSD 14.3-RELEASE (amd64) (make, make check-plist, make test)

Poudriere testport OK 13.5-RELEASE (amd64)
Poudriere testport OK 13.5-RELEASE (i386)
Poudriere testport OK 14.3-RELEASE (amd64)

"Mini" exp-run looks fine on 14.3-RELEASE (amd64) except for archivers/py-brotli which needs updating.
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2025-10-28 23:27:55 UTC
You say you did a mini exp-run, does this need an exp-run?
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2025-10-29 00:38:12 UTC
(In reply to Antoine Brodin from comment #1)
Maybe? I have limited resources but listed ports from freshports (build and direct dependencies) looks fine.
Comment 3 Sergey A. Osokin freebsd_committer freebsd_triage 2025-10-30 10:54:33 UTC
There are 47 ports require testing:

% find /usr/ports -name Makefile\* | xargs grep "LIB_DEPENDS=.*brotli" | awk -F: '{print $1}' | wc -l
      47
Comment 4 Paavo-Einari Kaipila 2025-11-01 18:56:56 UTC
(In reply to Sergey A. Osokin from comment #3)

I did a regex search for "archivers\/brotli" on Makefiles and found these. Not sure how many of them are optional. I believe just setting OPTIONS+=BROLTI in make.conf should probably catch most.

There probably are some missing from list, all nginx ports and apache at least, because their optional brotli dependency is defined in another file.

ftp/curl
net-mgmt/netdata
www/angie-module-brotli
www/envoy
www/node20
www/elinks
www/links
www/cpp-httplib
www/wget2
www/node24
www/apache24
www/chawan
www/c-icap
www/privoxy
www/trafficserver
www/node22
lang/dotnet
net-p2p/jackett
archivers/p5-IO-Compress-Brotli
archivers/py-brotlicffi
archivers/php-brotli
archivers/py-brotli
net/wireshark
sysutils/nix
textproc/ugrep
databases/arrow
databases/mongosh
graphics/mupdf
graphics/lepton
graphics/libjxl
graphics/brunsli
graphics/py-imagecodecs
graphics/exiv2
mail/cyrus-imapd36
mail/cyrus-imapd312
mail/cyrus-imapd32
mail/cyrus-imapd38
mail/cyrus-imapd30
mail/cyrus-imapd310
mail/cyrus-imapd34
shells/powershell
security/openssl35
security/bitwarden-cli
security/openssl36
security/gnutls
security/openssl33
security/openssl34
devel/woff2
devel/android-tools
devel/apitrace
devel/libsoup3
devel/pecl-swoole
devel/qt6-base
devel/cpprestsdk
x11-fonts/ots
print/freetype2
print/fontforge
x11/xpra
x11/xpra-html5
Comment 5 Paavo-Einari Kaipila 2025-11-01 19:00:59 UTC
(In reply to Paavo-Einari Kaipila from comment #4)

Oh, it did catch apache.

These + all nginxes. Does anyone else know any others?
Comment 6 Sergey A. Osokin freebsd_committer freebsd_triage 2025-11-07 21:49:53 UTC
(In reply to Antoine Brodin from comment #1)

Hi Antoine,
not sure where we are, could you guide me.
Thank you.
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2025-11-08 18:01:07 UTC
(In reply to Sergey A. Osokin from comment #6)
Just push it? Multiple repos have already imported it.
Comment 8 Po-Chuan Hsieh freebsd_committer freebsd_triage 2025-11-08 18:28:25 UTC
It seems the STATIC option is broken with attachment 264978 [details].

% make
...
===>  Patching for brotli-1.2.0,1
===>  Applying extra patch /usr/ports/archivers/brotli/files/extra-patch-static-libs
2 out of 3 hunks failed--saving rejects to CMakeLists.txt.rej
===>  FAILED Applying extra patch /usr/ports/archivers/brotli/files/extra-patch-static-libs
*** Error code 1
Comment 9 Daniel Engberg freebsd_committer freebsd_triage 2025-11-09 12:43:35 UTC
Created attachment 265287 [details]
Patch for brotli v2
Comment 10 Daniel Engberg freebsd_committer freebsd_triage 2025-11-09 12:44:10 UTC
Comment on attachment 265287 [details]
Patch for brotli v2

Fix STATIC option
Comment 11 Daniel Engberg freebsd_committer freebsd_triage 2025-11-09 12:47:36 UTC
Created attachment 265288 [details]
Patch for brotli v3

Adjust plist order
Comment 12 Po-Chuan Hsieh freebsd_committer freebsd_triage 2025-11-11 01:58:24 UTC
Please install the static libraries with the same name as shared libraries.
Comment 13 Po-Chuan Hsieh freebsd_committer freebsd_triage 2025-11-11 06:56:42 UTC
(In reply to Po-Chuan Hsieh from comment #12)

Please use this instead. It fixes the filename of static libraries.

https://people.freebsd.org/~sunpoet/patch/archivers-brotli.txt
Comment 14 Sergey A. Osokin freebsd_committer freebsd_triage 2025-11-11 19:14:04 UTC
(In reply to Po-Chuan Hsieh from comment #13)

Hi Po-Chuan, I like the changes you've suggested, thank you very much.

Daniel, is there any objections on proposed changes?
Thank you.
Comment 15 Daniel Engberg freebsd_committer freebsd_triage 2025-11-11 19:46:00 UTC
Created attachment 265343 [details]
Patch for brotli v4

Force file names to follow shared libs
Comment 16 Daniel Engberg freebsd_committer freebsd_triage 2025-11-11 19:46:59 UTC
Another take on it, no external patch files and only patches when requested.
Probably easier to maintain too than a non upstreamed patch.
Comment 17 Po-Chuan Hsieh freebsd_committer freebsd_triage 2025-11-11 20:07:18 UTC
(In reply to Daniel Engberg from comment #15)
(In reply to Daniel Engberg from comment #16)

I already provided a simple 2-line static patch.

I don't see the benefit for modifying two intermediate file (build.ninja and cmake_install.cmake).

And https://docs.freebsd.org/en/books/porters-handbook/slow-porting/#slow-patch-automatic-replacements would tell you:
! Important
Only use sed(1) to replace variable content. You must use patch files instead of sed(1) to replace static content.
Comment 18 Daniel Engberg freebsd_committer freebsd_triage 2025-11-11 20:11:14 UTC
(In reply to Po-Chuan Hsieh from comment #17)
I'm not sure what part of the build directory you think is not variable content and it's obviously not bundled with sources.
Comment 19 Po-Chuan Hsieh freebsd_committer freebsd_triage 2025-11-11 20:27:10 UTC
(In reply to Daniel Engberg from comment #18)

CMakeLists.txt is a static file.

build.ninja and cmake_install.cmake are intermediate files generate by cmake during the build.

You must use REINPLACE_CMD instead of 2 patch files because it is not there during the patch phase.

The main problem here is, it is totally unnecessary to patch these intermediate files when we could complete the fix with a simple, unconditional patch file during patch phase.

You just make it more complicated.
Comment 20 Daniel Engberg freebsd_committer freebsd_triage 2025-11-11 20:35:47 UTC
(In reply to Po-Chuan Hsieh from comment #19)
You don't really need to explain to me how it works, you have yet to explain what part isn't variable which you initially claimed.

Anyhow, time is better spent working with upstream than adding more local patches to the tree that people need to maintain.
Comment 21 Daniel Engberg freebsd_committer freebsd_triage 2025-11-15 23:58:48 UTC
@ Sergey
Can we please get this going? I don't care which variant you commit, one where you maintain a separate patch file or the other where you don't and just maintain a Makefile.
Comment 22 Sergey A. Osokin freebsd_committer freebsd_triage 2025-11-16 01:28:05 UTC
(In reply to Daniel Engberg from comment #21)

Sure, Daniel, on my way!
Comment 23 commit-hook freebsd_committer freebsd_triage 2025-11-16 01:34:57 UTC
A commit in branch main references this bug:

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

commit bbf491027c2b48691b28f7568e334f807c639bd0
Author:     Sergey A. Osokin <osa@FreeBSD.org>
AuthorDate: 2025-11-16 01:31:00 +0000
Commit:     Sergey A. Osokin <osa@FreeBSD.org>
CommitDate: 2025-11-16 01:31:00 +0000

    archivers/brotli: update 1.1.0 -> 1.2.0

    ChangeLog:      https://github.com/google/brotli/compare/v1.1.0...v1.2.0

    Reported by:    diizzy
    Reviewed by:    sunpoet, diizzy
    PR:             290637
    Sponsored by:   tipi.work

 archivers/brotli/Makefile                          | 18 ++++++----
 archivers/brotli/distinfo                          | 10 +++---
 .../brotli/files/extra-patch-static-libs (gone)    | 40 ----------------------
 archivers/brotli/files/patch-CMakeLists.txt (new)  | 11 ++++++
 4 files changed, 27 insertions(+), 52 deletions(-)
Comment 24 Sergey A. Osokin freebsd_committer freebsd_triage 2025-11-16 01:35:58 UTC
Fixed, thank you very much!
Comment 25 Wes Morgan 2025-11-16 23:25:19 UTC
Hey, this update breaks the py-brotli port --- it is still at version 1.1.0 and requires the same version of brotli. A lot of dependent ports are broken as well.

BUILD_DEPENDS=  brotli>=${PORTVERSION},1<${PORTVERSION}_99,1:archivers/brotli
Comment 26 Daniel Engberg freebsd_committer freebsd_triage 2025-11-16 23:27:55 UTC
(In reply to Wes Morgan from comment #25)
Already listed and see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290725#c5