]> git.immae.eu Git - perso/Immae/Config/AUR.git/blob - PKGBUILD
PKGBUILD: assume $srcdir, as noted in PKGBUILD(5)
[perso/Immae/Config/AUR.git] / PKGBUILD
1 # Maintainer: mar77i <mysatyre at gmail dot com>
2 # Past Maintainer: Gaetan Bisson <bisson@archlinux.org>
3 # Contributor: Scytrin dai Kinthra <scytrin@gmail.com>
4
5 pkgname=st-git
6 _pkgname=st
7 pkgver=20151011.f56c58a
8 pkgrel=1
9 pkgdesc='Simple virtual terminal emulator for X'
10 url='http://git.suckless.org/st/'
11 arch=('i686' 'x86_64')
12 license=('MIT')
13 depends=('libxft')
14 makedepends=('ncurses' 'libxext' 'git')
15 source=('git://git.suckless.org/st')
16 sha1sums=('SKIP')
17
18 provides=("${_pkgname}")
19 conflicts=("${_pkgname}")
20
21 pkgver() {
22 cd "${_pkgname}"
23 git log -1 --format='%cd.%h' --date=short | tr -d -
24 }
25
26 prepare() {
27 local file
28 cd "${_pkgname}"
29 sed \
30 -e '/char font/s/= .*/= "Fixed:pixelsize=13:style=SemiCondensed";/' \
31 -e '/char worddelimiters/s/= .*/= " '"'"'`\\\"()[]{}<>|";/' \
32 -e '/int defaultcs/s/= .*/= 1;/' \
33 -i config.def.h
34 sed \
35 -e 's/CPPFLAGS =/CPPFLAGS +=/g' \
36 -e 's/CFLAGS =/CFLAGS +=/g' \
37 -e 's/LDFLAGS =/LDFLAGS +=/g' \
38 -e 's/_BSD_SOURCE/_DEFAULT_SOURCE/' \
39 -i config.mk
40 sed '/@tic/d' -i Makefile
41 for file in "${source[@]}"; do
42 if [[ "$file" == "config.h" ]]; then
43 # add config.h if present in source array
44 # Note: this supersedes the above sed to config.def.h
45 cp "$srcdir/$file" .
46 continue
47 elif [[ "$file" == *.diff ]]; then
48 # add all patches present in source array
49 patch -Np1 <"$srcdir/$file"
50 fi
51 done
52 }
53
54 build() {
55 cd "${_pkgname}"
56 make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
57 }
58
59 package() {
60 cd "${_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 }