@@ -1,10 +1,7 @@
11{ productVersion
22, patchVersion
33, downloadUrl
4−, sha256_i686
5−, sha256_x86_64
6−, sha256_armv7l
7−, sha256_aarch64
4+, sha256
85, jceName
96, jceDownloadUrl
107, sha256JCE
@@ -37,29 +34,19 @@
3734, setJavaClassPath
3835}:
3936
40−assert stdenv.system == "i686-linux"
41− || stdenv.system == "x86_64-linux"
42− || stdenv.system == "armv7l-linux"
43− || stdenv.system == "aarch64-linux";
4437assert swingSupport -> xorg != null;
4538
4639let
47− abortArch = throw "Unsupported system: ${stdenv.system}";
4840
4941 /**
5042 * The JRE libraries are in directories that depend on the CPU.
5143 */
52− architecture =
53− if stdenv.system == "i686-linux" then
54− "i386"
55− else if stdenv.system == "x86_64-linux" then
56− "amd64"
57− else if stdenv.system == "armv7l-linux" then
58− "arm"
59− else if stdenv.system == "aarch64-linux" then
60− "aarch64"
61− else
62− abortArch;
44+ architecture = {
45+ i686-linux = "i386";
46+ x86_64-linux = "amd64";
47+ armv7l-linux = "arm";
48+ aarch64-linux = "aarch64";
49+ }.${stdenv.system};
6350
6451 jce =
6552 if installjce then
@@ -84,33 +71,16 @@ let result = stdenv.mkDerivation rec {
8471 name =
8572 if installjdk then "oraclejdk-${productVersion}u${patchVersion}" else "oraclejre-${productVersion}u${patchVersion}";
8673
87− src =
88− if stdenv.system == "i686-linux" then
89− requireFile {
90− name = "jdk-${productVersion}u${patchVersion}-linux-i586.tar.gz";
91− url = downloadUrl;
92− sha256 = sha256_i686;
93− }
94− else if stdenv.system == "x86_64-linux" then
95− requireFile {
96− name = "jdk-${productVersion}u${patchVersion}-linux-x64.tar.gz";
97− url = downloadUrl;
98− sha256 = sha256_x86_64;
99− }
100− else if stdenv.system == "armv7l-linux" then
101− requireFile {
102− name = "jdk-${productVersion}u${patchVersion}-linux-arm32-vfp-hflt.tar.gz";
103− url = downloadUrl;
104− sha256 = sha256_armv7l;
105− }
106− else if stdenv.system == "aarch64-linux" then
107− requireFile {
108− name = "jdk-${productVersion}u${patchVersion}-linux-arm64-vfp-hflt.tar.gz";
109− url = downloadUrl;
110− sha256 = sha256_aarch64;
111− }
112− else
113− abortArch;
74+ src = requireFile {
75+ name = {
76+ i686-linux = "jdk-${productVersion}u${patchVersion}-linux-i586.tar.gz";
77+ x86_64-linux = "jdk-${productVersion}u${patchVersion}-linux-x64.tar.gz";
78+ armv7l-linux = "jdk-${productVersion}u${patchVersion}-linux-arm32-vfp-hflt.tar.gz";
79+ aarch64-linux = "jdk-${productVersion}u${patchVersion}-linux-arm64-vfp-hflt.tar.gz";
80+ }.${stdenv.system};
81+ url = downloadUrl;
82+ sha256 = sha256.${stdenv.system};
83+ };
11484
11585 nativeBuildInputs = [ file ]
11686 ++ stdenv.lib.optional installjce unzip;