oraclejdk: remove redundant asserts

This commit is contained in:
John Doe 2017-12-06 07:38:45 +00:00
parent 018a3ec527
commit 683337d5f5
4 changed files with 25 additions and 64 deletions

View File

@ -1,10 +1,7 @@
{ productVersion
, patchVersion
, downloadUrl
, sha256_i686
, sha256_x86_64
, sha256_armv7l
, sha256_aarch64
, sha256
, jceName
, jceDownloadUrl
, sha256JCE
@ -37,29 +34,19 @@
, setJavaClassPath
}:
assert stdenv.system == "i686-linux"
|| stdenv.system == "x86_64-linux"
|| stdenv.system == "armv7l-linux"
|| stdenv.system == "aarch64-linux";
assert swingSupport -> xorg != null;
let
abortArch = abort "jdk requires i686-linux, x86_64-linux, aarch64-linux or armv7l-linux";
/**
* The JRE libraries are in directories that depend on the CPU.
*/
architecture =
if stdenv.system == "i686-linux" then
"i386"
else if stdenv.system == "x86_64-linux" then
"amd64"
else if stdenv.system == "armv7l-linux" then
"arm"
else if stdenv.system == "aarch64-linux" then
"aarch64"
else
abortArch;
architecture = {
i686-linux = "i386";
x86_64-linux = "amd64";
armv7l-linux = "arm";
aarch64-linux = "aarch64";
}.${stdenv.system};
jce =
if installjce then
@ -84,33 +71,16 @@ let result = stdenv.mkDerivation rec {
name =
if installjdk then "oraclejdk-${productVersion}u${patchVersion}" else "oraclejre-${productVersion}u${patchVersion}";
src =
if stdenv.system == "i686-linux" then
requireFile {
name = "jdk-${productVersion}u${patchVersion}-linux-i586.tar.gz";
url = downloadUrl;
sha256 = sha256_i686;
}
else if stdenv.system == "x86_64-linux" then
requireFile {
name = "jdk-${productVersion}u${patchVersion}-linux-x64.tar.gz";
url = downloadUrl;
sha256 = sha256_x86_64;
}
else if stdenv.system == "armv7l-linux" then
requireFile {
name = "jdk-${productVersion}u${patchVersion}-linux-arm32-vfp-hflt.tar.gz";
url = downloadUrl;
sha256 = sha256_armv7l;
}
else if stdenv.system == "aarch64-linux" then
requireFile {
name = "jdk-${productVersion}u${patchVersion}-linux-arm64-vfp-hflt.tar.gz";
url = downloadUrl;
sha256 = sha256_aarch64;
}
else
abortArch;
src = requireFile {
name = {
i686-linux = "jdk-${productVersion}u${patchVersion}-linux-i586.tar.gz";
x86_64-linux = "jdk-${productVersion}u${patchVersion}-linux-x64.tar.gz";
armv7l-linux = "jdk-${productVersion}u${patchVersion}-linux-arm32-vfp-hflt.tar.gz";
aarch64-linux = "jdk-${productVersion}u${patchVersion}-linux-arm64-vfp-hflt.tar.gz";
}.${stdenv.system};
url = downloadUrl;
sha256 = sha256.${stdenv.system};
};
nativeBuildInputs = [ file ]
++ stdenv.lib.optional installjce unzip;

View File

@ -2,10 +2,10 @@ import ./jdk-linux-base.nix {
productVersion = "8";
patchVersion = "151";
downloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html;
sha256_i686 = "0w1snn9hxwvdnk77frhdzbsm6v30v99dy5zmpy8ij7yxd57z6ql0";
sha256_x86_64 = "0zq2dxbxmshz080yskhc8y2wbqi0y0kl9girxjbb4rwk837010n7";
sha256_armv7l = "10r3nyssx8piyjaspravwgj2bnq4537041pn0lz4fk5b3473kgfb";
sha256_aarch64 = "1xva22cjjpwa95h7x3xzyymn1bgxp1q67j5j304kn6cqah4k31j1";
sha256.i686-linux = "0w1snn9hxwvdnk77frhdzbsm6v30v99dy5zmpy8ij7yxd57z6ql0";
sha256.x86_64-linux = "0zq2dxbxmshz080yskhc8y2wbqi0y0kl9girxjbb4rwk837010n7";
sha256.armv7l-linux = "10r3nyssx8piyjaspravwgj2bnq4537041pn0lz4fk5b3473kgfb";
sha256.aarch64-linux = "1xva22cjjpwa95h7x3xzyymn1bgxp1q67j5j304kn6cqah4k31j1";
jceName = "jce_policy-8.zip";
jceDownloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html;
sha256JCE = "0n8b6b8qmwb14lllk2lk1q1ahd3za9fnjigz5xn65mpg48whl0pk";

View File

@ -2,10 +2,10 @@ import ./jdk-linux-base.nix {
productVersion = "8";
patchVersion = "152";
downloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html;
sha256_i686 = "0gjc7kcfx40f43z1w1qsn1fqxdz8d46wml2g11qgm55ishhv2q7w";
sha256_x86_64 = "1gv1348hrgna9l3sssv3g9jzs37y1lkx05xq83chav9z1hs3p2r1";
sha256_armv7l = "10r3nyssx8piyjaspravwgj2bnq4537041pn0lz4fk5b3473kgfb";
sha256_aarch64 = "13qpxa8nxsnikmm7h6ysnsdqg5vl8j7hzfa8kgh20z8a17fhj9kk";
sha256.i686-linux = "0gjc7kcfx40f43z1w1qsn1fqxdz8d46wml2g11qgm55ishhv2q7w";
sha256.x86_64-linux = "1gv1348hrgna9l3sssv3g9jzs37y1lkx05xq83chav9z1hs3p2r1";
sha256.armv7l-linux = "10r3nyssx8piyjaspravwgj2bnq4537041pn0lz4fk5b3473kgfb";
sha256.aarch64-linux = "13qpxa8nxsnikmm7h6ysnsdqg5vl8j7hzfa8kgh20z8a17fhj9kk";
jceName = "jce_policy-8.zip";
jceDownloadUrl = http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html;
sha256JCE = "0n8b6b8qmwb14lllk2lk1q1ahd3za9fnjigz5xn65mpg48whl0pk";

View File

@ -6060,26 +6060,17 @@ with pkgs;
jre8Plugin = lowPrio (pkgs.oraclejdk8distro false true);
supportsJDK =
system == "i686-linux" ||
system == "x86_64-linux" ||
system == "armv7l-linux" ||
system == "aarch64-linux";
jdkdistro = oraclejdk8distro;
oraclejdk8distro = installjdk: pluginSupport:
assert supportsJDK;
(if pluginSupport then appendToName "with-plugin" else x: x)
(callPackage ../development/compilers/oraclejdk/jdk8cpu-linux.nix { inherit installjdk pluginSupport; });
oraclejdk8psu_distro = installjdk: pluginSupport:
assert supportsJDK;
(if pluginSupport then appendToName "with-plugin" else x: x)
(callPackage ../development/compilers/oraclejdk/jdk8psu-linux.nix { inherit installjdk pluginSupport; });
oraclejdk9distro = packageType: pluginSupport:
assert supportsJDK;
(if pluginSupport then appendToName "with-plugin" else x: x)
(callPackage ../development/compilers/oraclejdk/jdk9-linux.nix { inherit packageType pluginSupport; });