Use requireFile for the form-hidden download of JDK 5 (or 1.5, who cares)
svn path=/nixpkgs/trunk/; revision=24972
This commit is contained in:
parent
44ac8c5ea1
commit
c9c133ab11
@ -1,25 +1,7 @@
|
|||||||
buildInputs="$unzip"
|
buildInputs="$unzip"
|
||||||
source $stdenv/setup
|
source $stdenv/setup
|
||||||
|
|
||||||
src=$filename.bin
|
unzip $src || true
|
||||||
|
|
||||||
if ! test -e "$pathname"; then
|
|
||||||
echo ""
|
|
||||||
echo "SORRY!"
|
|
||||||
echo "You should download \`$(basename $pathname)' from Sun and place it in $(dirname $pathname)."
|
|
||||||
echo "Blame Sun, not us."
|
|
||||||
echo "If you are doing a chroot build - try a non-chroot build, because we need to access /tmp."
|
|
||||||
echo ""
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
actual=$(md5sum -b $pathname | cut -c1-32)
|
|
||||||
if test "$actual" != "$md5"; then
|
|
||||||
echo "hash is $actual, expected $md5"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
unzip $pathname || true
|
|
||||||
|
|
||||||
ensureDir $out
|
ensureDir $out
|
||||||
mv $dirname/* $out/
|
mv $dirname/* $out/
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{stdenv, fetchurl, unzip}:
|
{stdenv, fetchurl, unzip, requireFile}:
|
||||||
|
|
||||||
if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
|
if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
|
||||||
then
|
then
|
||||||
(import ./jdk5-oracle-linux.nix) {
|
(import ./jdk5-oracle-linux.nix) {
|
||||||
inherit stdenv fetchurl unzip;
|
inherit stdenv fetchurl unzip requireFile;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
abort "the Java 5 SDK is not supported on this platform"
|
abort "the Java 5 SDK is not supported on this platform"
|
||||||
|
@ -8,19 +8,29 @@
|
|||||||
* Note that this is not necessary if someone has already pushed a
|
* Note that this is not necessary if someone has already pushed a
|
||||||
* binary.
|
* binary.
|
||||||
*/
|
*/
|
||||||
{stdenv, fetchurl, unzip}:
|
{stdenv, fetchurl, unzip, requireFile}:
|
||||||
|
|
||||||
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
||||||
|
|
||||||
let name = "jdk-1_5_0_22"; in
|
stdenv.mkDerivation rec {
|
||||||
stdenv.mkDerivation {
|
name = "jdk-1_5_0_22";
|
||||||
inherit name;
|
|
||||||
filename = "jdk-1_5_0_22";
|
|
||||||
dirname = "jdk1.5.0_22";
|
dirname = "jdk1.5.0_22";
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
pathname = if stdenv.system == "x86_64-linux" then "/tmp/${name}-linux-amd64.bin" else "/tmp/${name}-linux-i586.bin";
|
src = requireFile {
|
||||||
md5 = if stdenv.system == "x86_64-linux" then "b62abcaf9ea8617c50fa213bbc88824a" else "df5dae6d50d2abeafb472dde6d9a17f3";
|
message = ''
|
||||||
|
SORRY!
|
||||||
|
We may not download the needed binary distribution automatically.
|
||||||
|
You should download ${distfilename} from Sun and add it to store.
|
||||||
|
For example, "nix-prefetch-url file:///\$PWD/${distfilename}" in the
|
||||||
|
directory where you saved it is OK.
|
||||||
|
Blame Sun, not us.
|
||||||
|
'';
|
||||||
|
name = distfilename;
|
||||||
|
sha256 = if stdenv.system == "x86_64-linux" then
|
||||||
|
"1h63gigvg8id95igcj8xw7qvxs4p2y9hvx4xbvkwg8bji3ifb0sk"
|
||||||
|
else "0655n2q1y023zzwbk6gs9vwsnb29jc0m3bg3x3xdw623qgb4k6px";
|
||||||
|
};
|
||||||
|
distfilename = if stdenv.system == "x86_64-linux" then "${name}-linux-amd64.bin" else "${name}-linux-i586.bin";
|
||||||
|
|
||||||
stdenv = stdenv;
|
inherit unzip stdenv;
|
||||||
inherit unzip;
|
|
||||||
}
|
}
|
||||||
|
@ -1927,9 +1927,7 @@ let
|
|||||||
|
|
||||||
jdk5 = (
|
jdk5 = (
|
||||||
assert system == "i686-linux" || system == "x86_64-linux";
|
assert system == "i686-linux" || system == "x86_64-linux";
|
||||||
import ../development/compilers/jdk/default-5.nix {
|
callPackage ../development/compilers/jdk/default-5.nix { });
|
||||||
inherit fetchurl stdenv unzip;
|
|
||||||
});
|
|
||||||
|
|
||||||
jdk = if stdenv.isDarwin then openjdkDarwin else jdkdistro true false;
|
jdk = if stdenv.isDarwin then openjdkDarwin else jdkdistro true false;
|
||||||
jre = jdkdistro false false;
|
jre = jdkdistro false false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user