-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
oraclejdk.nix
56 lines (56 loc) · 2.23 KB
/
oraclejdk.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
pkgs: pkgs0: {
# Oracle, fuck you. 🖕
#
# <https://nadwey.eu.org/java/8/>
# <https://gist.github.com/wavezhang/ba8425f24a968ec9b2a8619d7c2d86a6>
#
# This override calls `jdk-linux-base.nix` with product information
# matching a tarball that we can get from the link above.
#
# In order to hide the "we can't download that for you" message
# shown by `pkgs.requireFile` in the nixpkgs source,
# we hijack the `requireFile` function passed to `package` below,
# and if the name matches the product information for this
# shady tarball, substitute it with the automatic download.
#
# Note that this does not take into account anything except the basic
# default package options. If you need the JCE for example, you're on your own.
#
# Read up on the nixpkgs source to understand this more:
# <https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix#L80>
oraclejdk = let
product = {
productVersion = "8";
patchVersion = "361";
# for <cfdownload.adobe.com>
sha256.x86_64-linux =
"sha256-JYWpJLuNLDFdj+RL+lNPYV94knlliWPTD/4Un9dB2W4=";
# for <nadwey.eu.org>
# sha256.x86_64-linux = "sha256-YeP0CZqZp3pweFOAizps+ofSuCsZt8dtzGxdPu37O50=";
jceName = null;
sha256JCE = null;
};
version = "${product.productVersion}u${product.patchVersion}";
tarballName = "jdk-${version}-${platformName}.tar.gz";
src = pkgs.fetchzip {
url =
"https://cfdownload.adobe.com/pub/adobe/coldfusion/java/java${product.productVersion}/java${version}/jdk/${tarballName}";
# url = "https://nadwey.eu.org/java/${product.productVersion}/jdk-${version}/${tarballName}";
sha256 = product.sha256.${pkgs.system};
};
package = import
"${pkgs.path}/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix"
product;
platformName = builtins.getAttr pkgs.system {
i686-linux = "linux-i586";
x86_64-linux = "linux-x64";
armv7l-linux = "linux-arm32-vfp-hflt";
aarch64-linux = "linux-aarch64";
};
in pkgs.callPackage package {
installjdk = true;
pluginSupport = false;
requireFile = args@{ name, ... }:
if name == tarballName then src else pkgs.requireFile args;
};
}