From a26205c634b7a7a43bae4505edaa27bd11f65b90 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 6 Mar 2014 21:03:23 +0100 Subject: [PATCH] common/hooks: enable by default 32bit pkgs for x86_64. --- common/hooks/do-pkg/00-gen-pkg.sh | 6 +++--- common/hooks/post-install/06-prepare-32bit.sh | 19 ++++++++++--------- common/hooks/post-pkg/00-register-pkg.sh | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/common/hooks/do-pkg/00-gen-pkg.sh b/common/hooks/do-pkg/00-gen-pkg.sh index 88c24bab14a..e38f9b507ff 100644 --- a/common/hooks/do-pkg/00-gen-pkg.sh +++ b/common/hooks/do-pkg/00-gen-pkg.sh @@ -144,11 +144,11 @@ hook() { genpkg ${repo} ${arch} "${_desc}" ${_pkgver} ${binpkg} fi # Generate 32bit pkg. - if [ -d "${XBPS_DESTDIR}/${pkgname}32-${version}" ]; then - _pkgver=${pkgname}32-${version}_${revision} + if [ -d "${XBPS_DESTDIR}/${pkgname}-32bit-${version}" ]; then + _pkgver=${pkgname}-32bit-${version}_${revision} _desc="${short_desc} (32bit)" binpkg=${_pkgver}.x86_64.xbps - PKGDESTDIR="${XBPS_DESTDIR}/${pkgname}32-${version}" + PKGDESTDIR="${XBPS_DESTDIR}/${pkgname}-32bit-${version}" genpkg ${repo} x86_64 "${_desc}" ${_pkgver} ${binpkg} fi } diff --git a/common/hooks/post-install/06-prepare-32bit.sh b/common/hooks/post-install/06-prepare-32bit.sh index 0e834d14b14..7dac08d2497 100644 --- a/common/hooks/post-install/06-prepare-32bit.sh +++ b/common/hooks/post-install/06-prepare-32bit.sh @@ -1,14 +1,14 @@ # This hook creates a new PKGDESTDIR with 32bit libraries for x86_64. # # XXX remaining issues: -# - Conditionalized for now with "lib32" template var. # - due to ${pkgname} -> ${pkgname}32 renaming, some pkgs have wrong deps -# (noarch pkgs, dependencies without shlibs). +# (noarch pkgs, development pkgs, etc). 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 fi # This hook will only work when building for x86. @@ -54,8 +54,9 @@ hook() { # 32bit dependencies. trap - ERR + : > ${destdir32}/rdeps + if [ -s "$PKGDESTDIR/rdeps" ]; then - : > $destdir32/rdeps for f in $(cat ${PKGDESTDIR}/rdeps); do pkgn="$($XBPS_UHELPER_CMD getpkgdepname $f)" if [ -z "${pkgn}" ]; then @@ -63,17 +64,17 @@ hook() { if [ -z "${pkgn}" ]; then msg_error "$pkgver: invalid dependency $f\n" fi - pkgv="$($XBPS_UHELPER_CMD getpkgversion ${f})" + pkgv="-$($XBPS_UHELPER_CMD getpkgversion ${f})" else pkgv="$($XBPS_UHELPER_CMD getpkgdepversion ${f})" fi - printf "${pkgn}32${pkgv} " >> $destdir32/rdeps + printf "${pkgn}-32bit${pkgv} " >> $destdir32/rdeps done fi # If it's a development pkg add a dependency to the 64bit pkg. if [[ $pkgname =~ '-devel' ]]; then - printf "${pkgver} " >> $destdir32/rdeps + printf "${pkgver} " >> ${destdir32}/rdeps fi - printf "\n" >> $destdir32/rdeps + printf "\n" >> ${destdir32}/rdeps } diff --git a/common/hooks/post-pkg/00-register-pkg.sh b/common/hooks/post-pkg/00-register-pkg.sh index 5ccb6ce44bc..db0d9476e55 100644 --- a/common/hooks/post-pkg/00-register-pkg.sh +++ b/common/hooks/post-pkg/00-register-pkg.sh @@ -39,7 +39,7 @@ hook() { pkgdir=$XBPS_REPOSITORY fi 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 # Register binpkg.