Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradle: add udev to the JNA library path #358670

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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