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