common/hooks: enable by default 32bit pkgs for x86_64.

This commit is contained in:
Juan RP 2014-03-06 21:03:23 +01:00
parent e060a1284e
commit a26205c634
3 changed files with 14 additions and 13 deletions

View File

@ -144,11 +144,11 @@ hook() {
genpkg ${repo} ${arch} "${_desc}" ${_pkgver} ${binpkg} genpkg ${repo} ${arch} "${_desc}" ${_pkgver} ${binpkg}
fi fi
# Generate 32bit pkg. # Generate 32bit pkg.
if [ -d "${XBPS_DESTDIR}/${pkgname}32-${version}" ]; then if [ -d "${XBPS_DESTDIR}/${pkgname}-32bit-${version}" ]; then
_pkgver=${pkgname}32-${version}_${revision} _pkgver=${pkgname}-32bit-${version}_${revision}
_desc="${short_desc} (32bit)" _desc="${short_desc} (32bit)"
binpkg=${_pkgver}.x86_64.xbps binpkg=${_pkgver}.x86_64.xbps
PKGDESTDIR="${XBPS_DESTDIR}/${pkgname}32-${version}" PKGDESTDIR="${XBPS_DESTDIR}/${pkgname}-32bit-${version}"
genpkg ${repo} x86_64 "${_desc}" ${_pkgver} ${binpkg} genpkg ${repo} x86_64 "${_desc}" ${_pkgver} ${binpkg}
fi fi
} }

View File

@ -1,14 +1,14 @@
# This hook creates a new PKGDESTDIR with 32bit libraries for x86_64. # This hook creates a new PKGDESTDIR with 32bit libraries for x86_64.
# #
# XXX remaining issues: # XXX remaining issues:
# - Conditionalized for now with "lib32" template var.
# - due to ${pkgname} -> ${pkgname}32 renaming, some pkgs have wrong deps # - due to ${pkgname} -> ${pkgname}32 renaming, some pkgs have wrong deps
# (noarch pkgs, dependencies without shlibs). # (noarch pkgs, development pkgs, etc).
hook() { hook() {
local destdir32=${XBPS_DESTDIR}/${pkgname}32-${version} local destdir32=${XBPS_DESTDIR}/${pkgname}-32bit-${version}
if [ -z "$lib32" ]; then # By default always enabled unless "lib32_disabled" is set.
if [ -n "$lib32_disabled" ]; then
return return
fi fi
# This hook will only work when building for x86. # This hook will only work when building for x86.
@ -54,8 +54,9 @@ hook() {
# 32bit dependencies. # 32bit dependencies.
trap - ERR trap - ERR
: > ${destdir32}/rdeps
if [ -s "$PKGDESTDIR/rdeps" ]; then if [ -s "$PKGDESTDIR/rdeps" ]; then
: > $destdir32/rdeps
for f in $(cat ${PKGDESTDIR}/rdeps); do for f in $(cat ${PKGDESTDIR}/rdeps); do
pkgn="$($XBPS_UHELPER_CMD getpkgdepname $f)" pkgn="$($XBPS_UHELPER_CMD getpkgdepname $f)"
if [ -z "${pkgn}" ]; then if [ -z "${pkgn}" ]; then
@ -63,17 +64,17 @@ hook() {
if [ -z "${pkgn}" ]; then if [ -z "${pkgn}" ]; then
msg_error "$pkgver: invalid dependency $f\n" msg_error "$pkgver: invalid dependency $f\n"
fi fi
pkgv="$($XBPS_UHELPER_CMD getpkgversion ${f})" pkgv="-$($XBPS_UHELPER_CMD getpkgversion ${f})"
else else
pkgv="$($XBPS_UHELPER_CMD getpkgdepversion ${f})" pkgv="$($XBPS_UHELPER_CMD getpkgdepversion ${f})"
fi fi
printf "${pkgn}32${pkgv} " >> $destdir32/rdeps printf "${pkgn}-32bit${pkgv} " >> $destdir32/rdeps
done done
fi fi
# If it's a development pkg add a dependency to the 64bit pkg. # If it's a development pkg add a dependency to the 64bit pkg.
if [[ $pkgname =~ '-devel' ]]; then if [[ $pkgname =~ '-devel' ]]; then
printf "${pkgver} " >> $destdir32/rdeps printf "${pkgver} " >> ${destdir32}/rdeps
fi fi
printf "\n" >> $destdir32/rdeps printf "\n" >> ${destdir32}/rdeps
} }

View File

@ -39,7 +39,7 @@ hook() {
pkgdir=$XBPS_REPOSITORY pkgdir=$XBPS_REPOSITORY
fi fi
binpkg=${pkgver}.${arch}.xbps binpkg=${pkgver}.${arch}.xbps
binpkg32=${pkgname}32-${version}_${revision}.x86_64.xbps binpkg32=${pkgname}-32bit-${version}_${revision}.x86_64.xbps
binpkg_dbg=${pkgname}-dbg-${version}_${revision}.${arch}.xbps binpkg_dbg=${pkgname}-dbg-${version}_${revision}.${arch}.xbps
# Register binpkg. # Register binpkg.