3
0
Fork 0
forked from mirrors/nixpkgs

* Purification of JDK 5. At runtime it now uses the Nix-deployed

Glibc and X11 client libraries.  The latter are actually optional
  dependencies: if the function is called with `swingSupport' set to
  `false', they are not needed.  This is nice for, e.g., server
  environments.

  All hail Patchelf!

svn path=/nixpkgs/trunk/; revision=4030
This commit is contained in:
Eelco Dolstra 2005-10-07 22:27:42 +00:00
parent 881f4b0db1
commit 5b63bb66f7
4 changed files with 24 additions and 8 deletions

View file

@ -30,6 +30,16 @@ do
fi
done
# Set the dynamic linker.
rpath=
for i in $libraries; do
rpath=$rpath${rpath:+:}$i/lib
done
glibc=$(cat $NIX_GCC/nix-support/orig-glibc)
find $out -type f -perm +100 \
-exec patchelf --interpreter $glibc/lib/ld-linux.so.* \
--set-rpath "$rpath" {} \;
# Unpack .pack files.
for i in $(find $out -name "*.pack"); do
echo "unpacking $i..."

View file

@ -1,9 +1,7 @@
{stdenv, fetchurl, unzip}:
args:
if stdenv.system == "i686-linux"
if args.stdenv.system == "i686-linux"
then
(import ./jdk5-sun-linux.nix) {
inherit stdenv fetchurl unzip;
}
(import ./jdk5-sun-linux.nix) args
else
false

View file

@ -8,10 +8,14 @@
*
* @author Martin Bravenboer <martin@cs.uu.nl>
*/
{stdenv, fetchurl, unzip}:
{ swingSupport ? true
, stdenv, fetchurl, unzip, patchelf, libX11 ? null, libXext ? null
}:
assert stdenv.system == "i686-linux";
assert swingSupport -> libX11 != null && libXext != null;
stdenv.mkDerivation {
name = "jdk-1.5.0";
builder = ./builder.sh;
@ -19,5 +23,7 @@ stdenv.mkDerivation {
dirname = "jdk1.5.0_05";
pathname = "/tmp/jdk-1_5_0_05-linux-i586.bin";
md5 = "2f83bf2a38fff1f8ac51b02ec7391ca3";
buildInputs = [unzip];
buildInputs = [unzip patchelf];
libraries =
(if swingSupport then [libX11 libXext] else []);
}

View file

@ -490,7 +490,7 @@ rec {
ecj = (import ../development/eclipse/ecj) {
inherit fetchurl stdenv unzip jre;
ant = apacheAntBlackdown14;
ant = apacheAntBlackdown14;
};
jdtsdk = (import ../development/eclipse/jdt-sdk) {
@ -507,6 +507,8 @@ rec {
else
(import ../development/compilers/jdk) {
inherit fetchurl stdenv unzip;
patchelf = patchelfNew;
inherit (xlibs) libX11 libXext;
};
j2sdk14x = (import ../development/compilers/jdk/default-1.4.nix) {