about summary refs log tree commit diff
path: root/pkgs/applications/graphics/gimp/2.8.nix
blob: 47004a025009e4a7b0e489293e55cf746378890d (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
{ stdenv, fetchurl, pkgconfig, intltool, babl, gegl, gtk2, glib, gdk_pixbuf
, pango, cairo, freetype, fontconfig, lcms, libpng, libjpeg, poppler, libtiff
, webkit, libmng, librsvg, libwmf, zlib, libzip, ghostscript, aalib, jasper
, python2Packages, libart_lgpl, libexif, gettext, xorg
, AppKit, Cocoa, gtk-mac-integration }:

let
  inherit (python2Packages) pygtk wrapPython python;
in stdenv.mkDerivation rec {
  name = "gimp-${version}";
  version = "2.8.22";

  # This declarations for `gimp-with-plugins` wrapper,
  # (used for determining $out/lib/gimp/${majorVersion}/ paths)
  majorVersion = "2.0";
  targetPluginDir = "$out/lib/gimp/${majorVersion}/plug-ins";
  targetScriptDir = "$out/lib/gimp/${majorVersion}/scripts";

  src = fetchurl {
    url = "http://download.gimp.org/pub/gimp/v2.8/${name}.tar.bz2";
    sha256 = "12k3lp938qdc9cqj29scg55f3bb8iav2fysd29w0s49bqmfa71wi";
  };

  buildInputs =
    [ pkgconfig intltool babl gegl gtk2 glib gdk_pixbuf pango cairo
      freetype fontconfig lcms libpng libjpeg poppler libtiff webkit
      libmng librsvg libwmf zlib libzip ghostscript aalib jasper
      python pygtk libart_lgpl libexif gettext xorg.libXpm
      wrapPython
    ]
    ++ stdenv.lib.optionals stdenv.isDarwin [ AppKit Cocoa gtk-mac-integration ];

  pythonPath = [ pygtk ];

  postFixup = ''
    wrapPythonProgramsIn $out/lib/gimp/2.0/plug-ins/
    wrapProgram $out/bin/gimp \
      --prefix PYTHONPATH : "$PYTHONPATH" \
      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
  '';

  passthru = { gtk = gtk2; }; # probably its a good idea to use the same gtk in plugins ?

  #configureFlags = [ "--disable-print" ];

  enableParallelBuilding = true;

  # "screenshot" needs this.
  NIX_LDFLAGS = "-rpath ${xorg.libX11.out}/lib"
    + stdenv.lib.optionalString stdenv.isDarwin " -lintl";

  meta = {
    description = "The GNU Image Manipulation Program";
    homepage = http://www.gimp.org/;
    license = stdenv.lib.licenses.gpl3Plus;
    platforms = stdenv.lib.platforms.unix;
  };
}