2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2016-05-01 23:52:38 +02:00
|
|
|
|
2014-12-11 06:45:55 +01:00
|
|
|
# Slackware build script for lutris
|
2016-05-01 23:52:38 +02:00
|
|
|
|
2017-01-04 21:49:35 +01:00
|
|
|
# Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
|
2022-03-14 19:24:02 +01:00
|
|
|
# Copyright 2018, 2022 Brenton Earl <brent@exitstatusone.com>
|
2014-12-11 06:45:55 +01:00
|
|
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
2015-09-10 23:05:03 +02:00
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
2014-12-11 06:45:55 +01:00
|
|
|
# (at your option) any later version, with the following exception:
|
|
|
|
# the text of the GPL license may be omitted.
|
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful, but
|
|
|
|
# without any warranty; without even the implied warranty of
|
|
|
|
# merchantability or fitness for a particular purpose. Compiling,
|
|
|
|
# interpreting, executing or merely reading the text of the program
|
|
|
|
# may result in lapses of consciousness and/or very being, up to and
|
|
|
|
# including the end of all existence and the Universe as we know it.
|
|
|
|
# See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You may have received a copy of the GNU General Public License along
|
|
|
|
# with this program (most likely, a file named COPYING). If not, see
|
2016-05-01 23:52:38 +02:00
|
|
|
# <https://www.gnu.org/licenses/>.
|
2014-12-11 06:45:55 +01:00
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2014-12-11 06:45:55 +01:00
|
|
|
PRGNAM=lutris
|
2022-04-16 15:58:41 +02:00
|
|
|
VERSION=${VERSION:-0.5.10}
|
2014-12-11 06:45:55 +01:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2014-12-11 06:45:55 +01:00
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-12-06 09:02:54 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2014-12-11 06:45:55 +01:00
|
|
|
arm*) ARCH=arm ;;
|
2022-03-14 19:24:02 +01:00
|
|
|
aarch64) ARCH=$( uname -m ) ;;
|
2014-12-11 06:45:55 +01:00
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2014-12-11 06:45:55 +01:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=${PKG:-$TMP/package-$PRGNAM}
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2022-04-16 15:58:41 +02:00
|
|
|
DOCS="AUTHORS LICENSE README.rst"
|
2022-03-14 19:24:02 +01:00
|
|
|
|
|
|
|
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"
|
|
|
|
elif [ "$ARCH" = "aarch64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
fi
|
2017-05-26 23:57:34 +02:00
|
|
|
|
2014-12-11 06:45:55 +01:00
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM
|
2022-03-14 19:24:02 +01:00
|
|
|
tar xvf $CWD/$PRGNAM\-$VERSION.tar.?z
|
|
|
|
cd $PRGNAM\-$VERSION
|
2014-12-11 06:45:55 +01:00
|
|
|
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 {} \;
|
|
|
|
|
2022-04-16 15:58:41 +02:00
|
|
|
mkdir -p build
|
|
|
|
cd build
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
meson .. \
|
|
|
|
--buildtype=release \
|
|
|
|
--infodir=/usr/info \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
-Derrorlogs=false \
|
|
|
|
-Dstrip=true
|
|
|
|
"${NINJA:=ninja}"
|
|
|
|
DESTDIR=$PKG $NINJA install
|
|
|
|
cd ..
|
2014-12-11 06:45:55 +01: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
|
|
|
|
|
2022-04-16 15:58:41 +02:00
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
|
|
|
|
2014-12-11 06:45:55 +01:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2017-05-26 23:57:34 +02:00
|
|
|
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
|
2014-12-11 06:45:55 +01:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
2017-04-17 23:56:12 +02:00
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
2014-12-11 06:45:55 +01:00
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|