summary refs log tree commit diff
path: root/pkgs/applications/graphics/processing/default.nix
blob: ecce0e260bb2a20ea07d98b21a2d7e0e21ab842e (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
{ fetchurl, stdenv, ant, jre, makeWrapper, libXxf86vm, which }:

stdenv.mkDerivation rec {
  name = "processing-${version}";
  version = "2.2.1";

  src = fetchurl {
    url = "https://github.com/processing/processing/archive/processing-0227-${version}.tar.gz";
    sha256 = "1r8q5y0h4gpqap5jwkspc0li6566hzx5chr7hwrdn8mxlzsm50xk";
  };

  # Stop it trying to download its own version of java
  patches = [ ./use-nixpkgs-jre.patch ];

  buildInputs = [ ant jre makeWrapper libXxf86vm which ];

  buildPhase = "cd build && ant build";

  installPhase = ''
    mkdir -p $out/${name}
    mkdir -p $out/bin
   cp -r linux/work/* $out/${name}/
   makeWrapper $out/${name}/processing $out/bin/processing \
     --prefix PATH : "${jre}/bin:${which}/bin" \
     --prefix LD_LIBRARY_PATH : ${libXxf86vm}/lib
   makeWrapper $out/${name}/processing-java $out/bin/processing-java \
     --prefix PATH : "${jre}/bin:${which}/bin" \
     --prefix LD_LIBRARY_PATH : ${libXxf86vm}/lib
   ln -s ${jre} $out/${name}/java
  '';

  meta = with stdenv.lib; {
    description = "A language and IDE for electronic arts";
    homepage = http://processing.org;
    license = licenses.gpl2Plus;
    maintainers = [ maintainers.goibhniu ];
    platforms = platforms.linux;
  };
}