diff --git a/pkgs/development/interpreters/jre/builder.sh b/pkgs/development/interpreters/jre/builder.sh index 8ddd87622653..91ef8ca2fc1f 100644 --- a/pkgs/development/interpreters/jre/builder.sh +++ b/pkgs/development/interpreters/jre/builder.sh @@ -1,19 +1,11 @@ -#! /bin/sh +source $stdenv/setup -source $stdenv/setup || exit 1 +unzip $src || true -cp $src $version.bin || exit 1 -chmod u+x $version.bin || exit 1 - -alias more=cat - -echo "Unpacking J2RE" -yes yes | ./$version.bin || exit 1 - -mkdir $out || exit 1 +ensureDir $out echo "Moving sources to the right location" -mv $version/* $out/ || exit 1 +mv $version/* $out/ echo "Removing files at top level" for file in $out/* @@ -23,3 +15,19 @@ do fi done rm -rf $out/docs + +# Set the dynamic linker. +rpath= +for i in $libraries; do + rpath=$rpath${rpath:+:}$i/lib +done +find $out -type f -perm +100 \ + -exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ + --set-rpath "$rpath" {} \; + +# Unpack .pack files. +for i in $(find $out -name "*.pack"); do + echo "unpacking $i..." + $out/bin/unpack200 "$i" "$(dirname $i)/$(basename $i .pack).jar" + rm "$i" +done diff --git a/pkgs/development/interpreters/jre/default.nix b/pkgs/development/interpreters/jre/default.nix index fd81dd18ceea..6e694202fd70 100644 --- a/pkgs/development/interpreters/jre/default.nix +++ b/pkgs/development/interpreters/jre/default.nix @@ -1,9 +1,9 @@ -{stdenv, fetchurl}: +{stdenv, fetchurl, unzip}: if stdenv.system == "i686-linux" then (import ./jre-sun-linux.nix) { - inherit stdenv fetchurl; + inherit stdenv fetchurl unzip; } else false diff --git a/pkgs/development/interpreters/jre/jre-sun-linux.nix b/pkgs/development/interpreters/jre/jre-sun-linux.nix index 833d30cde6c2..274d737e2e2e 100644 --- a/pkgs/development/interpreters/jre/jre-sun-linux.nix +++ b/pkgs/development/interpreters/jre/jre-sun-linux.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl}: +{stdenv, fetchurl, unzip}: assert stdenv.system == "i686-linux"; @@ -10,6 +10,7 @@ assert stdenv.system == "i686-linux"; url = http://jdl.sun.com/webapps/download/AutoDL?BundleId=10542; md5 = "e2ad1c9e47f3e34d1efae059b9e2a2d9"; }; + buildInputs = [unzip]; }) // {mozillaPlugin = "/plugin/i386/ns7";} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 851875f407a9..d3b13ef9ad3c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -865,7 +865,7 @@ rec { }; jre = import ../development/interpreters/jre { - inherit fetchurl stdenv; + inherit fetchurl stdenv unzip; }; kaffe = import ../development/interpreters/kaffe {