pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools/pkgin



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Fri Dec  6 10:19:35 UTC 2024

Modified Files:
        pkgsrc/pkgtools/pkgin: options.mk

Log Message:
pkgin: Add pkgin-static option.

This ensures pkgin links all pkgsrc libraries statically.  I've used a
variant of this patch for my illumos and macOS binary builds for a long
time now, and it works very well to eliminate a whole class of potential
upgrade problems.

Not enabled by default, as it can be specific to each OS and
configuration, but is highly recommended for anyone distributing binary
package repositories.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/pkgtools/pkgin/options.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pkgin/options.mk
diff -u pkgsrc/pkgtools/pkgin/options.mk:1.4 pkgsrc/pkgtools/pkgin/options.mk:1.5
--- pkgsrc/pkgtools/pkgin/options.mk:1.4        Sun Oct 17 10:06:28 2021
+++ pkgsrc/pkgtools/pkgin/options.mk    Fri Dec  6 10:19:35 2024
@@ -1,7 +1,7 @@
-# $NetBSD: options.mk,v 1.4 2021/10/17 10:06:28 nia Exp $
+# $NetBSD: options.mk,v 1.5 2024/12/06 10:19:35 jperkin Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.pkgin
-PKG_SUPPORTED_OPTIONS= pkgin-prefer-gzip
+PKG_SUPPORTED_OPTIONS= pkgin-prefer-gzip pkgin-static
 
 .include "../../mk/bsd.prefs.mk"
 
@@ -16,6 +16,25 @@ PKG_SUGGESTED_OPTIONS=       pkgin-prefer-gzip
 
 .include "../../mk/bsd.options.mk"
 
-.if !empty(PKG_OPTIONS:Mpkgin-prefer-gzip)
+.if ${PKG_OPTIONS:Mpkgin-prefer-gzip}
 CPPFLAGS+=     -DPREFER_GZIP_SUMMARY
 .endif
+
+#
+# Link pkgsrc libraries statically where possible, avoiding a large number of
+# potential upgrade issues.  This is a bit hacky and OS-specific so is not
+# enabled by default, but has been proven by large installations to work well.
+#
+.if ${PKG_OPTIONS:Mpkgin-static}
+# All implicit dependents of the main shared libraries need to be added.
+LIBS.Darwin+=  -lbz2 -liconv -llzma -lz
+LIBS.SunOS+=   -lbz2 -llzma -lm -lnsl -lz
+
+.  for dep in libarchive sqlite3 libfetch openssl
+BUILDLINK_DEPMETHOD.${dep}=    build
+.  endfor
+
+pre-configure:
+       ${RM} -f ${BUILDLINK_DIR}/lib/*.dylib
+       ${RM} -f ${BUILDLINK_DIR}/lib/*.so*
+.endif



Home | Main Index | Thread Index | Old Index