# Template file for 'newlisp'
pkgname=newlisp
version=10.5.4
revision=2
hostmakedepends="which"
makedepends="readline-devel>=6.3 libffi-devel"
short_desc="Lisp-like, general-purpose scripting language"
maintainer="Juan RP <xtraeme@gmail.com>"
license="GPL-3, zlib, $pkgname"
homepage="http://www.newlisp.org"
distfiles="$homepage/downloads/$pkgname-$version.tgz"
checksum=e4561e03c89e7c89a30dfa7daf12091085a474e96b0fbbb4ee62454463175eb0

do_build() {
	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
		export CFLAGS+=" -DNEWLISP64"
	fi
	make -f makefile_linuxLP64_utf8_ffi ${makejobs}
}

do_install() {
	vmkdir usr/bin
	vmkdir usr/share/man/man1
	vmkdir usr/share/licenses/$pkgname
	make bindir=$DESTDIR/usr/bin datadir=$DESTDIR/usr/share \
		mandir=$DESTDIR/usr/share/man install
	mv $DESTDIR/usr/share/doc/$pkgname/COPYING \
		$DESTDIR/usr/share/licenses/$pkgname

	# Create newlisp symlink;
	ln -sfr ${DESTDIR}/usr/bin/newlisp-${version} ${DESTDIR}/usr/bin/newlisp
}
