From aaf2d1487eb3503bcbc7e3915b105865362bef98 Mon Sep 17 00:00:00 2001 From: oreo639 Date: Tue, 14 Feb 2023 18:36:41 -0800 Subject: [PATCH] libtool: fix include paths when cross compiling --- srcpkgs/libtool/template | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template index cd7c684c5945..fa6691a4a444 100644 --- a/srcpkgs/libtool/template +++ b/srcpkgs/libtool/template @@ -1,7 +1,7 @@ # Template file for 'libtool' pkgname=libtool version=2.4.7 -revision=3 +revision=4 build_style=gnu-configure hostmakedepends="texinfo perl automake help2man xz gnulib tar" depends="tar sed grep" @@ -50,6 +50,27 @@ post_install() { vsed -i -e "s,\-I${XBPS_CROSS_BASE}/usr/include,,g" \ ${PKGDESTDIR}/usr/bin/libtool + # Don't hardcode gcc object paths + vsed -i -e 's/^\(predep_objects\)=.*/\1=""/' \ + -e 's/^\(postdep_objects\)=.*/\1=""/' \ + -e 's/^\(archive_cmds=\".*\) -nostdlib /\1 /' \ + -e 's/^\(archive_expsym_cmds=\".*\) -nostdlib /\1 /' \ + ${PKGDESTDIR}/usr/bin/libtool + + # Strip cross sysroot from paths + vsed -i -e "s,${XBPS_CROSS_BASE},,g" \ + ${PKGDESTDIR}/usr/bin/libtool + + if [ "$XBPS_TARGET_WORDSIZE" = "64" ]; then + vsed -i \ + -e "s,/${XBPS_CROSS_TRIPLET}/lib/../lib64,/lib64,g" \ + ${PKGDESTDIR}/usr/bin/libtool + else + vsed -i \ + -e "s,/${XBPS_CROSS_TRIPLET}/lib,/lib,g" \ + ${PKGDESTDIR}/usr/bin/libtool + fi + # canonicalize host_alias, replace build(_alias,_os) _canonical_host=$(grep "^host=" ${PKGDESTDIR}/usr/bin/libtool | sed 's/host=//') _host_os=$(grep "^host_os=" ${PKGDESTDIR}/usr/bin/libtool | sed 's/host_os=//')