| git.druid.rocks | index | druid520 | ports | ports/ | build-tools/ | onetrueawk/ | add.sh |
ports/build-tools/onetrueawk/add.sh
set -e
git clone --depth 1 https://github.com/onetrueawk/awk.git onetrueawk
cd onetrueawk
# plain Makefile, no ./configure and (unlike gawk's own autotools
# build) no "make install" target either -- upstream's own README says
# as much directly ("This produces an executable a.out; you will
# eventually want to move this to some place like /usr/bin/awk").
# installing it AS "awk" (not "onetrueawk") is deliberate, not just a
# naming choice: the whole point of the %awk tag is resolving to
# whatever "awk" on $PATH should actually run, matching gawk's own
# installed binary name exactly -- see pkg.conf's own pkg_conflicts.
# YACC="yacc -d -b awkgram": upstream's own makefile hardcodes
# "YACC = bison -d" (with this EXACT "yacc -d -b awkgram" alternative
# commented out right above it -- a clearly anticipated, supported
# override). This system has no "bison" binary at all (byacc installs
# as plain "yacc", matching this tree's own byacc-not-bison
# direction), so a bare "make" fails outright ("bison: inaccessible or
# not found"). "-b awkgram" is required, not optional: plain POSIX
# yacc conventionally names its own output y.tab.c/y.tab.h, but this
# makefile's own rule expects awkgram.tab.c/awkgram.tab.h specifically
# -- "-b awkgram" is byacc's own file-prefix flag that produces exactly
# those names.
make -j$MP_JOBS YACC="yacc -d -b awkgram"
mkdir -p $MP_PREFIX/bin
install -m755 a.out $MP_PREFIX/bin/awk
# awk.1: upstream's own real man page, installed if present -- best
# effort, never a hard requirement (a missing man page here is never
# worth failing an otherwise-successful build over).
mkdir -p $MP_PREFIX/share/man/man1
[ -f awk.1 ] && install -m644 awk.1 $MP_PREFIX/share/man/man1/awk.1