summaryrefslogtreecommitdiffstats
path: root/games/golly/golly.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/golly/golly.SlackBuild')
-rw-r--r--games/golly/golly.SlackBuild101
1 files changed, 62 insertions, 39 deletions
diff --git a/games/golly/golly.SlackBuild b/games/golly/golly.SlackBuild
index b510769780..431f32c005 100644
--- a/games/golly/golly.SlackBuild
+++ b/games/golly/golly.SlackBuild
@@ -1,9 +1,9 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for golly
# Copyright 2012-15, Glenn Becker, Arlington MA USA
-# Now maintained by B. Watson <yalhcru@gmail.com>
+# Now maintained by B. Watson <urchlay@slackware.uk>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,6 +24,10 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Updated for golly 2.6 -- the source directory structure got changed a bit too!
+# 20230822 bkw: update for v4.2. note that REQUIRES changed to wxWidgets, as
+# this version needs wxWidgets-3.1 or greater.
+# 20211118 bkw: BUILD=2, new-style icons, tweak .desktop file.
+# 20201112 bkw: update for v4.0. Which adds a python3 dep.
# 20181211 bkw:
# - Take over maintenance.
# - i486 => i586.
@@ -34,10 +38,13 @@
# is invited to investigate why this happens...
# - Minor simplifications and cleanups.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=golly
-VERSION=${VERSION:-3.2}
+VERSION=${VERSION:-4.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -47,7 +54,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+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}
@@ -79,54 +90,66 @@ find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# 20181211 bkw: wxPython and wxGTK3 both install a /usr/bin/wx-config
-# symlink. We *need* wxGTK3, so don't trust the symlink as it points to
-# whichever was most recently installed.
-WXDEF="$( /bin/ls /usr/lib$LIBDIRSUFFIX/wx/config/gtk*unicode*3.0 | head -1 )"
+# symlink. We *need* wxWidgets-3.2.x, so don't trust the symlink as it points
+# to whichever was most recently installed.
+WXDEF="$( /bin/ls /usr/lib$LIBDIRSUFFIX/wx/config/gtk*unicode*3.2 | head -1 )"
WXCONF="${WXCONF:-$WXDEF}"
if [ -z "$WXCONF" ]; then
- echo "Can't find wxGTK3-3.0.x, install wxGTK3 or set WXCONF in environment." 1>&2
+ echo "Can't find wxGTK3-3.0.x, install wxWidgets or set WXCONF in environment." 1>&2
exit 1
fi
-cd gui-wx/configure
-
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-./configure \
- --with-wx-config="$WXCONF" \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --mandir=/usr/man \
- --bindir=/usr/games \
- --docdir=/usr/doc/$PRGNAM-$VERSION \
- --build=$ARCH-slackware-linux
-
-make
-make install-strip DESTDIR=$PKG
-
-cd ../icons
-
-for i in 16 32 48; do
- convert appicon${i}.ico -resize ${i}x${i}! $PRGNAM-${i}.png
- mkdir -p $PKG/usr/share/icons/hicolor/${i}x${i}/apps/
- install -D -m 0644 $PRGNAM-${i}.png \
- $PKG/usr/share/icons/hicolor/${i}x${i}/apps/$PRGNAM.png
+SHAREDIR=/usr/share/games/$PRGNAM
+
+# 20230822 bkw: golly is the only project I ever heard of that
+# migrated from autotools back to a plain Makefile. I approve, but it
+# means we can't build versions < 4.0 any more, sorry.
+# 20230822 bkw: in 4.2, sound support uses SDL, so we can enable it.
+# Note to self: to test whether sound works, Scripts -> Lua -> credits.lua
+# plays a song while showing scrolling credits.
+cd gui-wx
+cat > local-gtk.mk <<EOF
+WX_CONFIG = $WXCONF
+PYTHON = python3
+ENABLE_PERL = 1
+ENABLE_SOUND = 1
+CXXFLAGS = $SLKCFLAGS
+GOLLYDIR = $SHAREDIR
+EOF
+
+# 20230822 bkw: don't trust this.
+echo > local-gtk-template.mk
+
+make -f makefile-gtk
+
+cd ..
+mkdir -p $PKG/usr/games $PKG/$SHAREDIR
+install -s -m0755 $PRGNAM b$PRGNAM $PKG/usr/games
+cp -a Help Patterns Rules Scripts $PKG/$SHAREDIR
+
+# Don't need +x permissions on HTML pages, or even Lua/Python scripts.
+find $PKG/$SHAREDIR -type f -exec chmod 644 {} +
+
+# icons extracted from app.icns with icns2png, to get the 64x64 and 128x128 ones.
+for i in $CWD/icons/*.png; do
+ px="$( basename $i .png )"
+ size=${px}x${px}
+ dir=$PKG/usr/share/icons/hicolor/$size/apps
+ mkdir -p $dir
+ cat $i > $dir/$PRGNAM.png
done
-convert appicon.xpm $PRGNAM.png
-install -D -m 0644 $PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
-
-cd ../../docs
+mkdir -p $PKG/usr/share/pixmaps
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
+cd docs
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a License.html ReadMe.html ToDo.html $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
# 20181211 bkw: WARNING: gzip test failed on <...>/weekender-distaff.rle.gz
# Get rid of .gz extension for any non-gzipped data files.
-find $PKG/usr/share/$PRGNAM -name \*.gz | while read FILE; do
+find $PKG/$SHAREDIR -name \*.gz | while read FILE; do
if file $FILE | grep -qv gzip ; then
rename .gz '' "$FILE"
fi
@@ -140,4 +163,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE