tech-pkg archive

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

[PATCH] Fix bootstrap on FreeBSD 12.1 (needs -lmd when linking libarchive statically)



Hi all,

I tried my best to do this as properly as possible, but I have a feeling
that I'm not meeting the expected style for this file.

Any suggestions, or else I will commit it soon because bootstrap being
broken is bad.


---

When linking against a static libarchive, also add libarchive's Libs.private.

Index: bootstrap/bootstrap
===================================================================
RCS file: /cvsroot/pkgsrc/bootstrap/bootstrap,v
retrieving revision 1.294
diff -u -r1.294 bootstrap
--- bootstrap/bootstrap	7 Oct 2020 10:44:14 -0000	1.294
+++ bootstrap/bootstrap	18 Oct 2020 14:33:38 -0000
@@ -1235,6 +1235,10 @@
 esac
 
 # bootstrap pkg_install
+extra_libarchive_depends() {
+	$sedprog -n -e 's/Libs.private: //p' $wrkdir/libarchive/build/pkgconfig/libarchive.pc
+}
+
 echo_msg "Bootstrapping pkgtools"
 copy_src $pkgsrcdir/archivers/libarchive/files libarchive
 run_cmd "(cd $wrkdir/libarchive; env $BSTRAP_ENV \
@@ -1253,6 +1257,7 @@
 --with-pkgdbdir=$pkgdbdir --infodir=$infodir \
 --mandir=$mandir $pkg_install_args && \
 STATIC_LIBARCHIVE=$wrkdir/libarchive/.libs/libarchive.a \
+STATIC_LIBARCHIVE_DEPENDS=`extra_libarchive_depends` \
 PKGSRC_MACHINE_ARCH="$machine_arch" $bmake $make_quiet_flags -j$make_jobs)"
 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/add/pkg_add $wrkdir/sbin/pkg_add"
 run_cmd "$install_sh -c -o $user -g $group -m 755 $wrkdir/pkg_install/admin/pkg_admin $wrkdir/sbin/pkg_admin"
Index: pkgtools/pkg_install/files/add/Makefile.in
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/Makefile.in,v
retrieving revision 1.33
diff -u -r1.33 Makefile.in
--- pkgtools/pkg_install/files/add/Makefile.in	27 Dec 2015 12:36:42 -0000	1.33
+++ pkgtools/pkg_install/files/add/Makefile.in	18 Oct 2020 14:33:38 -0000
@@ -29,7 +29,7 @@
 .endif
 LIBS+=		@LIBS@
 .else
-LIBS=		-linstall ${STATIC_LIBARCHIVE} @LIBS@
+LIBS=		-linstall ${STATIC_LIBARCHIVE} ${STATIC_LIBARCHIVE_DEPENDS} @LIBS@
 CPPFLAGS+=	-DBOOTSTRAP
 .endif
 
Index: pkgtools/pkg_install/files/create/Makefile.in
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/create/Makefile.in,v
retrieving revision 1.29
diff -u -r1.29 Makefile.in
--- pkgtools/pkg_install/files/create/Makefile.in	27 Dec 2015 12:36:42 -0000	1.29
+++ pkgtools/pkg_install/files/create/Makefile.in	18 Oct 2020 14:33:38 -0000
@@ -33,7 +33,7 @@
 LIBS+=		-lssl -lcrypto
 .endif
 .else
-LIBS=		-linstall ${STATIC_LIBARCHIVE} @LIBS@
+LIBS=		-linstall ${STATIC_LIBARCHIVE} ${STATIC_LIBARCHIVE_DEPENDS} @LIBS@
 CPPFLAGS+=	-DBOOTSTRAP
 .endif
 



Home | Main Index | Thread Index | Old Index