From 7c0ed7b6a864bfe02ee14e33f12b3b1e7211ad1a Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 22 Mar 2022 16:36:18 -0400 Subject: [PATCH] audio/google-musicmanager: Fix 32-bit build. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- .../google-musicmanager.SlackBuild | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/audio/google-musicmanager/google-musicmanager.SlackBuild b/audio/google-musicmanager/google-musicmanager.SlackBuild index e9195facce..8aca2a30f2 100644 --- a/audio/google-musicmanager/google-musicmanager.SlackBuild +++ b/audio/google-musicmanager/google-musicmanager.SlackBuild @@ -27,6 +27,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20220322 bkw: Modified by SlackBuilds.org: fix 32-bit build. + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=google-musicmanager @@ -35,9 +37,21 @@ BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} -case "$(uname -m)" in - i?86) DEBARCH="i386" ; LIBDIRSUFFIX="" ; ARCH=i386 ;; - x86_64) DEBARCH="amd64" ; LIBDIRSUFFIX="64" ; ARCH=x86_64 ;; +# 20220322 bkw: changed this stuff to allow building a 32-bit package +# on x86_64 with 'export ARCH=i586', or build a 64-bit package on +# 32-bit with 'export ARCH=x86_64'. Please leave it this way; it makes +# testing ever so much simpler. +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +case "$ARCH" in + i?86) DEBARCH="i386" ; LIBDIRSUFFIX="" ;; + x86_64) DEBARCH="amd64" ; LIBDIRSUFFIX="64" ;; *) echo "Package for $(uname -m) architecture is not available." ; exit 1 ;; esac @@ -71,7 +85,14 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $PKG -ar p $CWD/$PRGNAM-${RELEASE}_current_${DEBARCH}.deb data.tar.xz | tar xvJ + +# 20220322 bkw: 32-bit .deb has lzma compression, not xz. Handle either. +DEB=$CWD/$PRGNAM-${RELEASE}_current_${DEBARCH}.deb +for i in lzma xz; do + ar -t "$DEB" | fgrep -q data.tar.$i && COMP=$i +done + +ar p $DEB data.tar.$COMP | $COMP -d | tar xv # 20220218 bkw: absolute path symlink in deb, no good. rm -f usr/bin/$PRGNAM