1 # Template file for '9base'
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>'
12 homepage="http://git.suckless.org/9base"
13 distfiles="http://git.suckless.org/9base/snapshot/9base-${_githash}.tar.bz2"
14 provides="plan9port-20160418_4"
16 checksum=2a7d31a11cb68cd75a7720141cea26f053421064e2230e206c227efbe343d2d8
17 wrksrc="9base-${_githash}"
20 # These are platform specific, but aarch64 and mips have their
21 # program counter in the same place; we'll just use the ARM
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
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 ;;
52 vinstall $FILESDIR/plan9.sh 644 etc/profile.d