java: Refactor top level and build ordering

This commit is contained in:
William A. Kennington III 2015-06-06 16:14:43 -07:00
parent e0db2213fc
commit bdcb721546
4 changed files with 56 additions and 59 deletions

View File

@ -4,30 +4,33 @@ let
# !!! These should be on nixos.org # !!! These should be on nixos.org
src = if glibc.system == "x86_64-linux" then src = if glibc.system == "x86_64-linux" then
fetchurl { fetchurl {
url = http://tarballs.nixos.org/openjdk-bootstrap-x86_64-linux-2012-08-24.tar.xz; url = http://pub.wak.io/nixos/tarballs/openjdk-bootstrap-x86_64-linux.tar.xz;
sha256 = "0gla9dxrfq2w1hvgsnn8jg8a60k27im6z43a6iidi0qmwa0wah32"; sha256 = "13m3df54mnr2nb67284s2zf5n8y502ck47gc39lcafrh40hzjil5";
} }
else if glibc.system == "i686-linux" then else if glibc.system == "i686-linux" then
fetchurl { fetchurl {
url = http://tarballs.nixos.org/openjdk-bootstrap-i686-linux-2012-08-24.tar.xz; url = http://pub.wak.io/nixos/tarballs/openjdk-bootstrap-i686-linux.tar.xz;
sha256 = "184wq212bycwbbq4ix8cc6jwjxkrqw9b01zb86q95kqpa8zy5206"; sha256 = "18kzv4h9skxg5g5c7ar2ji3qny880h5svcn207b4d6xv4sa0a6ks";
} }
else throw "No bootstrap for system"; else throw "No bootstrap for system";
in
runCommand "openjdk-bootstrap" {} '' bootstrap = runCommand "openjdk-bootstrap" {
tar xvf ${src} passthru.home = "${bootstrap}/lib/openjdk";
mv openjdk-bootstrap $out } ''
tar xvf ${src}
mv openjdk-bootstrap $out
for i in $out/bin/*; do for i in $out/bin/*; do
patchelf --set-interpreter ${glibc}/lib/ld-linux*.so.2 $i patchelf --set-interpreter ${glibc}/lib/ld-linux*.so.2 $i || true
done patchelf --set-rpath ${glibc}/lib:$out/lib $i || true
done
# Temporarily, while NixOS's OpenJDK bootstrap tarball doesn't have PaX markings: # Temporarily, while NixOS's OpenJDK bootstrap tarball doesn't have PaX markings:
exes=$(${file}/bin/file $out/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//') exes=$(${file}/bin/file $out/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
for file in $exes; do for file in $exes; do
paxmark m "$file" paxmark m "$file"
# On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well. # On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well.
${stdenv.lib.optionalString stdenv.isi686 ''paxmark msp "$file"''} ${stdenv.lib.optionalString stdenv.isi686 ''paxmark msp "$file"''}
done done
'' '';
in bootstrap

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, unzip, zip, procps, coreutils, alsaLib, ant, freetype { stdenv, fetchurl, unzip, zip, procps, coreutils, alsaLib, ant, freetype
, which, jdk, nettools, xorg, file , which, bootjdk, nettools, xorg, file
, fontconfig, cpio, cacert, perl, setJavaClassPath }: , fontconfig, cpio, cacert, perl, setJavaClassPath }:
let let
@ -15,7 +15,7 @@ let
else else
throw "openjdk requires i686-linux or x86_64 linux"; throw "openjdk requires i686-linux or x86_64 linux";
update = "65"; update = "80";
build = "32"; build = "32";
@ -81,7 +81,7 @@ let
"COMPILER_PATH=" "COMPILER_PATH="
"DEVTOOLS_PATH=" "DEVTOOLS_PATH="
"UNIXCOMMAND_PATH=" "UNIXCOMMAND_PATH="
"BOOTDIR=${jdk}" "BOOTDIR=${bootjdk.home}"
"STATIC_CXX=false" "STATIC_CXX=false"
"UNLIMITED_CRYPTO=1" "UNLIMITED_CRYPTO=1"
"FULL_DEBUG_SYMBOLS=0" "FULL_DEBUG_SYMBOLS=0"

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, cpio, file, which, unzip, zip, xorg, cups, freetype, alsaLib, openjdk, cacert, perl, liberation_ttf, fontconfig } : { stdenv, fetchurl, cpio, file, which, unzip, zip, xorg, cups, freetype, alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig } :
let let
update = "40"; update = "40";
build = "27"; build = "27";
@ -44,7 +44,7 @@ let
buildInputs = [ cpio file which unzip zip buildInputs = [ cpio file which unzip zip
xorg.libX11 xorg.libXt xorg.libXext xorg.libXrender xorg.libXtst xorg.libX11 xorg.libXt xorg.libXext xorg.libXrender xorg.libXtst
xorg.libXi xorg.libXinerama xorg.libXcursor xorg.lndir xorg.libXi xorg.libXinerama xorg.libXcursor xorg.lndir
cups freetype alsaLib openjdk perl liberation_ttf fontconfig ]; cups freetype alsaLib perl liberation_ttf fontconfig bootjdk ];
setSourceRoot = '' setSourceRoot = ''
sourceRoot="jdk8u${update}-jdk8u${update}-b${build}"; sourceRoot="jdk8u${update}-jdk8u${update}-b${build}";
''; '';
@ -82,10 +82,11 @@ let
"--with-override-jaxws=../jaxws-${repover}" "--with-override-jaxws=../jaxws-${repover}"
"--with-override-jaxp=../jaxp-${repover}" "--with-override-jaxp=../jaxp-${repover}"
"--with-override-nashorn=../nashorn-${repover}" "--with-override-nashorn=../nashorn-${repover}"
"--with-boot-jdk=${openjdk}/lib/openjdk/" "--with-boot-jdk=${bootjdk.home}"
"--with-update-version=${update}" "--with-update-version=${update}"
"--with-build-number=b${build}" "--with-build-number=b${build}"
"--with-milestone=fcs" "--with-milestone=fcs"
"--disable-debug-symbols"
]; ];
NIX_LDFLAGS= "-lfontconfig"; NIX_LDFLAGS= "-lfontconfig";
buildFlags = "all"; buildFlags = "all";

View File

@ -3905,23 +3905,25 @@ let
gwt240 = callPackage ../development/compilers/gwt/2.4.0.nix { }; gwt240 = callPackage ../development/compilers/gwt/2.4.0.nix { };
icedtea7_jdk = callPackage ../development/compilers/icedtea rec { icedtea7 = callPackage ../development/compilers/icedtea rec {
jdk = openjdk; bootjdk = openjdk-bootstrap;
giflib = giflib_5_0; giflib = giflib_5_0;
} // { outputs = [ "out" ]; }; };
icedtea7_jre = (lib.setName "icedtea7-${lib.getVersion pkgs.icedtea7_jdk.jre}" (lib.addMetaAttrs # There will not likely be an icedtea8 so users should move to openjdk
{ description = "Free Java runtime environment based on OpenJDK 7.0 and the IcedTea project"; } icedtea = icedtea7;
pkgs.icedtea7_jdk.jre)) // { outputs = [ "jre" ]; };
icedtea7_web = callPackage ../development/compilers/icedtea-web { icedtea7_web = callPackage ../development/compilers/icedtea-web {
jdk = icedtea7_jdk; jdk = jdk7;
xulrunner = firefox; xulrunner = firefox;
}; };
icedtea_jdk = icedtea7_jdk; icedtea8_web = callPackage ../development/compilers/icedtea-web {
icedtea_jre = icedtea7_jre; jdk = jdk8;
icedtea_web = icedtea7_web; xulrunner = firefox;
};
icedtea_web = icedtea8_web;
ikarus = callPackage ../development/compilers/ikarus { }; ikarus = callPackage ../development/compilers/ikarus { };
@ -3929,34 +3931,25 @@ let
path64 = callPackage ../development/compilers/path64 { }; path64 = callPackage ../development/compilers/path64 { };
openjdk = openjdk-bootstrap = callPackage ../development/compilers/openjdk/bootstrap.nix { };
if stdenv.isDarwin then
callPackage ../development/compilers/openjdk-darwin { }
else
let
openjdkBootstrap = callPackage ../development/compilers/openjdk/bootstrap.nix { };
in (callPackage ../development/compilers/openjdk {
jdk = openjdkBootstrap;
}) // { outputs = [ "out" ]; };
openjdk8 = callPackage ../development/compilers/openjdk/openjdk8.nix { } // { outputs = [ "out" ]; }; openjdk-darwin = callPackage ../development/compilers/openjdk-darwin { };
# FIXME: Need a way to set per-output meta attributes. openjdk7 = callPackage ../development/compilers/openjdk {
openjre = (lib.setName "openjre-${lib.getVersion pkgs.openjdk.jre}" (lib.addMetaAttrs bootjdk = openjdk-bootstrap;
{ description = "The open-source Java Runtime Environment"; } };
pkgs.openjdk.jre)) // { outputs = [ "jre" ]; };
jdk = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" openjdk8 = callPackage ../development/compilers/openjdk/openjdk8.nix {
then pkgs.icedtea_jdk bootjdk = openjdk-bootstrap;
else if stdenv.isDarwin };
then pkgs.openjdk # TODO: Use icedtea for darwin
else pkgs.oraclejdk;
jre = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" openjdk = if stdenv.isDarwin then openjdk-darwin else openjdk8;
then pkgs.icedtea_jre
else if stdenv.isDarwin jdk7 = icedtea7;
then pkgs.openjre # TODO: Use icedtea for darwin
else pkgs.oraclejre; jdk8 = openjdk8;
jdk = if stdenv.isDarwin then openjdk-darwin else jdk8;
oraclejdk = pkgs.jdkdistro true false; oraclejdk = pkgs.jdkdistro true false;