Skip to content

Commit

Permalink
libeufin: wrap and set JAVA_HOME (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
eljamm authored Jun 23, 2024
1 parent f5dc559 commit fb05eb5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkgs/by-name/libeufin/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
callPackage,
stdenv,
fetchgit,
makeWrapper,
python3,
jdk17_headless,
gradle-packages,
Expand Down Expand Up @@ -36,7 +37,7 @@
./use-maven-deps.patch
];

gradle = callPackage gradle-packages.gradle_8 {java = jdk17_headless;};
gradle = callPackage gradle-packages.gradle_8 {java = jdk;};

# Pre-download deps into a derivation
deps = callPackage ./deps {inherit gradle patches pname src version;};
Expand All @@ -48,6 +49,8 @@
["${deps}"]
(builtins.readFile ./init.gradle.template)
);

jdk = jdk17_headless;
in
stdenv.mkDerivation {
inherit patches pname src version;
Expand All @@ -63,11 +66,17 @@ in

installPhase = ''
make install-nobuild
# wrap commands to provide JAVA_HOME
for name in libeufin-bank libeufin-dbconfig libeufin-nexus; do
wrapProgram $out/bin/$name --set JAVA_HOME "${jdk}"
done
'';

nativeBuildInputs = [
makeWrapper
python3
jdk17_headless
jdk
gradle
];

Expand Down

0 comments on commit fb05eb5

Please sign in to comment.