xbps-src: multiple changes to improve infrastructure.
- Remove buildvars_funcs.sh, its code has been moved into set_tmpl_common_vars(). - Move stripping code into its own file, and don't run it via fakeroot. - Remove unnecesary reset_tmpl_vars() call in install_pkg(). - Misc changes.
This commit is contained in:
parent
90a9ea320b
commit
c34e13336b
7 changed files with 146 additions and 117 deletions
|
@ -61,7 +61,6 @@ info_tmpl()
|
|||
#
|
||||
reset_tmpl_vars()
|
||||
{
|
||||
local v=
|
||||
local TMPL_VARS="pkgname distfiles configure_args configure_env \
|
||||
make_build_args make_install_args build_style \
|
||||
short_desc maintainer long_desc checksum wrksrc \
|
||||
|
@ -81,14 +80,9 @@ reset_tmpl_vars()
|
|||
pre_remove post_remove post_stow do_build do_install \
|
||||
XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \
|
||||
XBPS_BUILD_DONE XBPS_INSTALL_DONE FILESDIR DESTDIR \
|
||||
SRCPKGDESTDIR PATCHESDIR"
|
||||
|
||||
for v in ${TMPL_VARS}; do
|
||||
eval unset "$v"
|
||||
done
|
||||
|
||||
. $XBPS_SHUTILSDIR/buildvars_funcs.sh
|
||||
unset_build_vars
|
||||
SRCPKGDESTDIR PATCHESDIR CFLAGS CXXFLAGS CPPFLAGS \
|
||||
CC CXX LDFLAGS LD_LIBRARY_PATH"
|
||||
eval unset "$TMPL_VARS"
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -99,6 +93,7 @@ setup_tmpl()
|
|||
local pkg="$1"
|
||||
|
||||
[ -z "$pkg" ] && return 1
|
||||
|
||||
if [ "$pkgname" = "$pkg" ]; then
|
||||
[ -n "$DESTDIR" ] && return 0
|
||||
fi
|
||||
|
@ -111,7 +106,6 @@ setup_tmpl()
|
|||
reset_tmpl_vars
|
||||
. $XBPS_SRCPKGDIR/${pkg}/template
|
||||
prepare_tmpl
|
||||
set_build_vars
|
||||
else
|
||||
msg_error "Cannot find $pkg build template file."
|
||||
fi
|
||||
|
@ -242,14 +236,6 @@ prepare_tmpl()
|
|||
XBPS_POST_INSTALL_DONE="$wrksrc/.xbps_post_install_done"
|
||||
|
||||
set_tmpl_common_vars
|
||||
|
||||
if [ -z "$in_chroot" ]; then
|
||||
export PATH="$XBPS_MASTERDIR/bin:$XBPS_MASTERDIR/sbin"
|
||||
export PATH="$PATH:$XBPS_MASTERDIR/usr/bin"
|
||||
export PATH="$PATH:$XBPS_MASTERDIR/usr/sbin"
|
||||
export PATH="$PATH:/bin:/sbin:/usr/bin:/usr/sbin"
|
||||
export PATH="$PATH:/sbin:@@XBPS_INSTALL_PREFIX@@/sbin"
|
||||
fi
|
||||
}
|
||||
|
||||
remove_tmpl_wrksrc()
|
||||
|
@ -260,7 +246,7 @@ remove_tmpl_wrksrc()
|
|||
return 1
|
||||
fi
|
||||
|
||||
msg_normal "Cleaning '$pkgname' build directory... "
|
||||
msg_normal "Cleaning '${sourcepkg}' build directory... "
|
||||
rm -rf $lwrksrc
|
||||
return $?
|
||||
}
|
||||
|
@ -276,4 +262,24 @@ set_tmpl_common_vars()
|
|||
sourcepkg=${pkgname}
|
||||
fi
|
||||
SRCPKGDESTDIR=${XBPS_DESTDIR}/${sourcepkg}-${version}
|
||||
|
||||
export CFLAGS="$XBPS_CFLAGS"
|
||||
export CXXFLAGS="$XBPS_CXXFLAGS"
|
||||
export CPPFLAGS="-I$XBPS_MASTERDIR/usr/include"
|
||||
|
||||
if [ -z "$in_chroot" ]; then
|
||||
if [ -d /usr/lib/libfakeroot ]; then
|
||||
LDLIBPATH="/usr/lib/libfakeroot:$XBPS_MASTERDIR/usr/lib"
|
||||
else
|
||||
LDLIBPATH="$XBPS_MASTERDIR/usr/lib"
|
||||
fi
|
||||
if [ -n "$BUILD_32BIT" ]; then
|
||||
export CC="gcc -m32"
|
||||
export CXX="g++ -m32"
|
||||
LDLIBPATH="$LDLIBPATH:/lib32:/usr/lib32"
|
||||
LDFLAGS="-L/lib32 -L/usr/lib32"
|
||||
fi
|
||||
export LDFLAGS="$LDFLAGS -L$XBPS_MASTERDIR/usr/lib"
|
||||
export LD_LIBRARY_PATH="$LDLIBPATH"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue