summaryrefslogtreecommitdiffstats
path: root/development/bacon/bacon.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/bacon/bacon.SlackBuild')
-rw-r--r--development/bacon/bacon.SlackBuild146
1 files changed, 103 insertions, 43 deletions
diff --git a/development/bacon/bacon.SlackBuild b/development/bacon/bacon.SlackBuild
index 27c3cea3fa..1cdbe578b0 100644
--- a/development/bacon/bacon.SlackBuild
+++ b/development/bacon/bacon.SlackBuild
@@ -1,29 +1,45 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for bacon
-# Written by Steve Pledger <spledger91@yahoo.com>
+# Written by B. Watson (urchlay@slackware.uk)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# 20230814 bkw:
+# - update to v4.7.
+# - switch to self-hosted download, as upstreams disappears the
+# previous version immediately upon releasing a new one.
+# - prescaled icons.
+# - add CHANGES to doc dir.
+
+cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=bacon
-VERSION=${VERSION:-3.2.2}
+VERSION=${VERSION:-4.7}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
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}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -45,11 +61,35 @@ 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 {} \+
+
+# The --enable-gui-* and --disable-gui-* don't actually work.
+# We can't run autoreconf either (fails).
+# The intent here is to build the fltk gui if fltk is installed and
+# not disabled with FLTK=no, or the tk gui if fltk is missing or
+# disabled.
+# Either way, we don't currently support the gtk 2 gui (it depends
+# on webkitgtk 2.x, which is outdated and gone from our repo) or the
+# gtk 3 gui (because I don't feel like dealing with webkit2gtk as a
+# dependency, not even an optional one).
+if [ "${FLTK:-yes}" = "yes" -a -x /usr/bin/fltk-config ]; then
+ GUI="FLTK=true TK=false GTK3=false GTK2=false"
+ GUITYPE=FLTK
+else
+ GUI="FLTK=false TK=true GTK3=false GTK2=false"
+ GUITYPE=TK
+fi
+
+# Keep the .xbm icon in a private directory, so nothing else accidentally
+# uses it (it's ugly).
+sed -i 's,/share/pixmaps/,/share/BaCon/,' bacon.bac
+
+# I use this when editing the script, to avoid the 5+ minute build time.
+# The C implementation is thousands of times faster than the shell script.
+if [ "${CHEAT:-no}" = "yes" -a -x /usr/bin/bacon ]; then
+ sed -i 's,\$(BSHELL) \./bacon\.sh,/usr/bin/bacon,' Makefile.in
+fi
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
@@ -58,41 +98,61 @@ CXXFLAGS="$SLKCFLAGS" \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --with-bash \
--build=$ARCH-slackware-linux
-make -j1
-
-# make install doesn't understand DESTDIR
-mkdir -p $PKG/usr/bin
-/usr/bin/ginstall -c build/bacon $PKG/usr/bin
-/usr/bin/ginstall -c build/bacongui $PKG/usr/bin
-/usr/bin/ginstall -c bacon.sh $PKG/usr/bin
-mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
-/usr/bin/ginstall -c -m 644 build/libbacon.a $PKG/usr/lib${LIBDIRSUFFIX}
-mkdir -p $PKG/usr/man/man1
-/usr/bin/ginstall -c -m 644 bacon.1 $PKG/usr/man/man1
-mkdir -p $PKG/usr/share/applications
-/usr/bin/ginstall -c -m 644 bacongui.desktop $PKG/usr/share/applications
-mkdir -p $PKG/usr/share/pixmaps
-/usr/bin/ginstall -c -m 644 icons/BaCon.png $PKG/usr/share/pixmaps
-mkdir -p $PKG/usr/share/enscript/hl
-/usr/bin/ginstall -c -m 644 syntax/bacon.st $PKG/usr/share/enscript/hl
-
-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 {} \;
-for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
-
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a \
- README.1ST \
- $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+# The -j1 really is needed here. Anyway the build process has a
+# 5+ minute "Converting 'bacon.bac'" that has to finish before
+# the other make targets can begin, so patching the Makefile to
+# support parallelism wouldn't actually speed it up noticeably.
+# The fakehome stuff is to keep it from creating or reading a
+# /root/.bacon/bacon.cfg file (we don't want to write outside of $TMP).
+mkdir -p `pwd`/fakehome
+HOME=`pwd`/fakehome make -j1 $GUI
+make -j1 install DESTDIR=$PKG $GUI
+
+gzip -9 $PKG/usr/man/man*/*
+
+# This is where we patched it to look for this icon:
+mv $PKG/usr/share/pixmaps/BaCon.xbm $PKG/usr/share/BaCon/
+
+# Various icons already in /usr/share/pixmaps. Prescale.
+for icon in BaCon BaConEyes BaConStrip; do
+ PNG=$PKG/usr/share/pixmaps/$icon.png
+ for px in 16 22 32 48 64 128 256; do
+ sz=${px}x${px}
+ dir=$PKG/usr/share/icons/hicolor/$sz/apps
+ mkdir -p $dir
+ convert -resize $sz $PNG $dir/$icon.png
+ done
+done
+
+# The GUI has the documentation path baked in, so symlink it to the
+# the Slackware doc dir.
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a README* CHANGES* $PKGDOC
+ln -s ../../share/BaCon/documentation $PKGDOC/documentation
+ln -s ../../share/BaCon/LICENSE $PKGDOC/LICENSE
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
+
+# The encscript synax file (bacon.st) gets installed to the right place.
+# Move the others to the right places.
+mkdir -p $PKG/usr/share/vim/vimfiles/syntax/
+mv $PKG/usr/share/BaCon/syntax/bacon.vim $PKG/usr/share/vim/vimfiles/syntax/bacon.vim
+mkdir -p $PKG/usr/share/gtksourceview-3.0/language-specs/
+mv $PKG/usr/share/BaCon/syntax/bacon.lang $PKG/usr/share/gtksourceview-3.0/language-specs/bacon.lang
+
+# The vim syntax file works, but won't be used automatically without this:
+mkdir -p $PKG/usr/share/vim/vimfiles/ftdetect
+echo "au! BufRead,BufNewFile *.bac,*.bacon setfiletype bacon" > \
+ $PKG/usr/share/vim/vimfiles/ftdetect/bacon.vim
mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
+sed "s,@GUITYPE@,$GUITYPE," < $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