tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
java: Refactor top level and build ordering
William A. Kennington III
10 years ago
bdcb7215
e0db2213
+56
-59
4 changed files
expand all
collapse all
unified
split
pkgs
development
compilers
openjdk
bootstrap.nix
default.nix
openjdk8.nix
top-level
all-packages.nix
+22
-19
pkgs/development/compilers/openjdk/bootstrap.nix
···
4
4
# !!! These should be on nixos.org
5
5
src = if glibc.system == "x86_64-linux" then
6
6
fetchurl {
7
7
-
url = http://tarballs.nixos.org/openjdk-bootstrap-x86_64-linux-2012-08-24.tar.xz;
8
8
-
sha256 = "0gla9dxrfq2w1hvgsnn8jg8a60k27im6z43a6iidi0qmwa0wah32";
7
7
+
url = http://pub.wak.io/nixos/tarballs/openjdk-bootstrap-x86_64-linux.tar.xz;
8
8
+
sha256 = "13m3df54mnr2nb67284s2zf5n8y502ck47gc39lcafrh40hzjil5";
9
9
}
10
10
else if glibc.system == "i686-linux" then
11
11
fetchurl {
12
12
-
url = http://tarballs.nixos.org/openjdk-bootstrap-i686-linux-2012-08-24.tar.xz;
13
13
-
sha256 = "184wq212bycwbbq4ix8cc6jwjxkrqw9b01zb86q95kqpa8zy5206";
12
12
+
url = http://pub.wak.io/nixos/tarballs/openjdk-bootstrap-i686-linux.tar.xz;
13
13
+
sha256 = "18kzv4h9skxg5g5c7ar2ji3qny880h5svcn207b4d6xv4sa0a6ks";
14
14
}
15
15
else throw "No bootstrap for system";
16
16
-
in
17
16
18
18
-
runCommand "openjdk-bootstrap" {} ''
19
19
-
tar xvf ${src}
20
20
-
mv openjdk-bootstrap $out
17
17
+
bootstrap = runCommand "openjdk-bootstrap" {
18
18
+
passthru.home = "${bootstrap}/lib/openjdk";
19
19
+
} ''
20
20
+
tar xvf ${src}
21
21
+
mv openjdk-bootstrap $out
21
22
22
22
-
for i in $out/bin/*; do
23
23
-
patchelf --set-interpreter ${glibc}/lib/ld-linux*.so.2 $i
24
24
-
done
23
23
+
for i in $out/bin/*; do
24
24
+
patchelf --set-interpreter ${glibc}/lib/ld-linux*.so.2 $i || true
25
25
+
patchelf --set-rpath ${glibc}/lib:$out/lib $i || true
26
26
+
done
25
27
26
26
-
# Temporarily, while NixOS's OpenJDK bootstrap tarball doesn't have PaX markings:
27
27
-
exes=$(${file}/bin/file $out/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
28
28
-
for file in $exes; do
29
29
-
paxmark m "$file"
30
30
-
# On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well.
31
31
-
${stdenv.lib.optionalString stdenv.isi686 ''paxmark msp "$file"''}
32
32
-
done
33
33
-
''
28
28
+
# Temporarily, while NixOS's OpenJDK bootstrap tarball doesn't have PaX markings:
29
29
+
exes=$(${file}/bin/file $out/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
30
30
+
for file in $exes; do
31
31
+
paxmark m "$file"
32
32
+
# On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well.
33
33
+
${stdenv.lib.optionalString stdenv.isi686 ''paxmark msp "$file"''}
34
34
+
done
35
35
+
'';
36
36
+
in bootstrap
+3
-3
pkgs/development/compilers/openjdk/default.nix
···
1
1
{ stdenv, fetchurl, unzip, zip, procps, coreutils, alsaLib, ant, freetype
2
2
-
, which, jdk, nettools, xorg, file
2
2
+
, which, bootjdk, nettools, xorg, file
3
3
, fontconfig, cpio, cacert, perl, setJavaClassPath }:
4
4
5
5
let
···
15
15
else
16
16
throw "openjdk requires i686-linux or x86_64 linux";
17
17
18
18
-
update = "65";
18
18
+
update = "80";
19
19
20
20
build = "32";
21
21
···
81
81
"COMPILER_PATH="
82
82
"DEVTOOLS_PATH="
83
83
"UNIXCOMMAND_PATH="
84
84
-
"BOOTDIR=${jdk}"
84
84
+
"BOOTDIR=${bootjdk.home}"
85
85
"STATIC_CXX=false"
86
86
"UNLIMITED_CRYPTO=1"
87
87
"FULL_DEBUG_SYMBOLS=0"
+4
-3
pkgs/development/compilers/openjdk/openjdk8.nix
···
1
1
-
{ stdenv, fetchurl, cpio, file, which, unzip, zip, xorg, cups, freetype, alsaLib, openjdk, cacert, perl, liberation_ttf, fontconfig } :
1
1
+
{ stdenv, fetchurl, cpio, file, which, unzip, zip, xorg, cups, freetype, alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig } :
2
2
let
3
3
update = "40";
4
4
build = "27";
···
44
44
buildInputs = [ cpio file which unzip zip
45
45
xorg.libX11 xorg.libXt xorg.libXext xorg.libXrender xorg.libXtst
46
46
xorg.libXi xorg.libXinerama xorg.libXcursor xorg.lndir
47
47
-
cups freetype alsaLib openjdk perl liberation_ttf fontconfig ];
47
47
+
cups freetype alsaLib perl liberation_ttf fontconfig bootjdk ];
48
48
setSourceRoot = ''
49
49
sourceRoot="jdk8u${update}-jdk8u${update}-b${build}";
50
50
'';
···
82
82
"--with-override-jaxws=../jaxws-${repover}"
83
83
"--with-override-jaxp=../jaxp-${repover}"
84
84
"--with-override-nashorn=../nashorn-${repover}"
85
85
-
"--with-boot-jdk=${openjdk}/lib/openjdk/"
85
85
+
"--with-boot-jdk=${bootjdk.home}"
86
86
"--with-update-version=${update}"
87
87
"--with-build-number=b${build}"
88
88
"--with-milestone=fcs"
89
89
+
"--disable-debug-symbols"
89
90
];
90
91
NIX_LDFLAGS= "-lfontconfig";
91
92
buildFlags = "all";
+27
-34
pkgs/top-level/all-packages.nix
···
3905
3905
3906
3906
gwt240 = callPackage ../development/compilers/gwt/2.4.0.nix { };
3907
3907
3908
3908
-
icedtea7_jdk = callPackage ../development/compilers/icedtea rec {
3909
3909
-
jdk = openjdk;
3908
3908
+
icedtea7 = callPackage ../development/compilers/icedtea rec {
3909
3909
+
bootjdk = openjdk-bootstrap;
3910
3910
giflib = giflib_5_0;
3911
3911
-
} // { outputs = [ "out" ]; };
3911
3911
+
};
3912
3912
3913
3913
-
icedtea7_jre = (lib.setName "icedtea7-${lib.getVersion pkgs.icedtea7_jdk.jre}" (lib.addMetaAttrs
3914
3914
-
{ description = "Free Java runtime environment based on OpenJDK 7.0 and the IcedTea project"; }
3915
3915
-
pkgs.icedtea7_jdk.jre)) // { outputs = [ "jre" ]; };
3913
3913
+
# There will not likely be an icedtea8 so users should move to openjdk
3914
3914
+
icedtea = icedtea7;
3916
3915
3917
3916
icedtea7_web = callPackage ../development/compilers/icedtea-web {
3918
3918
-
jdk = icedtea7_jdk;
3917
3917
+
jdk = jdk7;
3918
3918
+
xulrunner = firefox;
3919
3919
+
};
3920
3920
+
3921
3921
+
icedtea8_web = callPackage ../development/compilers/icedtea-web {
3922
3922
+
jdk = jdk8;
3919
3923
xulrunner = firefox;
3920
3924
};
3921
3925
3922
3922
-
icedtea_jdk = icedtea7_jdk;
3923
3923
-
icedtea_jre = icedtea7_jre;
3924
3924
-
icedtea_web = icedtea7_web;
3926
3926
+
icedtea_web = icedtea8_web;
3925
3927
3926
3928
ikarus = callPackage ../development/compilers/ikarus { };
3927
3929
···
3929
3931
3930
3932
path64 = callPackage ../development/compilers/path64 { };
3931
3933
3932
3932
-
openjdk =
3933
3933
-
if stdenv.isDarwin then
3934
3934
-
callPackage ../development/compilers/openjdk-darwin { }
3935
3935
-
else
3936
3936
-
let
3937
3937
-
openjdkBootstrap = callPackage ../development/compilers/openjdk/bootstrap.nix { };
3938
3938
-
in (callPackage ../development/compilers/openjdk {
3939
3939
-
jdk = openjdkBootstrap;
3940
3940
-
}) // { outputs = [ "out" ]; };
3934
3934
+
openjdk-bootstrap = callPackage ../development/compilers/openjdk/bootstrap.nix { };
3935
3935
+
3936
3936
+
openjdk-darwin = callPackage ../development/compilers/openjdk-darwin { };
3937
3937
+
3938
3938
+
openjdk7 = callPackage ../development/compilers/openjdk {
3939
3939
+
bootjdk = openjdk-bootstrap;
3940
3940
+
};
3941
3941
+
3942
3942
+
openjdk8 = callPackage ../development/compilers/openjdk/openjdk8.nix {
3943
3943
+
bootjdk = openjdk-bootstrap;
3944
3944
+
};
3941
3945
3942
3942
-
openjdk8 = callPackage ../development/compilers/openjdk/openjdk8.nix { } // { outputs = [ "out" ]; };
3946
3946
+
openjdk = if stdenv.isDarwin then openjdk-darwin else openjdk8;
3943
3947
3944
3944
-
# FIXME: Need a way to set per-output meta attributes.
3945
3945
-
openjre = (lib.setName "openjre-${lib.getVersion pkgs.openjdk.jre}" (lib.addMetaAttrs
3946
3946
-
{ description = "The open-source Java Runtime Environment"; }
3947
3947
-
pkgs.openjdk.jre)) // { outputs = [ "jre" ]; };
3948
3948
+
jdk7 = icedtea7;
3948
3949
3949
3949
-
jdk = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
3950
3950
-
then pkgs.icedtea_jdk
3951
3951
-
else if stdenv.isDarwin
3952
3952
-
then pkgs.openjdk # TODO: Use icedtea for darwin
3953
3953
-
else pkgs.oraclejdk;
3950
3950
+
jdk8 = openjdk8;
3954
3951
3955
3955
-
jre = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
3956
3956
-
then pkgs.icedtea_jre
3957
3957
-
else if stdenv.isDarwin
3958
3958
-
then pkgs.openjre # TODO: Use icedtea for darwin
3959
3959
-
else pkgs.oraclejre;
3952
3952
+
jdk = if stdenv.isDarwin then openjdk-darwin else jdk8;
3960
3953
3961
3954
oraclejdk = pkgs.jdkdistro true false;
3962
3955