summaryrefslogtreecommitdiff
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD31
1 files changed, 28 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index ce8e249..7cc7b37 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,6 +6,8 @@
pkgname=st
pkgver=0.8.3
pkgrel=1
+_patch_list_url=(https://st.suckless.org/patches/boxdraw/st-boxdraw_v2-0.8.3.diff
+ https://st.suckless.org/patches/ligatures/0.8.3/st-ligatures-boxdraw-20200430-0.8.3.diff)
pkgdesc='A simple virtual terminal emulator for X.'
arch=('i686' 'x86_64' 'armv7h')
license=('MIT')
@@ -20,6 +22,15 @@ sha256sums=(939ae3da237e7c9489694853c205c7cbd5f2a2f0c17fe41a07477f1df8e28552
_sourcedir=$pkgname-$pkgver
_makeopts="--directory=$_sourcedir"
+if [ ${#_patch_list_url[@]} -ne 0 ];
+then
+ # Add content of _patch_list_url to source array
+ for i in "${_patch_list_url[@]}";
+ do
+ source+=("$i");
+ sha256sums+=("SKIP");
+ done
+fi
prepare() {
patch --directory="$_sourcedir" --strip=0 < terminfo.patch
@@ -39,9 +50,15 @@ prepare() {
# file will be copied to $srcdir and used during
# build.
#
- # After this test, config.def.h is copied from $srcdir to $BUILDDIR to
- # provide an up to date template for the user.
- if [ -e "$BUILDDIR/config.h" ]
+ # 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.
+ if [ -e "config.h" ]
+ then
+ cp "config.h" "$_makedir"
+ elif [ -e "$BUILDDIR/config.h" ]
then
cp "$BUILDDIR/config.h" "$_sourcedir"
elif [ ! -e "$BUILDDIR/config.def.h" ]
@@ -56,6 +73,14 @@ prepare() {
}
build() {
+ if [ ${#_patch_list_url[@]} -ne 0 ];
+ then
+ for i in "${_patch_list_url[@]}";
+ do
+ # Filter URL to get base name of patch
+ patch --directory="$_sourcedir" -p1 -i $startdir/${i##*/};
+ done
+ fi
make $_makeopts X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
}