summary refs log tree commit diff
path: root/pkgs/development/compilers/openjdk/bootstrap.nix
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2015-06-06 16:14:43 -0700
committerWilliam A. Kennington III <william@wkennington.com>2015-06-07 21:02:02 -0700
commitbdcb721546f81c4b2c31eb84d94f10d91f1031ca (patch)
tree4b9005afa9430cc4b3a4c9a9bd3d1da89dd75171 /pkgs/development/compilers/openjdk/bootstrap.nix
parente0db2213fc4412176ec06a23db25dcd13cb25d21 (diff)
downloadnixpkgs-bdcb721546f81c4b2c31eb84d94f10d91f1031ca.tar
nixpkgs-bdcb721546f81c4b2c31eb84d94f10d91f1031ca.tar.gz
nixpkgs-bdcb721546f81c4b2c31eb84d94f10d91f1031ca.tar.bz2
nixpkgs-bdcb721546f81c4b2c31eb84d94f10d91f1031ca.tar.lz
nixpkgs-bdcb721546f81c4b2c31eb84d94f10d91f1031ca.tar.xz
nixpkgs-bdcb721546f81c4b2c31eb84d94f10d91f1031ca.tar.zst
nixpkgs-bdcb721546f81c4b2c31eb84d94f10d91f1031ca.zip
java: Refactor top level and build ordering
Diffstat (limited to 'pkgs/development/compilers/openjdk/bootstrap.nix')
-rw-r--r--pkgs/development/compilers/openjdk/bootstrap.nix41
1 files changed, 22 insertions, 19 deletions
diff --git a/pkgs/development/compilers/openjdk/bootstrap.nix b/pkgs/development/compilers/openjdk/bootstrap.nix
index 890064538cc..bc63292a145 100644
--- a/pkgs/development/compilers/openjdk/bootstrap.nix
+++ b/pkgs/development/compilers/openjdk/bootstrap.nix
@@ -4,30 +4,33 @@ let
   # !!! These should be on nixos.org
   src = if glibc.system == "x86_64-linux" then
     fetchurl {
-      url = http://tarballs.nixos.org/openjdk-bootstrap-x86_64-linux-2012-08-24.tar.xz;
-      sha256 = "0gla9dxrfq2w1hvgsnn8jg8a60k27im6z43a6iidi0qmwa0wah32";
+      url = http://pub.wak.io/nixos/tarballs/openjdk-bootstrap-x86_64-linux.tar.xz;
+      sha256 = "13m3df54mnr2nb67284s2zf5n8y502ck47gc39lcafrh40hzjil5";
     }
   else if glibc.system == "i686-linux" then
     fetchurl {
-      url = http://tarballs.nixos.org/openjdk-bootstrap-i686-linux-2012-08-24.tar.xz;
-      sha256 = "184wq212bycwbbq4ix8cc6jwjxkrqw9b01zb86q95kqpa8zy5206";
+      url = http://pub.wak.io/nixos/tarballs/openjdk-bootstrap-i686-linux.tar.xz;
+      sha256 = "18kzv4h9skxg5g5c7ar2ji3qny880h5svcn207b4d6xv4sa0a6ks";
     }
   else throw "No bootstrap for system";
-in
 
-runCommand "openjdk-bootstrap" {} ''
-  tar xvf ${src}
-  mv openjdk-bootstrap $out
+  bootstrap = runCommand "openjdk-bootstrap" {
+    passthru.home = "${bootstrap}/lib/openjdk";
+  } ''
+    tar xvf ${src}
+    mv openjdk-bootstrap $out
 
-  for i in $out/bin/*; do
-    patchelf --set-interpreter ${glibc}/lib/ld-linux*.so.2 $i
-  done
+    for i in $out/bin/*; do
+      patchelf --set-interpreter ${glibc}/lib/ld-linux*.so.2 $i || true
+      patchelf --set-rpath ${glibc}/lib:$out/lib $i || true
+    done
 
-  # 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/: .*$//')
-  for file in $exes; do
-    paxmark m "$file"
-    # On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well.
-    ${stdenv.lib.optionalString stdenv.isi686 ''paxmark msp "$file"''}
-  done
-''
+    # 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/: .*$//')
+    for file in $exes; do
+      paxmark m "$file"
+      # On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well.
+      ${stdenv.lib.optionalString stdenv.isi686 ''paxmark msp "$file"''}
+    done
+  '';
+in bootstrap