Skip to content

Commit

Permalink
gradle: add udev to the JNA library path (#358670)
Browse files Browse the repository at this point in the history
  • Loading branch information
FliegendeWurst authored Jan 16, 2025
2 parents b6a35ab + a81011b commit ac3dd91
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/development/tools/build-managers/gradle/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ rec {
, unzip
, ncurses5
, ncurses6
, udev
, testers
, runCommand
, writeText
Expand Down Expand Up @@ -91,6 +92,7 @@ rec {
};
varDefs = concatStringsSep "\n" (map (x: " --set ${x} \\")
([ "JAVA_HOME ${java}" ] ++ toolchain.varDefs));
jnaLibraryPath = lib.makeLibraryPath [ udev ];
in ''
mkdir -pv $out/lib/gradle/
cp -rv lib/ $out/lib/gradle/
Expand All @@ -99,6 +101,7 @@ rec {
test -f $gradle_launcher_jar
makeWrapper ${java}/bin/java $out/bin/gradle \
${varDefs}
--add-flags "-Djna.library.path=${jnaLibraryPath}" \
--add-flags "-classpath $gradle_launcher_jar org.gradle.launcher.GradleMain${toolchain.property}"
'';

Expand Down Expand Up @@ -129,6 +132,7 @@ rec {
# Gradle will refuse to start without _both_ 5 and 6 versions of ncurses.
echo ${ncurses5} >> $out/nix-support/manual-runtime-dependencies
echo ${ncurses6} >> $out/nix-support/manual-runtime-dependencies
echo ${udev} >> $out/nix-support/manual-runtime-dependencies
'';

passthru.tests = {
Expand Down

0 comments on commit ac3dd91

Please sign in to comment.