pkg/59949: archivers/lzlib: Fix build on Darwin

"Brian Callahan via gnats" <[email protected]>
Newsgroups gmane.os.netbsd.devel.pkgsrc.bugs
Message-ID <[email protected]>
>Number:         59949
>Category:       pkg
>Synopsis:       archivers/lzlib: Fix build on Darwin
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 26 17:35:00 +0000 2026
>Originator:     [email protected]
>Release:        Darwin 21.6.0
>Organization:
>Environment:
System: Darwin Brians-Mini-2 21.6.0 Darwin Kernel Version 21.6.0: Mon Jun 24 00:56:10 PDT 2024; root:xnu-8020.240.18.709.2~1/RELEASE_X86_64 x86_64
>Description:
On macOS 12.7.6, archivers/lzlib fails to link with this error:
gcc -Wall -W -O2  -fpic -fPIC -shared -Wl,--soname=liblz.so.1 -o liblz.so.1.14 lzlib_sh.o
ld: unknown option: --soname=liblz.so.1
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:61: liblz.so.1.14] Error 1

The fix below fixes it. Unfortunately, it installs as .so files instead of .dylib files, but macOS is smart enough to do the right thing with that.

Tested by successfully building and linking net/wget2 with lzlib (see my previous PR).
>How-To-Repeat:

>Fix:
diff --git a/archivers/lzlib/Makefile b/archivers/lzlib/Makefile
index fa0ff40f17a4..b8d755a0cf09 100644
--- a/archivers/lzlib/Makefile
+++ b/archivers/lzlib/Makefile
@@ -17,6 +17,7 @@ INFO_FILES=	yes
 
 CONFIGURE_ARGS+=	--prefix=${PREFIX} --infodir=${PREFIX}/${PKGINFODIR} --enable-shared
 
+BUILDLINK_TRANSFORM.Darwin+=	opt:-Wl,--soname=liblz.so.1:-Wl,-install_name,${PREFIX}/lib/liblz.so.1
 BUILDLINK_TRANSFORM.SunOS+=	opt:-Wl,--soname=liblz.so.1:-Wl,-soname,liblz.so.1
 
 TEST_TARGET=	check
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.