Merge pull request #27419 from elitak/armjdk

oraclejdk8: armv7l support

authored by Jörg Thalheim and committed by GitHub d3ee993a b6f9047d

+43 -21
+37 -18
pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
··· 3 3 , downloadUrl 4 4 , sha256_i686 5 5 , sha256_x86_64 6 + , sha256_armv7l 6 7 , jceName 7 8 , jceDownloadUrl 8 9 , sha256JCE ··· 34 35 , setJavaClassPath 35 36 }: 36 37 37 - assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"; 38 + assert stdenv.system == "i686-linux" 39 + || stdenv.system == "x86_64-linux" 40 + || stdenv.system == "armv7l-linux"; 38 41 assert swingSupport -> xorg != null; 39 42 40 43 let 44 + abortArch = abort "jdk requires i686-linux, x86_64-linux, or armv7l-linux"; 41 45 42 46 /** 43 47 * The JRE libraries are in directories that depend on the CPU. ··· 47 51 "i386" 48 52 else if stdenv.system == "x86_64-linux" then 49 53 "amd64" 54 + else if stdenv.system == "armv7l-linux" then 55 + "arm" 50 56 else 51 - abort "jdk requires i686-linux or x86_64 linux"; 57 + abortArch; 52 58 53 59 jce = 54 60 if installjce then ··· 59 65 } 60 66 else 61 67 ""; 68 + 69 + rSubPaths = [ 70 + "lib/${architecture}/jli" 71 + "lib/${architecture}/server" 72 + "lib/${architecture}/xawt" 73 + "lib/${architecture}" 74 + ]; 75 + 62 76 in 63 77 64 78 let result = stdenv.mkDerivation rec { ··· 78 92 url = downloadUrl; 79 93 sha256 = sha256_x86_64; 80 94 } 95 + else if stdenv.system == "armv7l-linux" then 96 + requireFile { 97 + name = "jdk-${productVersion}u${patchVersion}-linux-arm32-vfp-hflt.tar.gz"; 98 + url = downloadUrl; 99 + sha256 = sha256_armv7l; 100 + } 81 101 else 82 - abort "jdk requires i686-linux or x86_64 linux"; 102 + abortArch; 83 103 84 104 nativeBuildInputs = [ file ] 85 105 ++ stdenv.lib.optional installjce unzip; ··· 134 154 cp -v UnlimitedJCEPolicy*/*.jar $jrePath/lib/security 135 155 fi 136 156 137 - rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture}/jli 138 - rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture}/server 139 - rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture}/xawt 140 - rpath=$rpath''${rpath:+:}$jrePath/lib/${architecture} 141 - 142 - # set all the dynamic linkers 143 - find $out -type f -perm -0100 \ 144 - -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 145 - --set-rpath "$rpath" {} \; 146 - 147 - find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \; 148 - 149 157 if test -z "$pluginSupport"; then 150 158 rm -f $out/bin/javaws 151 159 if test -n "$installjdk"; then ··· 163 171 cat <<EOF >> $out/nix-support/setup-hook 164 172 if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi 165 173 EOF 174 + ''; 175 + 176 + postFixup = '' 177 + rpath+="''${rpath:+:}${stdenv.lib.concatStringsSep ":" (map (a: "$jrePath/${a}") rSubPaths)}" 178 + 179 + # set all the dynamic linkers 180 + find $out -type f -perm -0100 \ 181 + -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 182 + --set-rpath "$rpath" {} \; 183 + 184 + find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \; 166 185 167 186 # Oracle Java Mission Control needs to know where libgtk-x11 and related is 168 - if test -n "$installjdk"; then 187 + if test -n "$installjdk" -a -x $out/bin/jmc; then 169 188 wrapProgram "$out/bin/jmc" \ 170 - --suffix-each LD_LIBRARY_PATH ':' "${rpath}" 189 + --suffix-each LD_LIBRARY_PATH ':' "$rpath" 171 190 fi 172 191 ''; 173 192 ··· 192 211 193 212 meta = with stdenv.lib; { 194 213 license = licenses.unfree; 195 - platforms = [ "i686-linux" "x86_64-linux" ]; # some inherit jre.meta.platforms 214 + platforms = [ "i686-linux" "x86_64-linux" "armv7l-linux" ]; # some inherit jre.meta.platforms 196 215 }; 197 216 198 217 }; in result
+1
pkgs/development/compilers/oraclejdk/jdk8cpu-linux.nix
··· 4 4 downloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html; 5 5 sha256_i686 = "0m3i1n1im1nlwb06wlsdajv19cd3zhrjkw8zbyjfznydn6qs4s80"; 6 6 sha256_x86_64 = "0dhj623ya01glcl3iir9ajifcrf6awhvpk936x9cxfj8zfyibck2"; 7 + sha256_armv7l = "0ja97nqn4x0ji16c7r6i9nnnj3745br7qlbj97jg1s8m2wk7f9jd"; 7 8 jceName = "jce_policy-8.zip"; 8 9 jceDownloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html; 9 10 sha256JCE = "0n8b6b8qmwb14lllk2lk1q1ahd3za9fnjigz5xn65mpg48whl0pk";
+1
pkgs/development/compilers/oraclejdk/jdk8psu-linux.nix
··· 4 4 downloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html; 5 5 sha256_i686 = "0m3i1n1im1nlwb06wlsdajv19cd3zhrjkw8zbyjfznydn6qs4s80"; 6 6 sha256_x86_64 = "0dhj623ya01glcl3iir9ajifcrf6awhvpk936x9cxfj8zfyibck2"; 7 + sha256_armv7l = "0ja97nqn4x0ji16c7r6i9nnnj3745br7qlbj97jg1s8m2wk7f9jd"; 7 8 jceName = "jce_policy-8.zip"; 8 9 jceDownloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html; 9 10 sha256JCE = "0n8b6b8qmwb14lllk2lk1q1ahd3za9fnjigz5xn65mpg48whl0pk";
+4 -3
pkgs/top-level/all-packages.nix
··· 5621 5621 (lib.addMetaAttrs { outputsToInstall = [ "jre" ]; } 5622 5622 (openjdk7.jre // { outputs = [ "jre" ]; })); 5623 5623 5624 - jdk8 = openjdk8 // { outputs = [ "out" ]; }; 5625 - jre8 = lib.setName "openjre-${lib.getVersion pkgs.openjdk8.jre}" 5624 + jdk8 = if stdenv.isArm then oraclejdk8 else openjdk8 // { outputs = [ "out" ]; }; 5625 + jre8 = if stdenv.isArm then oraclejre8 else lib.setName "openjre-${lib.getVersion pkgs.openjdk8.jre}" 5626 5626 (lib.addMetaAttrs { outputsToInstall = [ "jre" ]; } 5627 5627 (openjdk8.jre // { outputs = [ "jre" ]; })); 5628 5628 jre8_headless = ··· 5655 5655 5656 5656 supportsJDK = 5657 5657 system == "i686-linux" || 5658 - system == "x86_64-linux"; 5658 + system == "x86_64-linux" || 5659 + system == "armv7l-linux"; 5659 5660 5660 5661 jdkdistro = oraclejdk8distro; 5661 5662