[Nix-dev] [PATCH 1/2] gimp git snapshot. New feature: layer groups. gimp git requires newer gtk thus using deepOverride to pass same gtk to all dependencies.

Marc Weber marco-oweber at gmx.de
Mon Jun 28 21:22:03 CEST 2010


---
 pkgs/applications/graphics/gimp/default.nix        |   54 +++++++++++++++----
 .../applications/graphics/gimp/plugins/default.nix |    2 +-
 .../development/interpreters/perl-5.10/default.nix |    2 +-
 .../interpreters/python/2.6/default.nix            |    1 +
 pkgs/development/libraries/atk/1.30.x.nix          |   33 ++++++++++++
 pkgs/development/libraries/babl/default.nix        |    6 +-
 pkgs/development/libraries/cairo/default.nix       |    1 +
 pkgs/development/libraries/freetype/default.nix    |    1 +
 pkgs/development/libraries/gegl/default.nix        |    6 +-
 pkgs/development/libraries/glib/2.24.x.nix         |   37 +++++++++++++
 pkgs/development/libraries/gtk+/2.21.x.nix         |   49 +++++++++++++++++
 pkgs/development/libraries/libjpeg/default.nix     |    2 +-
 pkgs/development/libraries/libxml2/default.nix     |    3 +-
 pkgs/development/libraries/zlib/default.nix        |    2 +-
 pkgs/development/python-modules/pygtk/default.nix  |    3 +-
 pkgs/top-level/all-packages.nix                    |   56 +++++++++++++++++---
 16 files changed, 228 insertions(+), 30 deletions(-)
 create mode 100644 pkgs/development/libraries/atk/1.30.x.nix
 create mode 100644 pkgs/development/libraries/glib/2.24.x.nix
 create mode 100644 pkgs/development/libraries/gtk+/2.21.x.nix

diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix
index e26b2b3..503c5ad 100644
--- a/pkgs/applications/graphics/gimp/default.nix
+++ b/pkgs/applications/graphics/gimp/default.nix
@@ -1,23 +1,55 @@
-{ stdenv, fetchurl, pkgconfig, gtk, freetype
+{ stdenv, fetchurl, pkgconfig, freetype
 , fontconfig, libart_lgpl, libtiff, libjpeg, libpng, libexif, zlib, perl
-, perlXMLParser, python, pygtk, gettext, xlibs, intltool, babl, gegl
+, perlXMLParser, python, pygtk, gettext, xlibs, intltool, babl, gegl, gtkLibs
+, sourceFromHead
+, autoconf, automake, libxslt, gtkdoc /* does not depend on gtk libs */, libtool, gtkLibs221
+, version ? "2.6.8"
 }:
 
+let
+
+  myGTKLibs = if version == "git" then gtkLibs221 else gtkLibs;
+
+in
+
 stdenv.mkDerivation rec {
-  name = "gimp-2.6.8";
+  name = "gimp-${version}";
   
-  src = fetchurl {
-    url = "ftp://ftp.gtk.org/pub/gimp/v2.6/${name}.tar.bz2";
-    sha256 = "0cikkb4l6psankz9yhgal934b41nwk6d5a93r9zib413fj5j3m6m";
-  };
+  src =
+    if version == "2.6.8" then
+      fetchurl {
+        url = "ftp://ftp.gtk.org/pub/gimp/v2.6/${name}.tar.bz2";
+        sha256 = "0cikkb4l6psankz9yhgal934b41nwk6d5a93r9zib413fj5j3m6m";
+      }
+    else if version == "2.7.0" then
+      fetchurl {
+        url = "ftp://ftp.gimp.org/pub/gimp/v2.7/${name}.tar.bz2";
+        md5 = "bd9fb22079a547f1f302c219b1a29fcc";
+      }
+    else if version == "git" then
+    {
+      # REGION AUTO UPDATE: { name="gimp"; type="git"; url="git://git.gnome.org/gimp"; groups = "gimp"; }
+      src = sourceFromHead "gimp-706900c4f6e9d669b7c8be2065decf49a9898620.tar.gz"
+                   (fetchurl { url = "http://mawercer.de/~nix/repos/gimp-706900c4f6e9d669b7c8be2065decf49a9898620.tar.gz"; sha256 = "0579312d484b2fc827de56cfd4e1ef7c55d7c6d3752af70fc293d37da7a96e86"; });
+      # END
+    }.src
+    else throw "no source available";
+
+  preConfigure = if version == "git" then ''
+    ./autogen.sh
+  '' else "";
   
-  buildInputs = [
-    pkgconfig gtk freetype fontconfig
+  buildInputs = map (pkg : if pkg ? deepOverride then pkg.deepOverride myGTKLibs else pkg) ([
+    pkgconfig myGTKLibs.gtk freetype fontconfig
     libart_lgpl libtiff libjpeg libpng libexif zlib perl
     perlXMLParser python pygtk gettext intltool babl gegl
-  ];
+  ]
+  ++ stdenv.lib.optionals (version == "git") [
+    autoconf automake gtkdoc
+    libxslt libtool ]
+  );
 
-  passthru = { inherit gtk; }; # probably its a good idea to use the same gtk in plugins ?
+  passthru = { inherit (myGTKLibs) gtk; gtkLibs = myGTKLibs; }; # probably its a good idea to use the same gtk in plugins ?
 
   configureFlags = [ "--disable-print" ];
 
diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix
index f988ddf..8cdda52 100644
--- a/pkgs/applications/graphics/gimp/plugins/default.nix
+++ b/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -75,7 +75,7 @@ rec {
        Filters/Generic/FFT Inverse
     */
     name = "fourier-0.3.3";
-    buildInputs = [ gimp pkgs.fftwSinglePrec  pkgconfig glib] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp pkgs.fftwSinglePrec  pkgconfig gimp.gtkLibs.glib] ++ gimp.buildNativeInputs;
     postInstall = "fail";
     installPhase = "installPlugins fourier";
     src = fetchurl {
diff --git a/pkgs/development/interpreters/perl-5.10/default.nix b/pkgs/development/interpreters/perl-5.10/default.nix
index 3116829..af5c7fb 100644
--- a/pkgs/development/interpreters/perl-5.10/default.nix
+++ b/pkgs/development/interpreters/perl-5.10/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, ... }:
 
 let 
   
diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix
index 8865738..3b94d0f 100644
--- a/pkgs/development/interpreters/python/2.6/default.nix
+++ b/pkgs/development/interpreters/python/2.6/default.nix
@@ -11,6 +11,7 @@
 , arch ? null
 , sw_vers ? null
 , ncurses ? null
+, ...
 }:
 
 assert zlibSupport -> zlib != null;
diff --git a/pkgs/development/libraries/atk/1.30.x.nix b/pkgs/development/libraries/atk/1.30.x.nix
new file mode 100644
index 0000000..e46a6ee
--- /dev/null
+++ b/pkgs/development/libraries/atk/1.30.x.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, pkgconfig, perl, glib }:
+
+stdenv.mkDerivation rec {
+  name = "atk-1.30.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/atk/1.30/${name}.tar.bz2";
+    sha256 = "1316ih5jgi9xv0fn67vvglij6r62d2wp6ql0qglqzimg7hhv3fcj";
+  };
+
+  buildInputs = [pkgconfig perl];
+  propagatedBuildInputs = [glib];
+
+  meta = {
+    description = "ATK, the accessibility toolkit";
+
+    longDescription = ''
+      ATK is the Accessibility Toolkit.  It provides a set of generic
+      interfaces allowing accessibility technologies such as screen
+      readers to interact with a graphical user interface.  Using the
+      ATK interfaces, accessibility tools have full access to view and
+      control running applications.
+    '';
+
+    homepage = http://library.gnome.org/devel/atk/;
+
+    license = "LGPLv2+";
+
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+
+}
diff --git a/pkgs/development/libraries/babl/default.nix b/pkgs/development/libraries/babl/default.nix
index d00e3f6..30198af 100644
--- a/pkgs/development/libraries/babl/default.nix
+++ b/pkgs/development/libraries/babl/default.nix
@@ -1,10 +1,10 @@
 args:
 args.stdenv.mkDerivation {
-  name = "babl-0.0.22";
+  name = "babl-0.1.2";
 
   src = args.fetchurl {
-    url = ftp://ftp.gtk.org/pub/babl/0.0/babl-0.0.22.tar.bz2;
-    sha256 = "0v8gbf9si4sd06199f8lfmrsbvi6i0hxphd34kyvsj6g2kkkg10s";
+    url = ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.2.tar.bz2;
+    sha256 = "1de1394f3d49313bd99f2eab5ae7a4ddfd66d27cdaa89aede67b0dd96f43b722";
   };
 
   buildInputs =(with args; []);
diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix
index dc8bb2a..a14b7fd 100644
--- a/pkgs/development/libraries/cairo/default.nix
+++ b/pkgs/development/libraries/cairo/default.nix
@@ -4,6 +4,7 @@
 , xcbSupport ? false
 , stdenv, fetchurl, pkgconfig, x11, fontconfig, freetype
 , zlib, libpng, pixman, libxcb ? null, xcbutil ? null
+, ...
 }:
 
 assert postscriptSupport -> zlib != null;
diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix
index d3814bd..20b5bfc 100644
--- a/pkgs/development/libraries/freetype/default.nix
+++ b/pkgs/development/libraries/freetype/default.nix
@@ -5,6 +5,7 @@
   # option allows them to be enabled.  See
   # http://www.freetype.org/patents.html.
   useEncumberedCode ? false
+, ...
 }:
 
 stdenv.mkDerivation (rec {
diff --git a/pkgs/development/libraries/gegl/default.nix b/pkgs/development/libraries/gegl/default.nix
index 5089316..87cc279 100644
--- a/pkgs/development/libraries/gegl/default.nix
+++ b/pkgs/development/libraries/gegl/default.nix
@@ -1,10 +1,10 @@
 args:
 args.stdenv.mkDerivation {
-  name = "gegl-0.0.22";
+  name = "gegl-0.1.2";
 
   src = args.fetchurl {
-    url = ftp://ftp.gimp.org/pub/gegl/0.0/gegl-0.0.22.tar.bz2;
-    sha256 = "0nx6r9amzhw5d2ghlw3z8qnry18rwz1ymvl2cm31b8p49z436wl5";
+    url = ftp://ftp.gimp.org/pub/gegl/0.1/gegl-0.1.2.tar.bz2;
+    sha256 = "04z130hwl09jq06a602a7j70c8mppk81kclncms4lkqc8sdn2kmn";
   };
 
   configureFlags = "--disable-docs"; # needs fonts otherwise  don't know how to pass them
diff --git a/pkgs/development/libraries/glib/2.24.x.nix b/pkgs/development/libraries/glib/2.24.x.nix
new file mode 100644
index 0000000..c31b8f1
--- /dev/null
+++ b/pkgs/development/libraries/glib/2.24.x.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, pkgconfig, gettext, perl, zlib, libiconv ? null}:
+
+stdenv.mkDerivation rec {
+  name = "glib-2.24.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/glib/2.24/${name}.tar.bz2";
+    sha256 = "013dxb91b3v5xb75224rvc0nbwq5bx4icp07f5ri25xzc2lksk01";
+  };
+
+  buildInputs = [pkgconfig gettext perl libiconv];
+
+  propagatedBuildInputs = [zlib];
+
+  # The nbd package depends on a static version of this library; hence
+  # the default configure flag --disable-static is switched off.
+  dontDisableStatic = true;
+  configureFlags = "--enable-static --enable-shared";
+
+  meta = {
+    description = "GLib, a C library of programming buildings blocks";
+
+    longDescription = ''
+      GLib provides the core application building blocks for libraries
+      and applications written in C.  It provides the core object
+      system used in GNOME, the main loop implementation, and a large
+      set of utility functions for strings and common data structures.
+    '';
+
+    homepage = http://www.gtk.org/;
+
+    license = "LGPLv2+";
+
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gtk+/2.21.x.nix b/pkgs/development/libraries/gtk+/2.21.x.nix
new file mode 100644
index 0000000..d0151a7
--- /dev/null
+++ b/pkgs/development/libraries/gtk+/2.21.x.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, pkgconfig, glib, atk, pango, libtiff, libjpeg
+, libpng, cairo, perl, jasper, xlibs
+, xineramaSupport ? true
+, cupsSupport ? true, cups ? null
+}:
+
+assert xineramaSupport -> xlibs.libXinerama != null;
+assert cupsSupport -> cups != null;
+
+stdenv.mkDerivation rec {
+  name = "gtk+-2.21.1";
+  
+  src = fetchurl {
+    url = "mirror://gnome/sources/gtk+/2.21/${name}.tar.bz2";
+    sha256 = "1mvdjib29rga6f1j2ci076iqiaxmhd91mrd8v773yz0ahaxinqpm";
+  };
+  
+  buildNativeInputs = [ perl ];
+  buildInputs = [ pkgconfig jasper ];
+  
+  propagatedBuildInputs =
+    [ xlibs.xlibs glib atk pango libtiff libjpeg libpng cairo xlibs.libXrandr ]
+    ++ stdenv.lib.optional xineramaSupport xlibs.libXinerama
+    ++ stdenv.lib.optionals cupsSupport [ cups ];
+
+  passthru = { inherit libtiff libjpeg libpng; };
+
+  meta = {
+    description = "A multi-platform toolkit for creating graphical user interfaces";
+
+    longDescription = ''
+      GTK+ is a highly usable, feature rich toolkit for creating
+      graphical user interfaces which boasts cross platform
+      compatibility and an easy to use API.  GTK+ it is written in C,
+      but has bindings to many other popular programming languages
+      such as C++, Python and C# among others.  GTK+ is licensed
+      under the GNU LGPL 2.1 allowing development of both free and
+      proprietary software with GTK+ without any license fees or
+      royalties.
+    '';
+
+    homepage = http://www.gtk.org/;
+
+    license = "LGPLv2+";
+
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/libjpeg/default.nix b/pkgs/development/libraries/libjpeg/default.nix
index bc3245c..3e6434b 100644
--- a/pkgs/development/libraries/libjpeg/default.nix
+++ b/pkgs/development/libraries/libjpeg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }: 
+{ stdenv, fetchurl, ... }:
 
 stdenv.mkDerivation {
   name = "libjpeg-8";
diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix
index f3c9c6c..701706b 100644
--- a/pkgs/development/libraries/libxml2/default.nix
+++ b/pkgs/development/libraries/libxml2/default.nix
@@ -1,4 +1,5 @@
-{stdenv, fetchurl, zlib, python ? null, pythonSupport ? true}:
+{stdenv, fetchurl, zlib, python ? null, pythonSupport ? true
+, ...}:
 
 assert pythonSupport -> python != null;
 
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index 95c891e..94a425a 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, static ? false}:
+{stdenv, fetchurl, static ? false, ...}:
 
 stdenv.mkDerivation {
   name = "zlib-1.2.3";
diff --git a/pkgs/development/python-modules/pygtk/default.nix b/pkgs/development/python-modules/pygtk/default.nix
index 3dc37eb..ac893f1 100644
--- a/pkgs/development/python-modules/pygtk/default.nix
+++ b/pkgs/development/python-modules/pygtk/default.nix
@@ -1,5 +1,6 @@
 {stdenv, fetchurl, python, pkgconfig, glib, gtk, pygobject, pycairo
-  , libglade ? null}:
+  , libglade ? null
+  , ...}:
 
 stdenv.mkDerivation {
   name = "pygtk-2.16.0";
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 4fc9fa2..8500910 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3851,7 +3851,7 @@ let
     inherit (gtkLibs1x) gtk;
   };
 
-  gegl = import ../development/libraries/gegl {
+  gegl = makeOverridable (import ../development/libraries/gegl) {
     inherit fetchurl stdenv libpng pkgconfig babl;
     openexr = openexr_1_6_1;
     #  avocodec avformat librsvg
@@ -4186,6 +4186,41 @@ let
 
   };
 
+
+  gtkLibs221 = rec {
+
+    glib = import ../development/libraries/glib/2.24.x.nix {
+      inherit fetchurl stdenv pkgconfig gettext perl zlib;
+      libiconv = if (stdenv.system == "i686-freebsd") then libiconv else null;
+    };
+
+    glibmm = import ../development/libraries/glibmm/2.22.x.nix {
+      inherit fetchurl stdenv pkgconfig glib libsigcxx;
+    };
+
+    atk = import ../development/libraries/atk/1.30.x.nix {
+      inherit fetchurl stdenv pkgconfig perl glib;
+    };
+
+    pango = import ../development/libraries/pango/1.26.x.nix {
+      inherit fetchurl stdenv pkgconfig gettext x11 glib cairo libpng;
+    };
+
+    pangomm = import ../development/libraries/pangomm/2.26.x.nix {
+      inherit fetchurl stdenv pkgconfig pango glibmm cairomm libpng;
+    };
+
+    gtk = import ../development/libraries/gtk+/2.21.x.nix {
+      inherit fetchurl stdenv pkgconfig perl jasper glib atk pango
+        libtiff libjpeg libpng cairo xlibs cups;
+    };
+
+    gtkmm = import ../development/libraries/gtkmm/2.18.x.nix {
+      inherit fetchurl stdenv pkgconfig gtk atk glibmm cairomm pangomm;
+    };
+
+  };
+
   gtkmozembedsharp = import ../development/libraries/gtkmozembed-sharp {
     inherit fetchurl stdenv mono pkgconfig monoDLLFixer;
     inherit (gnome) gtk;
@@ -5638,7 +5673,7 @@ let
     inherit fetchurl stdenv python pkgconfig glib;
   };
 
-  pygtk = import ../development/python-modules/pygtk {
+  pygtk = makeOverridable (import ../development/python-modules/pygtk) {
     inherit fetchurl stdenv python pkgconfig pygobject pycairo;
     inherit (gtkLibs) glib gtk;
   };
@@ -7820,16 +7855,23 @@ let
     gtksharp = gtksharp1;
   };
 
-  gimp = import ../applications/graphics/gimp {
+  gimp = makeOverridable (import ../applications/graphics/gimp) {
     inherit fetchurl stdenv pkgconfig freetype fontconfig
       libtiff libjpeg libpng libexif zlib perl perlXMLParser
-      python pygtk gettext xlibs intltool babl gegl;
-    inherit (gnome) gtk libart_lgpl;
+      python pygtk gettext xlibs intltool babl gegl gtkLibs;
+    inherit (gnome) libart_lgpl;
+
+      # git or snapshot version dependencies:
+    inherit gtkLibs221;
+    inherit autoconf automake sourceFromHead libxslt libtool; 
+    inherit (gnome) gtkdoc;
   };
+  gimpSnapshot = gimp.override { version = "2.7.0"; };
+  gimpGit = gimp.override { version = "git"; };
 
-  gimpPlugins = recurseIntoAttrs (import ../applications/graphics/gimp/plugins {
+  gimpPlugins = makeOverridable (import ../applications/graphics/gimp/plugins) {
     inherit pkgs gimp;
-  });
+  };
 
   gitAndTools = recurseIntoAttrs (import ../applications/version-management/git-and-tools {
     inherit pkgs;
-- 
1.7.1




More information about the nix-dev mailing list