1{
2 lib,
3 stdenv,
4 writeShellScriptBin,
5 fetchurl,
6 ant,
7 openjdk17,
8 makeWrapper,
9 stripJavaArchivesHook,
10}:
11
12let
13 # https://armedbear.common-lisp.dev/ lists OpenJDK 17 as the highest
14 # supported JDK.
15 jdk = openjdk17;
16
17 fakeHostname = writeShellScriptBin "hostname" ''
18 echo nix-builder.localdomain
19 '';
20in
21stdenv.mkDerivation (finalAttrs: {
22 pname = "abcl";
23 version = "1.9.3";
24
25 src = fetchurl {
26 url = "https://common-lisp.net/project/armedbear/releases/${finalAttrs.version}/abcl-src-${finalAttrs.version}.tar.gz";
27 hash = "sha256-uwShIj06mGCS4BD/2tE69QQp1VwagYdL8wIvlDa/sv8=";
28 };
29
30 # note for the future:
31 # if you use makeBinaryWrapper, you will trade bash for glibc, the closure will be slightly larger
32 nativeBuildInputs = [
33 ant
34 jdk
35 fakeHostname
36 makeWrapper
37 stripJavaArchivesHook
38 ];
39
40 buildPhase = ''
41 runHook preBuild
42
43 ant \
44 -Dabcl.runtime.jar.path="$out/lib/abcl/abcl.jar" \
45 -Dadditional.jars="$out/lib/abcl/abcl-contrib.jar"
46
47 runHook postBuild
48 '';
49
50 installPhase = ''
51 runHook preInstall
52
53 mkdir -p "$out"/{share/doc/abcl,lib/abcl}
54 cp -r README COPYING CHANGES examples/ "$out/share/doc/abcl/"
55 cp -r dist/*.jar contrib/ "$out/lib/abcl/"
56 install -Dm555 abcl -t $out/bin
57
58 runHook postInstall
59 '';
60
61 passthru.updateScript = ./update.sh;
62
63 meta = {
64 description = "JVM-based Common Lisp implementation";
65 homepage = "https://common-lisp.net/project/armedbear/";
66 license = with lib.licenses; [
67 gpl2
68 classpathException20
69 ];
70 mainProgram = "abcl";
71 teams = [ lib.teams.lisp ];
72 platforms = lib.platforms.darwin ++ lib.platforms.linux;
73 };
74})