summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0c1302166dcc2f4e474224c1f014df47807d104c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Scytrin dai Kinthra <scytrin@gmail.com>

pkgname=st-white-git
_pkgname=st
pkgver=0.6.r54.g375b287
pkgrel=1

pkgdesc='A simple virtual terminal emulator for X.'
arch=('i686' 'x86_64')
url="http://st.suckless.org"
license=('MIT')
conflicts=($_pkgname)
provides=($_pkgname)
depends=('libxft')
makedepends=('ncurses' 'libxext' 'git')
source=("$pkgname::git://git.suckless.org/st"
	'config.h')
md5sums=('SKIP'
         '1f022b612297651c1f2f8464b41c513b')

pkgver() {
  cd $pkgname
  git describe --tags --long|sed -r 's,^[^0-9]*,,;s,([^-]*-g),r\1,;s,[-_],.,g'
}

prepare() {
  local file
  cd $pkgname
  sed \
    -e '/char font/s/= .*/= "Fixed:pixelsize=13:style=SemiCondensed";/' \
    -e '/char worddelimiters/s/= .*/= " '"'"'`\\\"()[]{}<>|";/' \
    -e '/int defaultcs/s/= .*/= 1;/' \
    -i config.def.h
  sed \
    -e 's/CPPFLAGS =/CPPFLAGS +=/g' \
    -e 's/CFLAGS =/CFLAGS +=/g' \
    -e 's/LDFLAGS =/LDFLAGS +=/g' \
    -e 's/_BSD_SOURCE/_DEFAULT_SOURCE/' \
    -i config.mk
  sed '/@tic/d' -i Makefile
  for file in "${source[@]}"; do
    if [[ "$file" != *.diff ]]; then
      # add config.h if present in source array
      # Note: this supersedes the above sed to config.def.h
      [[ "$file" == "config.h" ]] && cp "$SRCDEST/$file" .
      continue
    fi
    # add all patches present in source array
    patch -Np1 <"$SRCDEST/$file"
  done
}

build() {
  cd $pkgname
  make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
}

package() {
  cd $pkgname
  make PREFIX=/usr DESTDIR="${pkgdir}" install
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 README "${pkgdir}/usr/share/doc/${pkgname}/README"
}