nixpkgs/pkgs/development/compilers/abcl/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.7 KiB
Nix
Raw Normal View History

2024-01-03 17:23:22 +00:00
{ lib
, stdenv
, writeShellScriptBin
, fetchurl
, ant
, jdk
2024-01-03 17:23:22 +00:00
, jre
, makeWrapper
, stripJavaArchivesHook
}:
2024-01-03 17:23:22 +00:00
let
fakeHostname = writeShellScriptBin "hostname" ''
echo nix-builder.localdomain
'';
in
stdenv.mkDerivation (finalAttrs: {
2016-12-13 15:25:04 +00:00
pname = "abcl";
version = "1.9.2";
2016-12-13 15:25:04 +00:00
src = fetchurl {
2024-01-03 17:23:22 +00:00
url = "https://common-lisp.net/project/armedbear/releases/${finalAttrs.version}/abcl-src-${finalAttrs.version}.tar.gz";
hash = "sha256-Ti9Lj4Xi2V2V5b282foXrWExoX4vzxK8Gf+5e0i8HTg=";
2016-12-13 15:25:04 +00:00
};
# note for the future:
# if you use makeBinaryWrapper, you will trade bash for glibc, the closure will be slightly larger
2024-01-03 17:23:22 +00:00
nativeBuildInputs = [
ant
jdk
fakeHostname
makeWrapper
stripJavaArchivesHook
2024-01-03 17:23:22 +00:00
];
2016-12-13 15:25:04 +00:00
buildPhase = ''
runHook preBuild
2016-12-13 15:25:04 +00:00
ant
runHook postBuild
2016-12-13 15:25:04 +00:00
'';
2016-12-13 15:25:04 +00:00
installPhase = ''
runHook preInstall
2024-01-03 17:23:22 +00:00
mkdir -p "$out"/{share/doc/abcl,lib/abcl}
2016-12-13 15:25:04 +00:00
cp -r README COPYING CHANGES examples/ "$out/share/doc/abcl/"
cp -r dist/*.jar contrib/ "$out/lib/abcl/"
makeWrapper ${jre}/bin/java $out/bin/abcl \
2024-01-03 17:23:22 +00:00
--add-flags "-classpath $out/lib/abcl/\*" \
${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
2016-12-13 15:25:04 +00:00
'';
passthru.updateScript = ./update.sh;
2016-12-13 15:25:04 +00:00
meta = {
description = "A JVM-based Common Lisp implementation";
2024-01-03 17:23:22 +00:00
homepage = "https://common-lisp.net/project/armedbear/";
license = lib.licenses.gpl2Classpath;
mainProgram = "abcl";
maintainers = lib.teams.lisp.members;
2023-06-23 00:46:56 +00:00
platforms = lib.platforms.darwin ++ lib.platforms.linux;
2016-12-13 15:25:04 +00:00
};
2024-01-03 17:23:22 +00:00
})