python-texttable: update to 1.3.1
[void-packages.git] / srcpkgs / 9base / template
blob01352a8cf1e77343e46a29c18ed7d7e3ab5d815a
1 # Template file for '9base'
2 pkgname=9base
3 version=6.0.20170806
4 revision=1
5 _githash=09e95a2d6f8dbafc6601147b2f5f150355813be6
6 build_style=gnu-makefile
7 # we use byacc instead of internal version
8 hostmakedepends="byacc"
9 short_desc="Revived minimalist port of Plan 9 userland to Unix"
10 maintainer='Tai Chi Minh Ralph Eastwood <tcmreastwood@gmail.com>'
11 license="custom"
12 homepage="http://git.suckless.org/9base"
13 distfiles="http://git.suckless.org/9base/snapshot/9base-${_githash}.tar.bz2"
14 provides="plan9port-20160418_4"
15 conflicts="plan9port"
16 checksum=2a7d31a11cb68cd75a7720141cea26f053421064e2230e206c227efbe343d2d8
17 wrksrc="9base-${_githash}"
19 pre_build() {
20         # These are platform specific, but aarch64 and mips have their
21         # program counter in the same place; we'll just use the ARM
22         # implementation.
23         cp lib9/getcallerpc-arm.c lib9/getcallerpc-aarch64.c
24         cp lib9/getcallerpc-arm.c lib9/getcallerpc-mips.c
26         # config.mk has conflicting flags to the build-style; we enforce
27         # specific ones in config.mk to make sure they don't get changed
28         # in do_build.
29         sed -i 's|^PREFIX \+= /usr/local/plan9|override PREFIX = /usr/lib/plan9|g' config.mk
30         sed -i 's|^CFLAGS \++=|override CFLAGS += -D_DEFAULT_SOURCE |g' config.mk
31         sed -i 's|^LDFLAGS.*||g' config.mk
32         sed -i 's|^CC.*||g' config.mk
33         # Add rc to the AR flag as the 9base build-scripts require AR to
34         # be declared with the 'rc' argument.  However, AR can be
35         # different to 'ar' if declared differently within xbps e.g.
36         # gcc-ar which is necessary for link-time optimisation builds.
37         sed -i 's|^AR.*|override AR += rc|g' config.mk
38         sed -i 's|^YACC \+=.*|YACC = byacc|g' config.mk
40         # This allows 9base's build-style know which getcallerpc
41         # implementation to use.
42         case "$XBPS_TARGET_MACHINE" in
43         i686*)    sed -i 's|^OBJTYPE \+=.*|OBJTYPE = 386|g' config.mk ;;
44         x86_64*)  sed -i 's|^OBJTYPE \+=.*|OBJTYPE = x86_64|g' config.mk ;;
45         arm*)     sed -i 's|^OBJTYPE \+=.*|OBJTYPE = arm|g' config.mk ;;
46         aarch64*) sed -i 's|^OBJTYPE \+=.*|OBJTYPE = aarch64|g' config.mk ;;
47         mips*)    sed -i 's|^OBJTYPE \+=.*|OBJTYPE = mips|g' config.mk ;;
48         esac
51 post_install() {
52         vinstall $FILESDIR/plan9.sh 644 etc/profile.d
53         vlicense LICENSE