]> git.immae.eu Git - perso/Immae/Config/AUR.git/blob - PKGBUILD
e1995a4caa0db275a3e14f60286636a386760930
[perso/Immae/Config/AUR.git] / PKGBUILD
1 # Maintainer: Gaetan Bisson <bisson@archlinux.org>
2 # Contributor: Scytrin dai Kinthra <scytrin@gmail.com>
3
4 pkgname=st-git
5 _pkgname=st
6 pkgver=20150603.71fa10f
7 pkgrel=1
8 pkgdesc='Simple virtual terminal emulator for X'
9 url='http://git.suckless.org/st/'
10 arch=('i686' 'x86_64' 'armv7h')
11 license=('MIT')
12 depends=('libxft')
13 makedepends=('ncurses' 'libxext' 'git')
14 source=('git://git.suckless.org/st'
15 'scrollback.patch')
16 sha1sums=('SKIP'
17 '2e10ac47eb020d50c7f861f3923bb4152255a027')
18
19 provides=("${_pkgname}")
20 conflicts=("${_pkgname}")
21
22 pkgver() {
23 cd "${srcdir}/${_pkgname}"
24 git log -1 --format='%cd.%h' --date=short | tr -d -
25 }
26
27 prepare() {
28 local file
29 cd "${srcdir}/${_pkgname}"
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
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
41 sed '/@tic/d' -i Makefile
42 for file in "${source[@]}"; do
43 if [[ "$file" != *.diff ]]; then
44 # add config.h if present in source array
45 # Note: this supersedes the above sed to config.def.h
46 [[ "$file" == "config.h" ]] && cp "$SRCDEST/$file" .
47 continue
48 fi
49 # add all patches present in source array
50 patch -Np1 <"$SRCDEST/$file"
51 done
52 }
53
54 build() {
55 cd "${srcdir}/${_pkgname}"
56 make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
57 }
58
59 package() {
60 cd "${srcdir}/${_pkgname}"
61 make PREFIX=/usr DESTDIR="${pkgdir}" install
62 install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
63 install -Dm644 README "${pkgdir}/usr/share/doc/${pkgname}/README"
64 tic -s -o "${pkgdir}/usr/share/terminfo" st.info
65 }