summaryrefslogtreecommitdiff
path: root/games/gtklife
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-10-08 17:42:05 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-10-13 00:52:40 +0700
commitf32fbf57374c73daa33900f17f97fdfee2120c36 (patch)
tree65110e21e7ccf06fc0cb34f70b645d5efedc0188 /games/gtklife
parent7e3231a0591855284b1af0205dea0acaba4eafbe (diff)
downloadslackbuilds-f32fbf57374c73daa33900f17f97fdfee2120c36.tar.gz
games/gtklife: Build with gtk+2.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/gtklife')
-rw-r--r--games/gtklife/README2
-rw-r--r--games/gtklife/doinst.sh6
-rw-r--r--games/gtklife/gtklife.SlackBuild32
-rw-r--r--games/gtklife/gtklife.desktop2
4 files changed, 30 insertions, 12 deletions
diff --git a/games/gtklife/README b/games/gtklife/README
index 9db8a016ca..4782f7648f 100644
--- a/games/gtklife/README
+++ b/games/gtklife/README
@@ -1,2 +1,4 @@
+gtklife (Conway's Life program)
+
GtkLife is a fast, featureful, open-source Conway's Life program for
*nix.
diff --git a/games/gtklife/doinst.sh b/games/gtklife/doinst.sh
index 5fb28930db..3e5691a052 100644
--- a/games/gtklife/doinst.sh
+++ b/games/gtklife/doinst.sh
@@ -1,3 +1,9 @@
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 usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/games/gtklife/gtklife.SlackBuild b/games/gtklife/gtklife.SlackBuild
index 5d7b93677b..6278d7f70b 100644
--- a/games/gtklife/gtklife.SlackBuild
+++ b/games/gtklife/gtklife.SlackBuild
@@ -6,11 +6,16 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20211008 bkw: BUILD=3
+# - new-style icons.
+# - build with gtk+2, not gtk+1. nicer UI.
+# - binary in /usr/games, not /usr/bin.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=gtklife
VERSION=${VERSION:-5.2}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -22,9 +27,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# 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
@@ -57,11 +59,8 @@ rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
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 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
CFLAGS="$SLKCFLAGS -std=gnu89" \
CXXFLAGS="$SLKCFLAGS" \
@@ -69,13 +68,24 @@ CXXFLAGS="$SLKCFLAGS" \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--with-docdir=/usr/doc/$PRGNAM-$VERSION/html \
+ --with-gtk2 \
--build=$ARCH-slackware-linux
make
-make install-strip prefix=$PKG/usr docdir=$PKG/usr/doc/$PRGNAM-$VERSION/html
+make install-strip \
+ prefix=$PKG/usr \
+ docdir=$PKG/usr/doc/$PRGNAM-$VERSION/html \
+ bindir=$PKG/usr/games
+
+for i in icon_*.png; do
+ size="$( echo $i | cut -d_ -f2 | cut -d. -f1 )"
+ dir=$PKG/usr/share/icons/hicolor/$size/apps
+ mkdir -p $dir
+ cat $i > $dir/$PRGNAM.png
+done
mkdir -p $PKG/usr/share/pixmaps
-cat icon_48x48.png > $PKG/usr/share/pixmaps/$PRGNAM.png
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
mkdir -p $PKG/usr/share/applications
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
diff --git a/games/gtklife/gtklife.desktop b/games/gtklife/gtklife.desktop
index 674f8d328c..90918dd502 100644
--- a/games/gtklife/gtklife.desktop
+++ b/games/gtklife/gtklife.desktop
@@ -3,7 +3,7 @@ Version=1.0
Name=GtkLife
GenericName=GtkLife Conway Life Simulation
Type=Application
-Exec=gtklife
+Exec=/usr/games/gtklife
Icon=gtklife
Terminal=false
StartupNotify=false