mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-28 10:02:43 +01:00
1b6fe108a9
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
134 lines
4.5 KiB
Bash
134 lines
4.5 KiB
Bash
#!/bin/bash
|
|
|
|
# Slackware build script for mupen64plus-extraplugins
|
|
|
|
# Copyright 2023 Steven Voges <Oregon, US>
|
|
# All rights reserved.
|
|
#
|
|
# Redistribution and use of this script, with or without modification, is
|
|
# permitted provided that the following conditions are met:
|
|
#
|
|
# 1. Redistributions of this script must retain the above copyright
|
|
# notice, this list of conditions and the following disclaimer.
|
|
#
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
PRGNAM=mupen64plus-extraplugins
|
|
VERSION=${VERSION:-20230611_0a4e30f}
|
|
RSPCXD4=${RSPCXD4:-0a4e30f56033396e3ba47ec0fdd7acea3522362a}
|
|
RSPZ64=${RSPZ64:-ad877e263e6ee78839cbd12cdd150d17177079cf}
|
|
VIDEOARACHNOID=${VIDEOARACHNOID:-8187d1135ced0102f99d8305b52e0e75b01ef917}
|
|
VIDEOGLIDE64=${VIDEOGLIDE64:-bdf9f5ca8e381e6c1c824aa70b26ad34f4eeb132}
|
|
VIDEOZ64=${VIDEOZ64:-e8023148574d44fbabd1bb9d0ded7192869ec2ce}
|
|
BUILD=${BUILD:-1}
|
|
TAG=${TAG:-_SBo}
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
case "$( uname -m )" in
|
|
i?86) ARCH=i586 ;;
|
|
arm*) ARCH=arm ;;
|
|
*) ARCH=$( uname -m ) ;;
|
|
esac
|
|
fi
|
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
exit 0
|
|
fi
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
PKG=$TMP/package-$PRGNAM
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
M64PCOMPONENTS="rsp-cxd4 rsp-z64 video-arachnoid video-glide64 video-z64"
|
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
|
LIBDIRSUFFIX=""
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
LIBDIRSUFFIX=""
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
LIBDIRSUFFIX="64"
|
|
else
|
|
SLKCFLAGS="-O2"
|
|
LIBDIRSUFFIX=""
|
|
fi
|
|
|
|
set -e
|
|
|
|
rm -rf $PKG
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
cd $TMP
|
|
rm -rf $PRGNAM-$VERSION
|
|
mkdir -p $PRGNAM-$VERSION
|
|
cd $PRGNAM-$VERSION
|
|
|
|
for COMPONENT in $M64PCOMPONENTS; do
|
|
mkdir -p mupen64plus-$COMPONENT
|
|
done
|
|
tar xvf $CWD/mupen64plus-rsp-cxd4-$RSPCXD4.tar.gz -C \
|
|
mupen64plus-rsp-cxd4 --strip-components 1
|
|
tar xvf $CWD/mupen64plus-rsp-z64-$RSPZ64.tar.gz -C \
|
|
mupen64plus-rsp-z64 --strip-components 1
|
|
tar xvf $CWD/mupen64plus-video-arachnoid-$VIDEOARACHNOID.tar.gz -C \
|
|
mupen64plus-video-arachnoid --strip-components 1
|
|
tar xvf $CWD/mupen64plus-video-glide64-$VIDEOGLIDE64.tar.gz -C \
|
|
mupen64plus-video-glide64 --strip-components 1
|
|
tar xvf $CWD/mupen64plus-video-z64-$VIDEOZ64.tar.gz -C \
|
|
mupen64plus-video-z64 --strip-components 1
|
|
|
|
chown -R root:root .
|
|
find -L . \
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
|
|
|
for COMPONENT in $M64PCOMPONENTS; do
|
|
echo "-------- Building $COMPONENT plugin --------"
|
|
make -C mupen64plus-$COMPONENT/projects/unix clean $@
|
|
make -C mupen64plus-$COMPONENT/projects/unix all $@
|
|
echo "-------- Installing $COMPONENT plugin --------"
|
|
make -C mupen64plus-$COMPONENT/projects/unix install $@ \
|
|
PLUGINDIR=lib$LIBDIRSUFFIX/mupen64plus \
|
|
SHAREDIR=share/mupen64plus \
|
|
BINDIR=bin \
|
|
MANDIR=man \
|
|
LIBDIR=lib$LIBDIRSUFFIX \
|
|
APPSDIR=share/applications \
|
|
ICONSDIR=share/icons/hicolor \
|
|
INCDIR=include/mupen64plus \
|
|
LDCONFIG=true \
|
|
DESTDIR=$PKG/usr/
|
|
done
|
|
|
|
chmod +x $PKG/usr/lib$LIBDIRSUFFIX/mupen64plus/*.so
|
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
for COMPONENT in $M64PCOMPONENTS; do
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/mupen64plus-$COMPONENT
|
|
cp -a mupen64plus-$COMPONENT/{COPYING,README,README.md} \
|
|
$PKG/usr/doc/$PRGNAM-$VERSION/mupen64plus-$COMPONENT 2>/dev/null || :
|
|
done
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
mkdir -p $PKG/install
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cd $PKG
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|