2021-07-04 01:48:15 +08:00
|
|
|
#!/bin/bash
|
2010-05-13 05:29:39 +08:00
|
|
|
|
|
|
|
# Slackware build script for yabause
|
|
|
|
|
2016-08-30 11:11:47 +08:00
|
|
|
# Copyright 2011-2016 Larry Hajali <larryhaja[at]gmail[dot]com>
|
2013-04-24 08:47:21 +08:00
|
|
|
# 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.
|
2010-05-13 05:29:39 +08:00
|
|
|
|
2021-07-04 17:41:06 +08:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2010-05-13 05:29:39 +08:00
|
|
|
PRGNAM=yabause
|
2016-08-30 11:11:47 +08:00
|
|
|
VERSION=${VERSION:-0.9.15}
|
2017-04-14 22:21:49 +08:00
|
|
|
BUILD=${BUILD:-2}
|
2010-05-13 05:29:39 +08:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 18:23:38 +08:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2010-05-13 05:29:39 +08:00
|
|
|
|
2010-06-04 13:05:03 +08:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2017-04-14 22:21:49 +08:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 13:05:03 +08:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 18:23:38 +08:00
|
|
|
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
|
|
|
|
# the name of the created package would be, and then exit. This information
|
|
|
|
# could be useful to other scripts.
|
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2010-05-13 05:29:39 +08:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2017-04-14 22:21:49 +08:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-13 05:29:39 +08:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 13:05:03 +08:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 05:29:39 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 15:37:19 +08:00
|
|
|
find -L . \
|
2016-08-30 11:11:47 +08:00
|
|
|
\( -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 {} \;
|
2010-05-13 05:29:39 +08:00
|
|
|
|
2012-06-26 09:28:11 +08:00
|
|
|
# Variable to determine gtk/qt interface. Default is qt.
|
|
|
|
USE_GUI=${USE_GUI:-qt}
|
|
|
|
|
2013-04-24 08:47:21 +08:00
|
|
|
# Fix location of man file.
|
|
|
|
sed -i 's|share/man|man|' src/CMakeLists.txt
|
2016-08-30 11:11:47 +08:00
|
|
|
# Fix png files.
|
|
|
|
# Eg.: ibpng warning: iCCP: known incorrect sRGB profile
|
|
|
|
for pic in $(find . -name "*\.png");do
|
|
|
|
convert $pic ${pic}.new
|
|
|
|
touch -r $pic ${pic}.new
|
|
|
|
mv ${pic}.new $pic
|
|
|
|
done
|
2012-06-26 09:28:11 +08:00
|
|
|
|
2017-04-14 22:21:49 +08:00
|
|
|
# Patch against ffmpeg 3
|
|
|
|
patch -p1 < $CWD/ffmpeg3.patch
|
|
|
|
|
2012-06-26 09:28:11 +08:00
|
|
|
mkdir build
|
|
|
|
cd build
|
2013-04-24 08:47:21 +08:00
|
|
|
cmake -G "Unix Makefiles" \
|
2012-06-26 09:28:11 +08:00
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
|
|
|
|
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
|
2016-08-30 11:11:47 +08:00
|
|
|
-DYAB_USE_CXX:BOOL=ON \
|
|
|
|
-DYAB_WANT_MPEG:BOOL=ON \
|
|
|
|
-DYAB_USE_SSF:BOOL=ON \
|
|
|
|
-DYAB_USE_SCSP2:BOOL=OFF \
|
|
|
|
-DYAB_USE_SCSPMIDI:BOOL=ON \
|
|
|
|
-DYAB_MAN_DIR:PATH="man" \
|
2012-06-26 09:28:11 +08:00
|
|
|
-DYAB_PORTS="$USE_GUI" \
|
2016-08-30 11:11:47 +08:00
|
|
|
-DYAB_MULTIBUILD:BOOL=OFF \
|
|
|
|
-DYAB_NETWORK:BOOL=ON \
|
|
|
|
-DYAB_OPTIMIZED_DMA:BOOL=ON \
|
2015-07-04 10:14:24 +08:00
|
|
|
-DGDKGLEXT_CONFIG_INCLUDE_DIR:PATH="/usr/lib${LIBDIRSUFFIX}/gtkglext-1.0/include" \
|
2012-06-26 09:28:11 +08:00
|
|
|
-DCMAKE_BUILD_TYPE=Release ..
|
|
|
|
|
|
|
|
make VERBOSE=1
|
|
|
|
make install DESTDIR=$PKG
|
2016-08-30 11:11:47 +08:00
|
|
|
cd -
|
2012-06-26 09:28:11 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
2010-05-13 05:29:39 +08:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2016-08-30 11:11:47 +08:00
|
|
|
cp -a AUTHORS ChangeLog COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 05:29:39 +08:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 18:23:38 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|