#!/bin/bash # Slackware build script for bacon # Written by B. Watson (urchlay@slackware.uk) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20240812 bkw: # - update for v5.0. # - enable the GTK3 GUI. # 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:-5.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi 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" = "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" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi set -e # The --enable-gui-* and --disable-gui-* don't actually work. # We can't run autoreconf either (fails). # The intent here is to build: # The GTK3 gui if requested by the user (but never automatically), # The FLTK gui if fltk is installed and not disabled with FLTK=no, # or the TK gui if fltk is missing or disabled via FLTK=no. # 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). if [ "${GTK3:-no}" = "yes" ]; then if ! pkg-config --exists gtksourceview-4; then cat < $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/ mkdir -p $PKG/usr/share/gtksourceview-4/language-specs cp $PKG/usr/share/BaCon/syntax/bacon.lang $PKG/usr/share/gtksourceview-4/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 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