nixpkgs/pkgs/by-name/as/aspectj/package.nix

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

57 lines
1.1 KiB
Nix
Raw Normal View History

2024-03-31 00:00:27 +00:00
{
lib,
stdenvNoCC,
fetchurl,
jre,
}:
2024-03-31 00:00:27 +00:00
let
2024-05-18 22:25:37 +00:00
version = "1.9.22.1";
2024-03-31 00:00:27 +00:00
versionSnakeCase = builtins.replaceStrings [ "." ] [ "_" ] version;
in
stdenvNoCC.mkDerivation {
pname = "aspectj";
inherit version;
2024-03-31 00:00:27 +00:00
__structuredAttrs = true;
src = fetchurl {
url = "https://github.com/eclipse/org.aspectj/releases/download/V${versionSnakeCase}/aspectj-${version}.jar";
2024-05-18 22:25:37 +00:00
hash = "sha256-NIyYVhJIGXz+vNVoAQzYsDfmOYc4QrRzJGWeQjS4X0U=";
};
2024-03-31 00:00:27 +00:00
dontUnpack = true;
nativeBuildInputs = [ jre ];
installPhase = ''
runHook preInstall
cat >> props <<EOF
output.dir=$out
context.javaPath=${jre}
EOF
mkdir -p $out
java -jar $src -text props
cat >> $out/bin/aj-runtime-env <<EOF
#! ${stdenvNoCC.shell}
export CLASSPATH=$CLASSPATH:.:$out/lib/aspectjrt.jar
EOF
chmod u+x $out/bin/aj-runtime-env
runHook postInstall
'';
meta = {
homepage = "https://www.eclipse.org/aspectj/";
description = "Seamless aspect-oriented extension to the Java programming language";
license = lib.licenses.epl10;
2024-03-31 00:00:27 +00:00
platforms = lib.platforms.unix;
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
};
}