__ _       _      _   
 / _(_) __ _| | ___| |_ 
| |_| |/ _` | |/ _ \ __|
|  _| | (_| | |  __/ |_ 
|_| |_|\__, |_|\___|\__|
       |___/            

mkfile that builds figlet on a 9front system. special thanks to

the sed command for _figlet.c is hacky, as is -Dalloca=malloc. fonts are installed to /lib/font/figlet, with the default font being “standard”, and figlet is installed to /$objtype/bin/figlet. these can all be changed in the mkfile.

there are likely many problems with this, one I found is that using the argument as a message does not work, use stdin instead. echo message | figlet instead of figlet message.

to install:

; ftpfs ftp.figlet.org
; tar xzvf /n/ftp/pub/figlet/program/unix/figlet-2.2.5.tar.gz
; cd figlet-2.2.5
; hget https://up.ccf.sh/mkfiglet >mkfile
; mk install
# Optionally,
; mk man

</$objtype/mkfile
BIN=/$objtype/bin/games
TARG=figlet
MAN=/sys/man/1
CFLAGS=-Bp -I/sys/include/npe -D__plan9__ -D__plan9_keep_main__ -D__${objtype}__
CFLAGS=$CFLAGS -D__STDC__
CFLAGS=$CFLAGS '-DDEFAULTFONTDIR="/lib/font/figlet"' '-DDEFAULTFONTFILE="standard"'
CFLAGS=$CFLAGS '-Dalloca=malloc'

OFILES=\
	_figlet.$O\
	zipio.$O\
	inflate.$O\
	crc.$O\
	utf8.$O\

HFILES=\
	zipio.h\
	utf8.h\

MANFILES=\
	chkfont.man\
	figlet.man\
	figlist.man\
	showfigfonts.man\

</sys/src/cmd/mkone

default:V: $MANFILES $O.out

%.man:
	mv $stem.6 $target

install:V:	installfonts $BIN/$TARG

installfonts:V: fonts
	mkdir -p /lib/font/figlet
	dircp fonts /lib/font/figlet

_figlet.c:
	sed '2125c\
	  exits(nil);
	' figlet.c >_figlet.c

/sys/include/npe/stdio.h:
	hget https://git.sr.ht/~ft/npe/archive/master.tar.gz | tar xz &&
	cd npe-master &&
	mk install &&
	rm -r npe-master

download