diff --git a/xbps-src/libexec/xbps-src-doinst-helper.sh.in b/xbps-src/libexec/xbps-src-doinst-helper.sh.in index 3196bc53e58..ba71c2a78bb 100644 --- a/xbps-src/libexec/xbps-src-doinst-helper.sh.in +++ b/xbps-src/libexec/xbps-src-doinst-helper.sh.in @@ -88,6 +88,8 @@ install_src_phase() || msg_error "can't change cwd to build_wrksrc!" fi + set_build_vars + # Run pre_install func. run_func pre_install 2>${wrksrc}/.xbps_pre_install.log \ || msg_error "$pkgname: pre_install() failed! check $wrksrc/.xbps_pre_install.log" @@ -115,6 +117,8 @@ install_src_phase() run_func post_install 2>${wrksrc}/.xbps_post_install.log \ || msg_error "$pkgname: post_install() failed! check $wrksrc/.xbps_post_install.log" + unset_build_vars + # Remove libtool archives by default. if [ -z "$keep_libtool_archives" ]; then find ${DESTDIR} -type f -name \*.la -delete @@ -158,9 +162,11 @@ install_src_phase() . $XBPS_SRCPKGDIR/${sourcepkg}/${subpkg}.template pkgname=${subpkg} set_tmpl_common_vars + set_build_vars run_func do_install \ 2>${wrksrc}/.xbps_do_install_${pkgname}.log || \ msg_error "$pkgname: do_install() failed! check $wrksrc/.xbps_do_install_$pkgname.log" + unset_build_vars done # @@ -185,9 +191,7 @@ make_install() fi [ -z "$make_cmd" ] && make_cmd=make - . $XBPS_SHUTILSDIR/buildvars_funcs.sh - set_build_vars # # Install package via make. @@ -195,9 +199,6 @@ make_install() { ${make_cmd} ${make_install_target} ${make_install_args} \ 2>&1 | tee $wrksrc/.xbps_make_install.log; } \ || msg_error "$pkgname: make install failed! check $wrksrc/.xbps_make_install.log" - - # Unset build vars. - unset_build_vars } [ -z "$PKG_TMPLNAME" ] && exit 1 diff --git a/xbps-src/shutils/buildvars_funcs.sh b/xbps-src/shutils/buildvars_funcs.sh index 4211a5f5551..73245484ae5 100644 --- a/xbps-src/shutils/buildvars_funcs.sh +++ b/xbps-src/shutils/buildvars_funcs.sh @@ -32,7 +32,10 @@ set_build_vars() { if [ -z "$in_chroot" ]; then SAVE_LDLIBPATH=$LD_LIBRARY_PATH - LD_LIBRARY_PATH="$XBPS_MASTERDIR/usr/lib:$LD_LIBRARY_PATH" + if [ -d /usr/lib/libfakeroot ]; then + LDLIBPATH="/usr/lib/libfakeroot" + fi + LD_LIBRARY_PATH="$LDLIBPATH:$XBPS_MASTERDIR/usr/lib:$LD_LIBRARY_PATH" PKG_CONFIG="$XBPS_MASTERDIR/usr/bin/pkg-config" PKG_CONFIG_LIBDIR="$XBPS_MASTERDIR/usr/lib/pkgconfig" LDFLAGS="-L$XBPS_MASTERDIR/usr/lib"