2023-04-12 12:48:02 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, ant
|
|
|
|
, jre
|
|
|
|
, jdk
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "abcl";
|
2023-03-27 19:17:25 +00:00
|
|
|
version = "1.9.1";
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://common-lisp.net/project/armedbear/releases/${version}/${pname}-src-${version}.tar.gz";
|
2023-03-27 19:17:25 +00:00
|
|
|
sha256 = "sha256-pbxnfJRB9KgzwgpUG93Rb/+SZIRmkd6aHa9mmfj/EeI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configurePhase = ''
|
2023-04-12 12:48:02 +00:00
|
|
|
runHook preConfigure
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir nix-tools
|
|
|
|
export PATH="$PWD/nix-tools:$PATH"
|
|
|
|
echo "echo nix-builder.localdomain" > nix-tools/hostname
|
|
|
|
chmod a+x nix-tools/*
|
|
|
|
|
|
|
|
hostname
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
runHook postConfigure
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
buildInputs = [ jre ];
|
|
|
|
|
|
|
|
# note for the future:
|
|
|
|
# if you use makeBinaryWrapper, you will trade bash for glibc, the closure will be slightly larger
|
|
|
|
nativeBuildInputs = [ makeWrapper ant jdk ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPhase = ''
|
2023-04-12 12:48:02 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
ant
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2023-04-12 12:48:02 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p "$out"/{bin,share/doc/abcl,lib/abcl}
|
|
|
|
cp -r README COPYING CHANGES examples/ "$out/share/doc/abcl/"
|
|
|
|
cp -r dist/*.jar contrib/ "$out/lib/abcl/"
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/abcl \
|
|
|
|
--prefix CLASSPATH : $out/lib/abcl/abcl.jar \
|
|
|
|
--prefix CLASSPATH : $out/lib/abcl/abcl-contrib.jar \
|
|
|
|
${lib.optionalString (lib.versionAtLeast jre.version "17")
|
|
|
|
# Fix for https://github.com/armedbear/abcl/issues/484
|
|
|
|
"--add-flags --add-opens=java.base/java.util.jar=ALL-UNNAMED \\"
|
|
|
|
}
|
|
|
|
--add-flags org.armedbear.lisp.Main
|
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
2021-01-17 00:15:33 +00:00
|
|
|
description = "A JVM-based Common Lisp implementation";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.gpl3 ;
|
2023-04-12 12:48:02 +00:00
|
|
|
maintainers = lib.teams.lisp.members;
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://common-lisp.net/project/armedbear/";
|
|
|
|
};
|
|
|
|
}
|