abcl: explicit update script + makeWrapper
Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
parent
2d82b2958b
commit
1173a1c198
|
@ -1,38 +1,67 @@
|
||||||
{lib, stdenv, fetchurl, ant, jre, jdk}:
|
{ stdenv
|
||||||
|
, lib
|
||||||
|
, fetchurl
|
||||||
|
, ant
|
||||||
|
, jre
|
||||||
|
, jdk
|
||||||
|
, makeWrapper
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "abcl";
|
pname = "abcl";
|
||||||
version = "1.9.1";
|
version = "1.9.1";
|
||||||
# or fetchFromGitHub(owner,repo,rev) or fetchgit(rev)
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://common-lisp.net/project/armedbear/releases/${version}/${pname}-src-${version}.tar.gz";
|
url = "https://common-lisp.net/project/armedbear/releases/${version}/${pname}-src-${version}.tar.gz";
|
||||||
sha256 = "sha256-pbxnfJRB9KgzwgpUG93Rb/+SZIRmkd6aHa9mmfj/EeI=";
|
sha256 = "sha256-pbxnfJRB9KgzwgpUG93Rb/+SZIRmkd6aHa9mmfj/EeI=";
|
||||||
};
|
};
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
|
runHook preConfigure
|
||||||
|
|
||||||
mkdir nix-tools
|
mkdir nix-tools
|
||||||
export PATH="$PWD/nix-tools:$PATH"
|
export PATH="$PWD/nix-tools:$PATH"
|
||||||
echo "echo nix-builder.localdomain" > nix-tools/hostname
|
echo "echo nix-builder.localdomain" > nix-tools/hostname
|
||||||
chmod a+x nix-tools/*
|
chmod a+x nix-tools/*
|
||||||
|
|
||||||
hostname
|
hostname
|
||||||
|
|
||||||
|
runHook postConfigure
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
buildInputs = [ jre ant jdk jre ];
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
ant
|
ant
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
# Fix for https://github.com/armedbear/abcl/issues/484
|
|
||||||
javaOpts =
|
|
||||||
lib.optionalString
|
|
||||||
(lib.versionAtLeast jre.version "17")
|
|
||||||
"--add-opens=java.base/java.util.jar=ALL-UNNAMED";
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p "$out"/{bin,share/doc/abcl,lib/abcl}
|
mkdir -p "$out"/{bin,share/doc/abcl,lib/abcl}
|
||||||
cp -r README COPYING CHANGES examples/ "$out/share/doc/abcl/"
|
cp -r README COPYING CHANGES examples/ "$out/share/doc/abcl/"
|
||||||
cp -r dist/*.jar contrib/ "$out/lib/abcl/"
|
cp -r dist/*.jar contrib/ "$out/lib/abcl/"
|
||||||
|
|
||||||
echo "#! ${stdenv.shell}" >> "$out/bin/abcl"
|
makeWrapper ${jre}/bin/java $out/bin/abcl \
|
||||||
echo "${jre}/bin/java $javaOpts -cp \"$out/lib/abcl/abcl.jar:$out/lib/abcl/abcl-contrib.jar:\$CLASSPATH\" org.armedbear.lisp.Main \"\$@\"" >> "$out/bin/abcl"
|
--prefix CLASSPATH : $out/lib/abcl/abcl.jar \
|
||||||
chmod a+x "$out"/bin/*
|
--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
|
||||||
'';
|
'';
|
||||||
buildInputs = [jre ant jdk jre];
|
|
||||||
|
passthru.updateScript = ./update.sh;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A JVM-based Common Lisp implementation";
|
description = "A JVM-based Common Lisp implementation";
|
||||||
license = lib.licenses.gpl3 ;
|
license = lib.licenses.gpl3 ;
|
||||||
|
|
5
pkgs/development/compilers/abcl/update.sh
Executable file
5
pkgs/development/compilers/abcl/update.sh
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p nix-update curl
|
||||||
|
|
||||||
|
new_version=$(curl https://armedbear.common-lisp.dev/ | grep abcl-src | sed 's;[^>]*>abcl-src-\(.*\).tar[^$]*;\1;' | head -n 1)
|
||||||
|
nix-update abcl --version "$new_version"
|
Loading…
Reference in a new issue