slackbuilds/_unmaintained/y/lutris/SlackBuild
2024-11-27 10:09:09 +01:00

116 lines
3.9 KiB
Bash
Executable file

#!/bin/bash
# Slackware build script for lutris
# Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
# Copyright 2018 Brenton Earl <brent@exitstatusone.com>
# 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
# the Free Software Foundation; either version 2 of the License, or
# (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
# <https://www.gnu.org/licenses/>.
# REQUIRES="pygobject3-python3 dbus-python3 python3-PyYAML gnome-desktop webkit2gtk"
PRGNAM=lutris
VERSION=${VERSION:-$(curl https://lutris.net/releases/ | grep tar\.xz | tail -n1 | grep -o "[0-9.]*" | head -n1 | sed 's|.$||')}
BUILD=${BUILD:-1}
TAG=${TAG:-gwh}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=${PKG:-$TMP/package-$PRGNAM}
OUTPUT=${OUTPUT:-/tmp}
DOCS="AUTHORS LICENSE INSTALL.rst README.rst"
REPOSITORY=${REPOSITORY:-/var/cache/SlackBuilds.gwh/$PRGNAM}
mkdir -p $REPOSITORY
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM
[ ! -e $REPOSITORY/$PRGNAM\_$VERSION.tar.xz ] && wget -c https://lutris.net/releases/lutris_$VERSION.tar.xz -O $REPOSITORY/$PRGNAM\_$VERSION.tar.xz
tar xvf $REPOSITORY/$PRGNAM\_$VERSION.tar.xz
cd $PRGNAM
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 {} \;
python3 setup.py install --root $PKG
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
mv $PKG/usr/share/man $PKG/usr/
mkdir -p $PKG/usr/doc/$PRGNAM
cp -a $DOCS $PKG/usr/doc/$PRGNAM
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
lutris: lutris (Open Gaming Platform)
lutris:
lutris: Lutris is an open gaming platform for Linux. It helps you install
lutris: and manage your games in a unified interface. The goal is to support
lutris: every game which runs on Linux, from native Windows games (via Wine)
lutris: to emulators and browser games.
lutris:
lutris: Home page: https://lutris.net/
lutris:
lutris:
lutris:
EOF
cat <<EOF > $PKG/install/doinst.sh
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
fi
fi
EOF
cd $PKG
/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}