I noticed the comment in net/curl about a circular dependency if brotli
support was added there (curl -> brotli -> cmake -> curl). Other OS do
include brotli support so I thought I'd take a look at brotli and see
what's happening.

When brotli was added to ports back in 2016, cmake was a natural choice,
the only other options were Bazel and Premake. But it seems an autotools
build was added in v1.0.2 (based on timings I'm guessing it's likely
this was done exactly so it could be added to curl).

What does anyone think about changing across?

Switching would also clean up static libraries names which are broken in
the cmake build (someone didn't know about "set_target_properties(x-static
PROPERTIES OUTPUT_NAME x)").

I'm not proposing adding this to curl at present (we'd want to make sure
that this builds OK on all archs first) but, if built to include brotli
support, it does work correctly (testable with "curl --compressed
https://httpbin.org/brotli";).

(I made sure that there are no symbol changes between cmake and autoconf
builds in case one or the other was doing anything tricky with link
options - seemed unlikely but usually best to make sure when changing
build system).

Index: Makefile
===================================================================
RCS file: /cvs/ports/archivers/brotli/Makefile,v
diff -u -p -r1.12 Makefile
--- Makefile    11 Mar 2022 18:16:18 -0000      1.12
+++ Makefile    21 Feb 2025 12:06:31 -0000
@@ -3,7 +3,7 @@ COMMENT =               generic lossless compressor
 GH_ACCOUNT =           google
 GH_PROJECT =           brotli
 GH_TAGNAME =           v1.0.9
-REVISION =             0
+REVISION =             1

 SHARED_LIBS +=  brotlicommon              1.2 # 1.0.9
 SHARED_LIBS +=  brotlidec                 1.1 # 1.0.9
@@ -18,11 +18,20 @@ PERMIT_PACKAGE =    Yes

 WANTLIB += c m

-MODULES =              devel/cmake
+CONFIGURE_STYLE =      autoreconf
+AUTORECONF =           ./bootstrap
+AUTOCONF_VERSION =     2.71
+AUTOMAKE_VERSION =     1.16

 DEBUG_PACKAGES =       ${BUILD_PACKAGES}

 post-install:
        ${INSTALL_MAN} ${WRKSRC}/docs/brotli.1 ${PREFIX}/man/man1
+
+do-test:
+       -ln -s .. ${WRKSRC}/tests/bin
+       -ln -s . ${WRKSRC}/tests/tests
+       mkdir -p ${WRKSRC}/tests/bin/tmp
+       cd ${WRKSRC}/tests; ${MAKE_PROGRAM}

 .include <bsd.port.mk>
Index: patches/patch-bootstrap
===================================================================
RCS file: patches/patch-bootstrap
diff -N patches/patch-bootstrap
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-bootstrap     21 Feb 2025 12:06:31 -0000
@@ -0,0 +1,14 @@
+Index: bootstrap
+--- bootstrap.orig
++++ bootstrap
+@@ -5,10 +5,6 @@ echo "WARNING: OSX autogen build is not supported"
+ fi
+
+ REQUIRED='is required, but not installed.'
+-bc -v >/dev/null 2>&1 || { echo >&2 "'bc' $REQUIRED"; exit 1; }
+-if [ `uname -s` != "FreeBSD" ]; then
+-sed --version >/dev/null 2>&1 || { echo >&2 "'sed' $REQUIRED"; exit 1; }
+-fi
+ autoreconf --version >/dev/null 2>&1 || { echo >&2 "'autoconf' $REQUIRED"; 
exit 1; }
+
+ # If libtool is not installed -> "error: Libtool library used but 'LIBTOOL' 
is undefined"
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/archivers/brotli/pkg/PLIST,v
diff -u -p -r1.6 PLIST
--- pkg/PLIST   11 Mar 2022 18:16:18 -0000      1.6
+++ pkg/PLIST   21 Feb 2025 12:06:31 -0000
@@ -4,13 +4,18 @@ include/brotli/decode.h
 include/brotli/encode.h
 include/brotli/port.h
 include/brotli/types.h
-@static-lib lib/libbrotlicommon-static.a
+@static-lib lib/libbrotlicommon.a
+lib/libbrotlicommon.la
 @lib lib/libbrotlicommon.so.${LIBbrotlicommon_VERSION}
-@static-lib lib/libbrotlidec-static.a
+@static-lib lib/libbrotlidec.a
+lib/libbrotlidec.la
 @lib lib/libbrotlidec.so.${LIBbrotlidec_VERSION}
-@static-lib lib/libbrotlienc-static.a
+@static-lib lib/libbrotlienc.a
+lib/libbrotlienc.la
 @lib lib/libbrotlienc.so.${LIBbrotlienc_VERSION}
 lib/pkgconfig/libbrotlicommon.pc
 lib/pkgconfig/libbrotlidec.pc
 lib/pkgconfig/libbrotlienc.pc
 @man man/man1/brotli.1
+share/doc/brotli/
+share/doc/brotli/README

Reply via email to