SUMMARY="A high performance Common Lisp compiler"
DESCRIPTION="Steel Bank Common Lisp (SBCL) is a high performance Common \
Lisp compiler. It is open source / free software, with a permissive license. \
In addition to the compiler and runtime system for ANSI Common Lisp, it \
provides an interactive environment including a debugger, a statistical \
profiler, a code coverage tool, and many other extensions."
HOMEPAGE="https://sbcl.org"
COPYRIGHT="2002 Gerd Moellmann"
LICENSE="BSD (2-clause)"
REVISION="1"
srcGitRev="44e0d89ff14fcd8d599edd00668633c4772c26b9"
SOURCE_URI="https://github.com/sbcl/sbcl/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="b59dba5b0c4d8a599b60f29d79e29115f1dd73f3b5f305123ecf0cb1ef1a8212"
SOURCE_DIR="sbcl-$srcGitRev"
SOURCE_FILENAME="sbcl-$portVersion.tar.gz"
PATCHES="sbcl-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"

PROVIDES="
	sbcl$secondaryArchSuffix = $portVersion
	cmd:sbcl$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libssl$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libssl$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	java:environment == 11
	cmd:abcl
	cmd:find
	cmd:gcc$secondaryArchPrefix
	cmd:make
	cmd:pkg_config$secondaryArchPrefix
	cmd:sed
	cmd:xargs
	"

BUILD()
{
	source /system/data/profile.d/openjdk11.sh
	export PATH=$JDK11_HOME/bin:$PATH
	export JAVA_HOME="$JDK11_HOME"
	export DISABLE_ASLR=1

	echo ';;; This file is auto-generated using generate-version.sh. Every time
;;; you re-run make.sh, this file will be overwritten if you are
;;; working from a Git checkout.
"2.1.10.22-44e0d89ff-WIP"' > version.lisp-expr
	sh make.sh abcl
}

INSTALL()
{
	INSTALL_ROOT=$prefix sh install.sh

	mkdir -p $docDir $manDir
	mv $prefix/share/man/man1 $manDir
	mv $prefix/share/doc/sbcl/* $docDir
	rm -rf $prefix/share
}

