From 27f5088cd2bfc31eb6aabb3f7bd33ee195690d85 Mon Sep 17 00:00:00 2001 From: taku0 Date: Sat, 23 Jan 2021 15:33:57 +0900 Subject: [PATCH 1/3] adoptopenjdk-bin: link jni_md.h to include folder See https://discourse.nixos.org/t/nix-shell-environment-to-debug-a-build-of-an-r-package/11010/4 --- .../development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix | 3 +++ pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix index 31a7346108e7..9479e15cd6fb 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix @@ -23,6 +23,9 @@ let cpuName = stdenv.hostPlatform.parsed.cpu.name; mv $sourceRoot $out + # jni.h expects jni_md.h to be in the header search path. + ln -s $out/Contents/Home/include/darwin/*_md.h $out/Contents/Home/include/ + rm -rf $out/Home/demo # Remove some broken manpages. diff --git a/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix b/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix index ed8935b00421..44126a54d5ba 100644 --- a/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix +++ b/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix @@ -65,6 +65,9 @@ let result = stdenv.mkDerivation rec { mv $sourceRoot $out + # jni.h expects jni_md.h to be in the header search path. + ln -s $out/include/linux/*_md.h $out/include/ + rm -rf $out/demo # Remove some broken manpages. From 9cc0da0f7f4b686f799525400c8384b28e370618 Mon Sep 17 00:00:00 2001 From: taku0 Date: Sat, 23 Jan 2021 15:35:21 +0900 Subject: [PATCH 2/3] zulu, zulu8: link jni_md.h to include folder See https://discourse.nixos.org/t/nix-shell-environment-to-debug-a-build-of-an-r-package/11010/4 --- pkgs/development/compilers/zulu/8.nix | 3 +++ pkgs/development/compilers/zulu/default.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pkgs/development/compilers/zulu/8.nix b/pkgs/development/compilers/zulu/8.nix index dd1660d9fec7..edbe3494a93d 100644 --- a/pkgs/development/compilers/zulu/8.nix +++ b/pkgs/development/compilers/zulu/8.nix @@ -70,6 +70,9 @@ in stdenv.mkDerivation { mkdir -p $out cp -r ./* "$out/" + # jni.h expects jni_md.h to be in the header search path. + ln -s $out/include/linux/*_md.h $out/include/ + mkdir -p $out/nix-support printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs diff --git a/pkgs/development/compilers/zulu/default.nix b/pkgs/development/compilers/zulu/default.nix index c7b01877ad54..678a248785f7 100644 --- a/pkgs/development/compilers/zulu/default.nix +++ b/pkgs/development/compilers/zulu/default.nix @@ -72,6 +72,9 @@ in stdenv.mkDerivation { mkdir -p $out cp -r ./* "$out/" + # jni.h expects jni_md.h to be in the header search path. + ln -s $out/include/linux/*_md.h $out/include/ + mkdir -p $out/nix-support printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs From ff3e401d1228ef096209af2d4fb42da0113c2d63 Mon Sep 17 00:00:00 2001 From: taku0 Date: Sat, 23 Jan 2021 15:35:48 +0900 Subject: [PATCH 3/3] graalvm8-ce, graalvm11-ce: link jni_md.h to include folder See https://discourse.nixos.org/t/nix-shell-environment-to-debug-a-build-of-an-r-package/11010/4 --- pkgs/development/compilers/graalvm/community-edition.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/graalvm/community-edition.nix b/pkgs/development/compilers/graalvm/community-edition.nix index 3a8fca2c1a05..0cecfe5889eb 100644 --- a/pkgs/development/compilers/graalvm/community-edition.nix +++ b/pkgs/development/compilers/graalvm/community-edition.nix @@ -182,7 +182,10 @@ let "11-darwin-amd64" = '' echo "" ''; - }.${javaVersionPlatform}; + }.${javaVersionPlatform} + '' + # jni.h expects jni_md.h to be in the header search path. + ln -s $out/include/linux/*_md.h $out/include/ + ''; dontStrip = true;