diff --git a/.SRCINFO b/.SRCINFO index 67b8284..1d7affe 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,22 +1,25 @@ -# Generated by mksrcinfo v8 -# Wed Apr 10 09:19:45 UTC 2019 pkgbase = st pkgdesc = A simple virtual terminal emulator for X. pkgver = 0.8.2 - pkgrel = 2 - url = http://st.suckless.org + pkgrel = 7 + url = https://st.suckless.org arch = i686 arch = x86_64 arch = armv7h license = MIT + makedepends = libxext makedepends = ncurses depends = libxft - depends = libxext - depends = xorg-fonts-misc - source = http://dl.suckless.org/st/st-0.8.2.tar.gz + source = https://dl.suckless.org/st/st-0.8.2.tar.gz source = config.h + source = https://st.suckless.org/patches/nordtheme/st-nordtheme-0.8.2.diff + source = https://st.suckless.org/patches/scrollback/st-scrollback-20190331-21367a0.diff + source = https://st.suckless.org/patches/scrollback/st-scrollback-mouse-0.8.diff sha256sums = aeb74e10aa11ed364e1bcc635a81a523119093e63befd2f231f8b0705b15bf35 - sha256sums = SKIP + sha256sums = 8fc9a87a5bac9e4eebd4f7683e009aa34d74e9e0cbd0f2cc5e60f3fd01d40f3f + sha256sums = bd7c467dba6027c156d1bd1f3b65d8666787d3c2ff5c743e54e19c6d79a5ba96 + sha256sums = f974bc0e11bda909a6d6d529d28abde4c97e651107b6a6047f2fab8837010b43 + sha256sums = 3fb38940cc3bad3f9cd1e2a0796ebd0e48950a07860ecf8523a5afd0cd1b5a44 pkgname = st diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2d32340 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/*.pkg.tar.xz +/config.def.h +/config.h +/pkg/ +/src/ +/st-*.tar.gz diff --git a/PKGBUILD b/PKGBUILD index aee9e29..b9b2b48 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,30 +1,72 @@ # Maintainer: Jose Riha +# Maintainer: Sebastian J. Bronner # Contributor: Patrick Jackson # Contributor: Christoph Vigano pkgname=st pkgver=0.8.2 -pkgrel=2 +pkgrel=7 pkgdesc='A simple virtual terminal emulator for X.' arch=('i686' 'x86_64' 'armv7h') license=('MIT') -depends=('libxft' 'libxext' 'xorg-fonts-misc') -makedepends=('ncurses') -url="http://st.suckless.org" -source=(http://dl.suckless.org/st/$pkgname-$pkgver.tar.gz - config.h - https://st.suckless.org/patches/nordtheme/st-nordtheme-0.8.2.diff - https://st.suckless.org/patches/scrollback/st-scrollback-20190331-21367a0.diff - https://st.suckless.org/patches/scrollback/st-scrollback-mouse-0.8.diff) +depends=(libxft) +makedepends=(libxext ncurses) +url=https://st.suckless.org +source=(https://dl.suckless.org/$pkgname/$pkgname-$pkgver.tar.gz + config.h + https://st.suckless.org/patches/nordtheme/st-nordtheme-0.8.2.diff + https://st.suckless.org/patches/scrollback/st-scrollback-20190331-21367a0.diff + https://st.suckless.org/patches/scrollback/st-scrollback-mouse-0.8.diff) sha256sums=('aeb74e10aa11ed364e1bcc635a81a523119093e63befd2f231f8b0705b15bf35' '8fc9a87a5bac9e4eebd4f7683e009aa34d74e9e0cbd0f2cc5e60f3fd01d40f3f' 'bd7c467dba6027c156d1bd1f3b65d8666787d3c2ff5c743e54e19c6d79a5ba96' 'f974bc0e11bda909a6d6d529d28abde4c97e651107b6a6047f2fab8837010b43' '3fb38940cc3bad3f9cd1e2a0796ebd0e48950a07860ecf8523a5afd0cd1b5a44') +_makedir=$pkgname-$pkgver +_makeopts="--directory=$_makedir" prepare() { - # user is supposed to maintain config.h him/herself - cp $srcdir/config.h $srcdir/$pkgname-$pkgver/config.h + # Do not install terminfo files, as they conflict with ncurses. + sed -r \ + -e '/^[[:space:]]+tic\>/d' \ + -e '/^[[:space:]]+@echo .* terminfo/d' \ + -i $_makedir/Makefile + + # This package provides a mechanism to provide a custom config.h. Multiple + # configuration states are determined by the presence of two files in + # $BUILDDIR: + # + # * config.h: The user has supplied his or her configuration. The file will + # be copied to $srcdir and used during build. + # * config.def.h only: The user was previously made aware of the + # configuration options and has opted not to make any configuration + # changes. The package is built using default values. + # * neither file: Initial state. The user receives a message on how to + # configure this package. The build process is aborted after the copy + # operation below. + # + # After this test, config.def.h is copied from $srcdir to provide an up to + # date template for the user. If neither file was present initially, further + # build steps are aborted at this point. Even if no config.h is provided, + # future runs will proceed with default values due to the presence of + # config.def.h. + abort= + if [ -e "$BUILDDIR/config.h" ] + then + cp "$BUILDDIR/config.h" "$_makedir" + elif [ ! -e "$BUILDDIR/config.def.h" ] + then + abort=1 + msg='This package can be configured in config.h. Copy config.def.h just ' + msg+='placed into the package directory to config.h and modify it to ' + msg+='change the configuration. Or just leave it alone to use default ' + msg+='values. Then restart the build process.' + error "$msg" + fi + cp "$_makedir/config.def.h" "$BUILDDIR" + test -z "$abort" + + # apply patches cd $srcdir/$pkgname-$pkgver/ patch -p1 config.h < $srcdir/st-nordtheme-0.8.2.diff patch -p1 -F3 < $srcdir/st-scrollback-20190331-21367a0.diff @@ -32,15 +74,15 @@ prepare() { } build() { - cd $srcdir/$pkgname-$pkgver - make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11 + make $_makeopts X11INC=/usr/include/X11 X11LIB=/usr/lib/X11 } package() { - cd $srcdir/$pkgname-$pkgver - make PREFIX=/usr DESTDIR="$pkgdir" TERMINFO="$pkgdir/usr/share/terminfo" install - install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" - install -Dm644 README "$pkgdir/usr/share/doc/$pkgname/README" - # remove to avoid conflict with ncurses - rm "${pkgdir}/usr/share/terminfo/s/st" "${pkgdir}/usr/share/terminfo/s/st-256color" + local installopts='--mode 0644 -D --target-directory' + local shrdir="$pkgdir/usr/share" + local licdir="$shrdir/licenses/$pkgname" + local docdir="$shrdir/doc/$pkgname" + make $_makeopts PREFIX=/usr DESTDIR="$pkgdir" install + install $installopts "$licdir" "$_makedir/LICENSE" + install $installopts "$docdir" "$_makedir/README" }