about summary refs log tree commit diff
path: root/pkgs/development/libraries/java/icedtea/default.nix
blob: bdaa32a78d2c63a825eb0351a66b6c2f5f8d1eec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* XXX: This is work in progress and it needs your help!  */

/* See http://icedtea.classpath.org/wiki/BuildRequirements for a
   list of dependencies.  */

{ fetchurl, stdenv, which
, wget, cpio, file, ecj, gcj, ant, gawk, procps, inetutils, zip, unzip, zlib
, alsaLib, cups, lesstif, freetype, classpath, libjpeg, libpng, giflib
, xalanj, xerces, rhino
, libX11, libXp, libXtst, libXinerama, libXt, libXrender, xproto
, pkgconfig, xulrunner, pulseaudio }:

let
  # These variables must match those in the top-level `Makefile.am'.
  openjdkVersion   = "b16";
  openjdkDate      = "24_apr_2009";
  openjdkURL       =
    "http://download.java.net/openjdk/jdk6/promoted/${openjdkVersion}/";
  openjdkSourceZip = "openjdk-6-src-${openjdkVersion}-${openjdkDate}.tar.gz";

  openjdk          = fetchurl {
    url = "${openjdkURL}${openjdkSourceZip}";
    sha256 = "084lkhsnj29finb6pmvrh83nqbliwv32gdi5q5sv43dpv24r85cn";
  };

  hotspot          = fetchurl {
    url = "http://hg.openjdk.java.net/hsx/hsx14/master/archive/09f7962b8b44.tar.gz";
    sha256 = "1jbd9ki5ip96293mv1qil20yqcgvkmcrhs302j0n8i8f3v1j70bf";
  };

in

stdenv.mkDerivation rec {
  name = "icedtea6-1.6.1";

  src = fetchurl {
    url = "http://icedtea.classpath.org/download/source/${name}.tar.gz";
    sha256 = "11vaanfmz842x576wrw5qldpkksi8wqjmh9wikn5gxyjk87qq3k5";
  };

  buildInputs = [
    wget  # Not actually used, thanks to `--with-openjdk-src-zip' et al.
    which cpio file ecj gcj ant gawk procps inetutils zip unzip zlib
    alsaLib cups lesstif freetype classpath libjpeg libpng giflib
    xalanj xerces
    libX11 libXp libXtst libXinerama libXt libXrender xproto
    pkgconfig /* xulrunner */ pulseaudio
  ];

  preConfigure =
    '' # Use the Sun-compatible tools (`jar', etc.).
       export PATH="${gcj.gcc}/lib/jvm/bin:$PATH"

       # Copy patches.
       cp -v "${./nixos-slash-bin.patch}" patches/nixos-slash-bin.patch
    '';

  configureFlags =
    stdenv.lib.concatStringsSep " "
      [ "--with-gcj-home=${gcj}"
        "--with-ecj" "--with-ecj-jar=${ecj}/lib/java/ecj.jar"
        "--with-openjdk-src-zip=${openjdk}"
        "--with-hotspot-src-zip=${hotspot}"
        "--with-ant-home=${ant}/lib/java"
        "--with-xalan2-jar=${xalanj}/lib/java/xalan.jar"
        "--with-xalan2-serializer-jar=${xalanj}/lib/java/xalan.jar"
        "--with-xerces2-jar=${xerces}/lib/java/xercesImpl.jar"
        "--with-rhino=${rhino}/lib/java/js.jar"
        "--disable-plugin" # FIXME: Enable it someday.

        "--with-parallel-job"
      ];

  makeFlags =
    [ # Have OpenCDK use tools from $PATH.
      "ALT_UNIXCCS_PATH=" "ALT_UNIXCOMMAND_PATH=" "ALT_USRBIN_PATH="
      "ALT_COMPILER_PATH=" "ALT_DEVTOOLS_PATH="

      # Libraries.
      "ALT_MOTIF_DIR="
      "ALT_FREETYPE_HEADERS_PATH=${freetype}/include"
      "ALT_FREETYPE_LIB_PATH=${freetype}/lib"
      "ALT_CUPS_HEADERS_PATH=${cups}/include"
      "ALT_CUPS_LIB_PATH=${cups}/lib"

      # Tell IcedTea about our patches.
      "DISTRIBUTION_PATCHES=patches/nixos-slash-bin.patch"
    ];

  meta = {
    description = "IcedTea, a libre Java development kit based on OpenJDK";

    longDescription =
      '' The IcedTea project provides a harness to build the source code from
         http://openjdk.java.net using Free Software build tools and adds a
         number of key features to the upstream OpenJDK codebase: a Free
         64-bit plugin with LiveConnect and Java Web Start support, support
         for additional platforms via a pure interpreted mode in HotSpot
         (Zero) or the alternative CACAO virtual machine.  Experimental JIT
         support for Zero is also available via Shark.
      '';

    license = "GPLv2"; /* and multiple-licensing, e.g., for the plug-ins */

    homepage = http://icedtea.classpath.org/;

    maintainers = [ stdenv.lib.maintainers.ludo ];

    # Restrict to GNU systems for now.
    platforms = stdenv.lib.platforms.gnu;
  };
}