opendjk: Make boostraps for each major version and update openjdk7
This commit is contained in:
@@ -1,17 +1,34 @@
|
||||
{ stdenv, runCommand, glibc, fetchurl, file }:
|
||||
{ stdenv, runCommand, glibc, fetchurl, file
|
||||
|
||||
, version
|
||||
}:
|
||||
|
||||
let
|
||||
# !!! These should be on nixos.org
|
||||
src = if glibc.system == "x86_64-linux" then
|
||||
fetchurl {
|
||||
url = http://pub.wak.io/nixos/tarballs/openjdk-bootstrap-x86_64-linux.tar.xz;
|
||||
sha256 = "13m3df54mnr2nb67284s2zf5n8y502ck47gc39lcafrh40hzjil5";
|
||||
}
|
||||
(if version == "8" then
|
||||
fetchurl {
|
||||
url = "https://www.dropbox.com/s/a0lsq2ig4uguky5/openjdk8-bootstrap-x86_64-linux.tar.xz?dl=1";
|
||||
sha256 = "18zqx6jhm3lizn9hh6ryyqc9dz3i96pwaz8f6nxfllk70qi5gvks";
|
||||
}
|
||||
else if version == "7" then
|
||||
fetchurl {
|
||||
url = "https://www.dropbox.com/s/rssfbeommrfbsjf/openjdk7-bootstrap-x86_64-linux.tar.xz?dl=1";
|
||||
sha256 = "024gg2sgg4labxbc1nhn8lxls2p7d9h3b82hnsahwaja2pm1hbra";
|
||||
}
|
||||
else throw "No bootstrap for version")
|
||||
else if glibc.system == "i686-linux" then
|
||||
fetchurl {
|
||||
url = http://pub.wak.io/nixos/tarballs/openjdk-bootstrap-i686-linux.tar.xz;
|
||||
sha256 = "18kzv4h9skxg5g5c7ar2ji3qny880h5svcn207b4d6xv4sa0a6ks";
|
||||
}
|
||||
(if version == "8" then
|
||||
fetchurl {
|
||||
url = "https://www.dropbox.com/s/rneqjhlerijsw74/openjdk8-bootstrap-i686-linux.tar.xz?dl=1";
|
||||
sha256 = "1yx04xh8bqz7amg12d13rw5vwa008rav59mxjw1b9s6ynkvfgqq9";
|
||||
}
|
||||
else if version == "7" then
|
||||
fetchurl {
|
||||
url = "https://www.dropbox.com/s/6xe64td7eg2wurs/openjdk7-bootstrap-i686-linux.tar.xz?dl=1";
|
||||
sha256 = "0xwqjk1zx8akziw8q9sbjc1rs8s7c0w6mw67jdmmi26cwwp8ijnx";
|
||||
}
|
||||
else throw "No bootstrap for version")
|
||||
else throw "No bootstrap for system";
|
||||
|
||||
bootstrap = runCommand "openjdk-bootstrap" {
|
||||
@@ -20,9 +37,16 @@ let
|
||||
tar xvf ${src}
|
||||
mv openjdk-bootstrap $out
|
||||
|
||||
LIBDIRS="$(find $out -name \*.so\* -exec dirname {} \; | sort | uniq | tr '\n' ':')"
|
||||
|
||||
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
|
||||
patchelf --set-rpath "${glibc}/lib:$LIBDIRS" $i || true
|
||||
done
|
||||
|
||||
find $out -name \*.so\* | while read lib; do
|
||||
patchelf --set-interpreter ${glibc}/lib/ld-linux*.so.2 $lib || true
|
||||
patchelf --set-rpath "${glibc}/lib:${stdenv.cc.cc}/lib:$LIBDIRS" $lib || true
|
||||
done
|
||||
|
||||
# Temporarily, while NixOS's OpenJDK bootstrap tarball doesn't have PaX markings:
|
||||
|
||||
Reference in New Issue
Block a user