1{
2 lib,
3 stdenvNoCC,
4 fetchurl,
5 jre,
6}:
7
8let
9 version = "1.9.22.1";
10 versionSnakeCase = builtins.replaceStrings [ "." ] [ "_" ] version;
11in
12stdenvNoCC.mkDerivation {
13 pname = "aspectj";
14 inherit version;
15
16 __structuredAttrs = true;
17
18 src = fetchurl {
19 url = "https://github.com/eclipse/org.aspectj/releases/download/V${versionSnakeCase}/aspectj-${version}.jar";
20 hash = "sha256-NIyYVhJIGXz+vNVoAQzYsDfmOYc4QrRzJGWeQjS4X0U=";
21 };
22
23 dontUnpack = true;
24
25 nativeBuildInputs = [ jre ];
26
27 installPhase = ''
28 runHook preInstall
29
30 cat >> props <<EOF
31 output.dir=$out
32 context.javaPath=${jre}
33 EOF
34
35 mkdir -p $out
36 java -jar $src -text props
37
38 cat >> $out/bin/aj-runtime-env <<EOF
39 #! ${stdenvNoCC.shell}
40
41 export CLASSPATH=$CLASSPATH:.:$out/lib/aspectjrt.jar
42 EOF
43
44 chmod u+x $out/bin/aj-runtime-env
45
46 runHook postInstall
47 '';
48
49 meta = {
50 homepage = "https://www.eclipse.org/aspectj/";
51 description = "Seamless aspect-oriented extension to the Java programming language";
52 license = lib.licenses.epl10;
53 platforms = lib.platforms.unix;
54 sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
55 };
56}