]> git.immae.eu Git - perso/Immae/Config/AUR.git/blame - PKGBUILD
automatically apply patches in source array
[perso/Immae/Config/AUR.git] / PKGBUILD
CommitLineData
d24ea821
GB
1# Maintainer: Gaetan Bisson <bisson@archlinux.org>
2# Contributor: Scytrin dai Kinthra <scytrin@gmail.com>
3
4pkgname=st-git
5_pkgname=st
6pkgver=20150603.71fa10f
7pkgrel=1
8pkgdesc='Simple virtual terminal emulator for X'
9url='http://git.suckless.org/st/'
10arch=('i686' 'x86_64' 'armv7h')
11license=('MIT')
12depends=('libxft')
13makedepends=('ncurses' 'libxext' 'git')
14source=('git://git.suckless.org/st'
15 'scrollback.patch')
16sha1sums=('SKIP'
17 '2e10ac47eb020d50c7f861f3923bb4152255a027')
18
19provides=("${_pkgname}")
20conflicts=("${_pkgname}")
21
22pkgver() {
23 cd "${srcdir}/${_pkgname}"
24 git log -1 --format='%cd.%h' --date=short | tr -d -
25}
26
27prepare() {
0df21d83 28 local file
d24ea821 29 cd "${srcdir}/${_pkgname}"
d24ea821
GB
30 sed \
31 -e '/char font/s/= .*/= "Fixed:pixelsize=13:style=SemiCondensed";/' \
32 -e '/char worddelimiters/s/= .*/= " '"'"'`\\\"()[]{}<>|";/' \
33 -e '/int defaultcs/s/= .*/= 1;/' \
34 -i config.def.h
27aad93a 35 sed \
36 -e 's/CPPFLAGS =/CPPFLAGS +=/g' \
37 -e 's/CFLAGS =/CFLAGS +=/g' \
38 -e 's/LDFLAGS =/LDFLAGS +=/g' \
39 -e 's/_BSD_SOURCE/_DEFAULT_SOURCE/' \
40 -i config.mk
7f2c13ce 41 sed '/@tic/d' -i Makefile
0df21d83 42 for file in "${source[@]}"; do
43 if [[ "$file" != *.diff ]]; then
44 continue
45 fi
46 # add all patches present in source array
47 patch -Np1 <"$SRCDEST/$file"
48 done
d24ea821
GB
49}
50
51build() {
52 cd "${srcdir}/${_pkgname}"
53 make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
54}
55
56package() {
57 cd "${srcdir}/${_pkgname}"
d24ea821
GB
58 make PREFIX=/usr DESTDIR="${pkgdir}" install
59 install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
60 install -Dm644 README "${pkgdir}/usr/share/doc/${pkgname}/README"
7f2c13ce 61 tic -s -o "${pkgdir}/usr/share/terminfo" st.info
d24ea821 62}