mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 15:58:36 +00:00
* 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:
parent
881f4b0db1
commit
5b63bb66f7
|
@ -30,6 +30,16 @@ do
|
||||||
fi
|
fi
|
||||||
done
|
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.
|
# Unpack .pack files.
|
||||||
for i in $(find $out -name "*.pack"); do
|
for i in $(find $out -name "*.pack"); do
|
||||||
echo "unpacking $i..."
|
echo "unpacking $i..."
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
{stdenv, fetchurl, unzip}:
|
args:
|
||||||
|
|
||||||
if stdenv.system == "i686-linux"
|
if args.stdenv.system == "i686-linux"
|
||||||
then
|
then
|
||||||
(import ./jdk5-sun-linux.nix) {
|
(import ./jdk5-sun-linux.nix) args
|
||||||
inherit stdenv fetchurl unzip;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
|
|
|
@ -8,10 +8,14 @@
|
||||||
*
|
*
|
||||||
* @author Martin Bravenboer <martin@cs.uu.nl>
|
* @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 stdenv.system == "i686-linux";
|
||||||
|
|
||||||
|
assert swingSupport -> libX11 != null && libXext != null;
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "jdk-1.5.0";
|
name = "jdk-1.5.0";
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
|
@ -19,5 +23,7 @@ stdenv.mkDerivation {
|
||||||
dirname = "jdk1.5.0_05";
|
dirname = "jdk1.5.0_05";
|
||||||
pathname = "/tmp/jdk-1_5_0_05-linux-i586.bin";
|
pathname = "/tmp/jdk-1_5_0_05-linux-i586.bin";
|
||||||
md5 = "2f83bf2a38fff1f8ac51b02ec7391ca3";
|
md5 = "2f83bf2a38fff1f8ac51b02ec7391ca3";
|
||||||
buildInputs = [unzip];
|
buildInputs = [unzip patchelf];
|
||||||
|
libraries =
|
||||||
|
(if swingSupport then [libX11 libXext] else []);
|
||||||
}
|
}
|
||||||
|
|
|
@ -490,7 +490,7 @@ rec {
|
||||||
|
|
||||||
ecj = (import ../development/eclipse/ecj) {
|
ecj = (import ../development/eclipse/ecj) {
|
||||||
inherit fetchurl stdenv unzip jre;
|
inherit fetchurl stdenv unzip jre;
|
||||||
ant = apacheAntBlackdown14;
|
ant = apacheAntBlackdown14;
|
||||||
};
|
};
|
||||||
|
|
||||||
jdtsdk = (import ../development/eclipse/jdt-sdk) {
|
jdtsdk = (import ../development/eclipse/jdt-sdk) {
|
||||||
|
@ -507,6 +507,8 @@ rec {
|
||||||
else
|
else
|
||||||
(import ../development/compilers/jdk) {
|
(import ../development/compilers/jdk) {
|
||||||
inherit fetchurl stdenv unzip;
|
inherit fetchurl stdenv unzip;
|
||||||
|
patchelf = patchelfNew;
|
||||||
|
inherit (xlibs) libX11 libXext;
|
||||||
};
|
};
|
||||||
|
|
||||||
j2sdk14x = (import ../development/compilers/jdk/default-1.4.nix) {
|
j2sdk14x = (import ../development/compilers/jdk/default-1.4.nix) {
|
||||||
|
|
Loading…
Reference in a new issue