diff options
Diffstat (limited to 'system/st')
-rw-r--r-- | system/st/README | 27 | ||||
-rw-r--r-- | system/st/doinst.sh | 10 | ||||
-rw-r--r-- | system/st/patches/README | 2 | ||||
-rw-r--r-- | system/st/slack-desc | 6 | ||||
-rw-r--r-- | system/st/st.SlackBuild | 139 | ||||
-rw-r--r-- | system/st/st.desktop | 9 | ||||
-rw-r--r-- | system/st/st.info | 10 | ||||
-rw-r--r-- | system/st/st.png | bin | 0 -> 867 bytes |
8 files changed, 147 insertions, 56 deletions
diff --git a/system/st/README b/system/st/README index 21aafe7c18..26c29cb298 100644 --- a/system/st/README +++ b/system/st/README @@ -1 +1,26 @@ -st is a simple terminal implementation for X. +st (simple terminal) + +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 index 492b5a6c42..3e5691a052 100644 --- a/system/st/doinst.sh +++ b/system/st/doinst.sh @@ -1,3 +1,9 @@ -if [ -e /usr/bin/tic ]; then - /usr/bin/tic -s usr/share/st/st.info >/dev/null 2>&1 +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 46a4408dee..0a7764c938 100644 --- a/system/st/st.SlackBuild +++ b/system/st/st.SlackBuild @@ -1,31 +1,30 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for st -# Copyright 2011-2019, 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. +# Originally written by Nikolay Korotkiy <email removed> +# Now maintained by B. Watson <urchlay@slackware.uk> + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +# 20221228 bkw: updated for v0.9. + +# 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.2} +VERSION=${VERSION:-0.9} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -35,7 +34,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} @@ -63,22 +66,29 @@ 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 {} \; - -# Now apply any other patches that users might have added -for i in $(ls $CWD/patches); do - echo "Applying patch $i" +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +[ -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 + [ "$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: 'tic' stuff in Makefile doesn't respect DESTDIR. +sed -i "s|\\<tic\\>|& -o $PKG/usr/share/terminfo|" Makefile -[ -f "$CWD/config.h" ] && cp -f $CWD/config.h config.h +# Above sed command got broken by upstream (they removed the @) +# so files were being written to the real /usr, not $PKG/usr. +# Doing it this way means the terminfo stuff is cleanly removed +# when the package is removed. tic won't create the dir, so: +mkdir -p $PKG/usr/share/terminfo CFLAGS="$SLKCFLAGS" make && \ make install \ @@ -86,23 +96,62 @@ make install \ MANPREFIX=/usr/man \ DESTDIR=$PKG -# Incluse st.info in package -mkdir -p $PKG/usr/share/st -cp st.info $PKG/usr/share/st/ +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 + +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 -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 +# .desktop file adapted from xterm.desktop +mkdir -p $PKG/usr/share/applications +cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop -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 +# 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/doc/$PRGNAM-$VERSION -cp -a LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +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:-tgz} +/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 bbb39cfbaa..c9b288558e 100644 --- a/system/st/st.info +++ b/system/st/st.info @@ -1,10 +1,10 @@ PRGNAM="st" -VERSION="0.8.2" +VERSION="0.9" HOMEPAGE="https://st.suckless.org" -DOWNLOAD="https://dl.suckless.org/st/st-0.8.2.tar.gz" -MD5SUM="a3d97ee92215071e6399691edc0f04b0" +DOWNLOAD="https://dl.suckless.org/st/st-0.9.tar.gz" +MD5SUM="accd12489e3d48b77f1c11be794f9ee5" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="Nikolay Korotkiy" -EMAIL="sikmir@gmail.com" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/system/st/st.png b/system/st/st.png Binary files differnew file mode 100644 index 0000000000..daa2578126 --- /dev/null +++ b/system/st/st.png |