summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author B. Watson2021-11-30 04:17:31 +0100
committer Willy Sudiarto Raharjo2021-12-04 04:09:06 +0100
commit29b32f93ca9b6191cff1e3d8e5e88a7b6116a9c2 (patch)
treec53fdbc179e7bc15c8bc59699dac7d0ff8f6ed7f
parent2fe35f429dffd32f60b502b789b22ad094c0bfe3 (diff)
downloadslackbuilds-29b32f93ca9b6191cff1e3d8e5e88a7b6116a9c2.tar.gz
system/st: Fix ncurses conflict; many enhancements.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--system/st/README29
-rw-r--r--system/st/doinst.sh9
-rw-r--r--system/st/patches/README2
-rw-r--r--system/st/slack-desc6
-rw-r--r--system/st/st.SlackBuild121
-rw-r--r--system/st/st.desktop9
-rw-r--r--system/st/st.info4
-rw-r--r--system/st/st.pngbin0 -> 867 bytes
8 files changed, 126 insertions, 54 deletions
diff --git a/system/st/README b/system/st/README
index 8c9e0b40d8..26c29cb298 100644
--- a/system/st/README
+++ b/system/st/README
@@ -1,5 +1,26 @@
-st is a simple terminal implementation for X.
+st (simple terminal)
-NOTE:
-This package overwrite some files from ncurses package.
-If you remove this package, please reinstall ncurses back.
+st is a simple terminal emulator for X which sucks less.
+
+Most st configuration done by editing config.h, which gets baked into
+the st executable. To make this easier, the SlackBuild will look for
+"config.h" in its directory, and copy it into the source directory if
+found. To get the default config.h from the source, do something like
+this:
+
+tar xfO st-0.8.4.tar.gz --wildcards '*/config.def.h' > config.h
+
+...then edit it to your heart's content and copy it into the
+SlackBuild directory. When the package is built, your config.h will be
+used, and also included in /usr/doc/st-$VERSION for reference.
+
+Also, a lot of extra functionality for st is provided as patches, from
+"https://st.suckless.org/patches/". To use these, download them and
+place them in the patches/ directory in the SlackBuild's dir. Note
+that not all provided patches will apply, since some are for old
+versions of st and some are for post-release git. If you use patches,
+the file /usr/doc/st-$VERSION/patches.txt will contain a list of them,
+for reference.
+
+Note that this SlackBuild already includes a .desktop file and icon
+for st, so you don't need the st-desktopentry patch.
diff --git a/system/st/doinst.sh b/system/st/doinst.sh
new file mode 100644
index 0000000000..3e5691a052
--- /dev/null
+++ b/system/st/doinst.sh
@@ -0,0 +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/system/st/patches/README b/system/st/patches/README
new file mode 100644
index 0000000000..6448a682f7
--- /dev/null
+++ b/system/st/patches/README
@@ -0,0 +1,2 @@
+Place any st patches you want to apply in this directory before
+running the SlackBuild.
diff --git a/system/st/slack-desc b/system/st/slack-desc
index f076fcba61..d799f80096 100644
--- a/system/st/slack-desc
+++ b/system/st/slack-desc
@@ -6,11 +6,11 @@
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
-st: st (a simple terminal implementation for X)
+st: st (simple terminal)
+st:
+st: st is a simple terminal emulator for X which sucks less.
st:
-st: st is a simple virtual terminal emulator for X which sucks less.
st:
-st: Homepage: https://st.suckless.org
st:
st:
st:
diff --git a/system/st/st.SlackBuild b/system/st/st.SlackBuild
index 0491ec0a97..1927ad23a4 100644
--- a/system/st/st.SlackBuild
+++ b/system/st/st.SlackBuild
@@ -2,33 +2,25 @@
# Slackware build script for st
-# Copyright 2011-2020, Nikolay Korotkiy <sikmir@gmail.com>
-# All rights reserved.
-#
-# Redistribution and use of this script, with or without modification, is
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of this script must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Modified by the SlackBuilds.org project
+# Originally written by Nikolay Korotkiy <email removed>
+# Now maintained by B. Watson <yalhcru@gmail.com>
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# 20211119 bkw: BUILD=2
+# - new maintainer.
+# - don't overwrite ncurses' st and st-256color terminfo entries.
+# thanks to Eric Lindblad for pointing this out.
+# - install the rest of the docs (FAQ, LEGACY, TODO).
+# - include config.h in the doc dir.
+# - include patches.txt in the doc dir, if patches are used.
+# - add .desktop and icon.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=st
VERSION=${VERSION:-0.8.4}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -40,9 +32,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
@@ -75,22 +64,22 @@ 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 {} \+
-# Now apply any other patches that users might have added
+[ -e "$CWD/config.h" ] && cp -f $CWD/config.h config.h
+
+# Now apply any other patches the user might have added. Have to
+# do this *after* applying custom config.h, so any changes to
+# config.h here won't get overwritten.
for i in $(ls $CWD/patches 2>/dev/null); do
- echo "Applying patch $i"
+ [ "$i" = "README" ] && continue
+ echo "=== applying patch $i"
patch -p1 < $CWD/patches/$i
+ PATCHES+=" $i"
done
-# Remove "tic" line from Makefile - we cannot do this here!
-#sed -i "/^\t@tic/d" Makefile
-
-# 20200123 bkw: Actually, yes we can:
+# 20200123 bkw: 'tic' stuff in Makefile doesn't respect DESTDIR.
sed -i "s|\\<tic\\>|& -o $PKG/usr/share/terminfo|" Makefile
# Above sed command got broken by upstream (they removed the @)
@@ -99,26 +88,68 @@ sed -i "s|\\<tic\\>|& -o $PKG/usr/share/terminfo|" Makefile
# when the package is removed. tic won't create the dir, so:
mkdir -p $PKG/usr/share/terminfo
-[ -f "$CWD/config.h" ] && cp -f $CWD/config.h config.h
-
CFLAGS="$SLKCFLAGS" make && \
make install \
PREFIX=/usr \
MANPREFIX=/usr/man \
DESTDIR=$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
+strip $PKG/usr/bin/$PRGNAM
+gzip -9 $PKG/usr/man/man?/*
+
+# 20211119 bkw: some of st's terminfo defs have been included in
+# Slackware's ncurses package. After some discussion with Thomas
+# Dickey (the ncurses maintainer) I've decided the ncurses versions
+# of these are better. Instead of hardcoding a list here, we'll
+# actually use the ncurses package's file list to decide what to
+# exclude.
+pkgfile="$(
+ ls /var/lib/pkgtools/packages/ncurses-* \
+ | grep '/ncurses-[^-]\+-[^-]\+-[^-]\+$' \
+)"
+
+if [ -z "$pkgfile" ]; then
+ echo "!!! can't find ncurses package, including all st terminfo entries"
+ pkgfile=/dev/null
+fi
-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
+for file in $PKG/usr/share/terminfo/s/*; do
+ name="$( basename $file )"
+ if grep -q '^usr/share/terminfo/s/'$name'$' $pkgfile
+ then
+ echo "=== excluding terminfo entry: $name"
+ rm $file
+ fi
+done
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+# .desktop file adapted from xterm.desktop
+mkdir -p $PKG/usr/share/applications
+cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
+
+# Icons converted from https://en.wikipedia.org/wiki/File:Suckless_logo.svg
+for px in 16 32 48 64 128; do
+ size=${px}x${px}
+ dir=$PKG/usr/share/icons/hicolor/$size/apps
+ mkdir -p $dir
+ convert -resize $size $CWD/$PRGNAM.png $dir/$PRGNAM.png
+done
+
+mkdir -p $PKG/usr/share/pixmaps
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
+
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a config.h FAQ LEGACY LICENSE README TODO $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
+
+if [ -n "$PATCHES" ]; then
+ echo "This package was built with the following patch(es):" > $PKGDOC/patches.txt
+ echo "$PATCHES" | sed 's, ,\n,g' >> $PKGDOC/patches.txt
+fi
mkdir -p $PKG/install
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
diff --git a/system/st/st.desktop b/system/st/st.desktop
new file mode 100644
index 0000000000..b836d7f7f0
--- /dev/null
+++ b/system/st/st.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=st
+Comment=Simple terminal emulator which sucks less
+Exec=st
+Terminal=false
+Type=Application
+Icon=st
+Categories=System;TerminalEmulator;
+Keywords=shell;prompt;command;commandline;cmd;
diff --git a/system/st/st.info b/system/st/st.info
index 471bfcaa6a..52a09c1f29 100644
--- a/system/st/st.info
+++ b/system/st/st.info
@@ -6,5 +6,5 @@ MD5SUM="e00b074c0e5d55513745c99f027b7a34"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="Nikolay Korotkiy"
-EMAIL="sikmir@gmail.com"
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
diff --git a/system/st/st.png b/system/st/st.png
new file mode 100644
index 0000000000..daa2578126
--- /dev/null
+++ b/system/st/st.png
Binary files differ