about summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-10-03 13:33:13 +0200
committerVladimír Čunát <vcunat@gmail.com>2015-10-03 13:33:37 +0200
commit5227fb1dd53fcb5918b9342dff4868f4ad68427e (patch)
treed6cd521e3f67944031216a27f740f28f22b73b41 /pkgs/applications/graphics
parentd6dd3b8bd1eaeeb21dfdb5051cd4732c748ce5d7 (diff)
parent33373d939a19f465228ddede6d38ce9032b5916b (diff)
downloadnixlib-5227fb1dd53fcb5918b9342dff4868f4ad68427e.tar
nixlib-5227fb1dd53fcb5918b9342dff4868f4ad68427e.tar.gz
nixlib-5227fb1dd53fcb5918b9342dff4868f4ad68427e.tar.bz2
nixlib-5227fb1dd53fcb5918b9342dff4868f4ad68427e.tar.lz
nixlib-5227fb1dd53fcb5918b9342dff4868f4ad68427e.tar.xz
nixlib-5227fb1dd53fcb5918b9342dff4868f4ad68427e.tar.zst
nixlib-5227fb1dd53fcb5918b9342dff4868f4ad68427e.zip
Merge commit staging+systemd into closure-size
Many non-conflict problems weren't (fully) resolved in this commit yet.
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/ImageMagick/default.nix106
-rw-r--r--pkgs/applications/graphics/antimony/default.nix41
-rw-r--r--pkgs/applications/graphics/antimony/paths-fix.patch99
-rw-r--r--pkgs/applications/graphics/apitrace/default.nix12
-rw-r--r--pkgs/applications/graphics/darktable/default.nix4
-rw-r--r--pkgs/applications/graphics/digikam/2.nix32
-rw-r--r--pkgs/applications/graphics/digikam/default.nix22
-rw-r--r--pkgs/applications/graphics/djview/default.nix34
-rw-r--r--pkgs/applications/graphics/djview/djview4-qt-4.8.patch38
-rw-r--r--pkgs/applications/graphics/fbida/default.nix9
-rw-r--r--pkgs/applications/graphics/feh/default.nix8
-rw-r--r--pkgs/applications/graphics/geeqie/default.nix15
-rw-r--r--pkgs/applications/graphics/gimp/2.8.nix6
-rw-r--r--pkgs/applications/graphics/gimp/plugins/default.nix29
-rw-r--r--pkgs/applications/graphics/graphicsmagick/default.nix4
-rw-r--r--pkgs/applications/graphics/hoodle/default.nix22
-rw-r--r--pkgs/applications/graphics/inkscape/default.nix28
-rw-r--r--pkgs/applications/graphics/ipe/default.nix14
-rw-r--r--pkgs/applications/graphics/kgraphviewer/default.nix7
-rw-r--r--pkgs/applications/graphics/kuickshow/default.nix4
-rw-r--r--pkgs/applications/graphics/meshlab/default.nix13
-rw-r--r--pkgs/applications/graphics/meshlab/gcc-4.7.patch38
-rw-r--r--pkgs/applications/graphics/meshlab/include-unistd.diff13
-rw-r--r--pkgs/applications/graphics/meshlab/qt-4.8.patch54
-rw-r--r--pkgs/applications/graphics/ocrad/default.nix6
-rw-r--r--pkgs/applications/graphics/openimageio/default.nix14
-rw-r--r--pkgs/applications/graphics/openscad/default.nix9
-rw-r--r--pkgs/applications/graphics/pencil/default.nix15
-rw-r--r--pkgs/applications/graphics/photoqt/default.nix19
-rw-r--r--pkgs/applications/graphics/photoqt/graphicsmagick-path.patch46
-rw-r--r--pkgs/applications/graphics/potrace/default.nix11
-rw-r--r--pkgs/applications/graphics/processing/default.nix10
-rw-r--r--pkgs/applications/graphics/sane/backends.nix2
-rw-r--r--pkgs/applications/graphics/sane/config.nix28
-rw-r--r--pkgs/applications/graphics/shotwell/default.nix38
-rw-r--r--pkgs/applications/graphics/simple-scan/default.nix40
-rw-r--r--pkgs/applications/graphics/solvespace/default.nix2
-rw-r--r--pkgs/applications/graphics/synfigstudio/default.nix41
-rw-r--r--pkgs/applications/graphics/synfigstudio/synfig-cstring.patch12
-rw-r--r--pkgs/applications/graphics/tesseract/default.nix43
-rw-r--r--pkgs/applications/graphics/xaos/default.nix2
-rw-r--r--pkgs/applications/graphics/xfig/builder.sh3
-rw-r--r--pkgs/applications/graphics/xfig/default.nix4
-rw-r--r--pkgs/applications/graphics/yed/default.nix13
-rw-r--r--pkgs/applications/graphics/zgrviewer/default.nix2
45 files changed, 464 insertions, 548 deletions
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index d577bcd4f943..9483809bf662 100644
--- a/pkgs/applications/graphics/ImageMagick/default.nix
+++ b/pkgs/applications/graphics/ImageMagick/default.nix
@@ -1,97 +1,53 @@
-{ stdenv, fetchurl, pkgconfig, libtool
-, libcl ? null, perl ? null, jemalloc ? null, bzip2 ? null, zlib ? null
-, libX11 ? null, libXext ? null, libXt ? null, dejavu_fonts ? null, fftw ? null
-, libfpx ? null, djvulibre ? null, fontconfig ? null, freetype ? null
-, ghostscript ? null, graphviz ? null, jbigkit ? null, libjpeg ? null
-, lcms2 ? null, openjpeg ? null, liblqr1 ? null, xz ? null, openexr ? null
-, pango ? null, libpng ? null, librsvg ? null, libtiff ? null, libwebp ? null
-, libxml2 ? null
+{ lib, stdenv, fetchurl, pkgconfig, libtool
+, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
+, lcms2, openexr, libpng, librsvg, libtiff, libxml2
 }:
 
 let
-
-  version = "6.9.1-0";
-
   arch =
     if stdenv.system == "i686-linux" then "i686"
     else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64"
     else throw "ImageMagick is not supported on this platform.";
-
-  mkFlag = trueStr: falseStr: cond: val: "--${if cond then trueStr else falseStr}-${val}";
-  mkWith = mkFlag "with" "without";
-  mkEnable = mkFlag "enable" "disable";
-
-  hasX11 = libX11 != null && libXext != null && libXt != null;
-
 in
 
-with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "imagemagick-${version}";
+  version = "6.9.2-0";
 
   src = fetchurl {
     url = "mirror://imagemagick/releases/ImageMagick-${version}.tar.xz";
-    sha256 = "03lvj6rxv16xk0dpsbzvm2gq5bggkwff9wqbpkq0znihzijpax1j";
+    sha256 = "17ir8bw1j7g7srqmsz3rx780sgnc21zfn0kwyj78iazrywldx8h7";
   };
 
-  enableParallelBuilding = true;
+  outputs = [ "out" "doc" ];
 
-  configureFlags = [
-    (mkEnable (libcl != null)        "opencl")
-    (mkWith   true                   "modules")
-    (mkWith   true                   "gcc-arch=${arch}")
-    #(mkEnable true                   "hdri") This breaks some dependencies
-    (mkWith   (perl != null)         "perl")
-    (mkWith   (jemalloc != null)     "jemalloc")
-    (mkWith   true                   "frozenpaths")
-    (mkWith   (bzip2 != null)        "bzlib")
-    (mkWith   hasX11                 "x")
-    (mkWith   (zlib != null)         "zlib")
-    (mkWith   false                  "dps")
-    (mkWith   (fftw != null)         "fftw")
-    (mkWith   (libfpx != null)       "fpx")
-    (mkWith   (djvulibre != null)    "djvu")
-    (mkWith   (fontconfig != null)   "fontconfig")
-    (mkWith   (freetype != null)     "freetype")
-    (mkWith   (ghostscript != null)  "gslib")
-    (mkWith   (graphviz != null)     "gvc")
-    (mkWith   (jbigkit != null)      "jbig")
-    (mkWith   (libjpeg != null)      "jpeg")
-    (mkWith   (lcms2 != null)        "lcms2")
-    (mkWith   false                  "lcms")
-    (mkWith   (openjpeg != null)     "openjp2")
-    (mkWith   (liblqr1 != null)      "lqr")
-    (mkWith   (xz != null)           "lzma")
-    (mkWith   (openexr != null)      "openexr")
-    (mkWith   (pango != null)        "pango")
-    (mkWith   (libpng != null)       "png")
-    (mkWith   (librsvg != null)      "rsvg")
-    (mkWith   (libtiff != null)      "tiff")
-    (mkWith   (libwebp != null)      "webp")
-    (mkWith   (libxml2 != null)      "xml")
-  ] ++ optional (dejavu_fonts != null) "--with-dejavu-font-dir=${dejavu_fonts}/share/fonts/truetype/"
-    ++ optional (ghostscript != null) "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts/";
+  enableParallelBuilding = true;
 
-  buildInputs = [
-    pkgconfig libtool libcl perl jemalloc bzip2 zlib libX11 libXext libXt fftw
-    libfpx djvulibre fontconfig freetype ghostscript graphviz jbigkit libjpeg
-    lcms2 openjpeg liblqr1 xz openexr pango libpng librsvg libtiff libwebp
+  configureFlags =
+    [ "--with-frozenpaths" ]
+    ++ [ "--with-gcc-arch=${arch}" ]
+    ++ lib.optional (librsvg != null) "--with-rsvg"
+    ++ lib.optionals (ghostscript != null)
+      [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
+        "--with-gslib"
+      ];
+
+  buildInputs =
+    [ pkgconfig libtool zlib fontconfig freetype ghostscript libjpeg
+      openexr libpng librsvg libtiff libxml2
     libxml2 (stdenv.cc.cc.lib or null)
-  ];
-
-  propagatedBuildInputs = []
-    ++ (stdenv.lib.optional (lcms2 != null) lcms2)
-    ++ (stdenv.lib.optional (liblqr1 != null) liblqr1)
-    ++ (stdenv.lib.optional (fftw != null) fftw)
-    ++ (stdenv.lib.optional (libtool != null) libtool)
-    ++ (stdenv.lib.optional (jemalloc != null) jemalloc)
-    ++ (stdenv.lib.optional (libXext != null) libXext)
-    ++ (stdenv.lib.optional (libX11 != null) libX11)
-    ++ (stdenv.lib.optional (libXt != null) libXt)
-    ++ (stdenv.lib.optional (bzip2 != null) bzip2)
-    ;
-
-  postInstall = ''(cd "$out/include" && ln -s ImageMagick* ImageMagick)'';
+    ];
+
+  propagatedBuildInputs =
+    [ bzip2 freetype libjpeg libX11 libXext libXt lcms2 ];
+
+  postInstall = ''
+    (cd "$out/include" && ln -s ImageMagick* ImageMagick)
+  '' + lib.optionalString (ghostscript != null) ''
+    for la in $out/lib/*.la; do
+      sed 's|-lgs|-L${ghostscript}/lib -lgs|' -i $la
+    done
+  '';
 
   meta = with stdenv.lib; {
     homepage = http://www.imagemagick.org/;
diff --git a/pkgs/applications/graphics/antimony/default.nix b/pkgs/applications/graphics/antimony/default.nix
new file mode 100644
index 000000000000..589d20cb1260
--- /dev/null
+++ b/pkgs/applications/graphics/antimony/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchgit, libpng, python3, boost, mesa, qt5, ncurses }:
+
+let
+  gitRev    = "745eca3a2d2657c495d5509e9083c884e021d09c";
+  gitBranch = "master";
+  gitTag    = "0.8.0b";
+in 
+  stdenv.mkDerivation rec {
+    name    = "antimony-${version}";
+    version = gitTag;
+
+    src  = fetchgit {
+      url         = "git://github.com/mkeeter/antimony.git";
+      rev         = gitRev;
+      sha256      = "19ir3y5ipmfyygcn8mbxika4j3af6dfrv54dvhn6maz7dy8h30f4";
+    };
+
+    patches = [ ./paths-fix.patch ];
+
+    buildInputs = [
+      libpng python3 (boost.override { python = python3; })
+      mesa qt5.base ncurses
+    ];
+
+    configurePhase = ''
+      export GITREV=${gitRev}
+      export GITBRANCH=${gitBranch}
+      export GITTAG=${gitTag}
+
+      cd qt
+      export sourceRoot=$sourceRoot/qt
+      qmake antimony.pro PREFIX=$out
+    '';
+
+    meta = with stdenv.lib; {
+      description = "A computer-aided design (CAD) tool from a parallel universe";
+      homepage    = "https://github.com/mkeeter/antimony";
+      license     = licenses.mit;
+      platforms   = platforms.linux;
+    };
+  }
diff --git a/pkgs/applications/graphics/antimony/paths-fix.patch b/pkgs/applications/graphics/antimony/paths-fix.patch
new file mode 100644
index 000000000000..de8d9e7beb08
--- /dev/null
+++ b/pkgs/applications/graphics/antimony/paths-fix.patch
@@ -0,0 +1,99 @@
+diff --git a/qt/antimony.pro b/qt/antimony.pro
+index 9d586f4..b055a6d 100644
+--- a/qt/antimony.pro
++++ b/qt/antimony.pro
+@@ -12,14 +12,9 @@ QMAKE_CXXFLAGS_RELEASE += -O3
+ 
+ QMAKE_CXXFLAGS += -Werror=switch
+ 
+-GITREV = $$system(git log --pretty=format:'%h' -n 1)
+-GITDIFF = $$system(git diff --quiet --exit-code || echo "+")
+-GITTAG = $$system(git describe --exact-match --tags 2> /dev/null)
+-GITBRANCH = $$system(git rev-parse --abbrev-ref HEAD)
+-
+-QMAKE_CXXFLAGS += "-D'GITREV=\"$${GITREV}$${GITDIFF}\"'"
+-QMAKE_CXXFLAGS += "-D'GITTAG=\"$${GITTAG}\"'"
+-QMAKE_CXXFLAGS += "-D'GITBRANCH=\"$${GITBRANCH}\"'"
++QMAKE_CXXFLAGS += "-D'GITREV=\"$$(GITREV)\"'"
++QMAKE_CXXFLAGS += "-D'GITTAG=\"$$(GITTAG)\"'"
++QMAKE_CXXFLAGS += "-D'GITBRANCH=\"$$(GITBRANCH)\"'"
+ 
+ OLD_GL_SET = $$(OLD_GL)
+ equals(OLD_GL_SET, "true") {
+@@ -125,11 +120,11 @@ macx {
+ }
+ 
+ linux {
+-    executable.path = /usr/local/bin
++    executable.path = $$(out)/bin
+     executable.files = antimony
+-    nodes_folder.path = /usr/local/bin/sb/nodes
++    nodes_folder.path = $$(out)/bin/sb/nodes
+     nodes_folder.files = ../py/nodes/*
+-    fab_folder.path = /usr/local/bin/sb/fab
++    fab_folder.path = $$(out)/bin/sb/fab
+     fab_folder.files = ../py/fab/*
+     INSTALLS += executable nodes_folder fab_folder
+ }
+diff --git a/qt/fab.pri b/qt/fab.pri
+index a54813b..b500536 100644
+--- a/qt/fab.pri
++++ b/qt/fab.pri
+@@ -54,7 +54,7 @@ DEFINES += '_STATIC_= '
+ 
+ linux {
+     QMAKE_CFLAGS += -std=gnu99
+-    QMAKE_CXXFLAGS += $$system(/usr/bin/python3-config --includes)
++    QMAKE_CXXFLAGS += $$system(python3-config --includes)
+     LIBS += -lpng
+ }
+ 
+diff --git a/qt/shared.pri b/qt/shared.pri
+index e7d0e3a..026eae3 100644
+--- a/qt/shared.pri
++++ b/qt/shared.pri
+@@ -39,41 +39,11 @@ macx {
+ }
+ 
+ linux {
+-    QMAKE_CXXFLAGS += $$system(/usr/bin/python3-config --includes)
+-    QMAKE_LFLAGS   += $$system(/usr/bin/python3-config --ldflags)
++    QMAKE_CXXFLAGS += $$system(python3-config --includes)
++    QMAKE_LFLAGS   += $$system(python3-config --ldflags)
+ 
+     # Even though this is in QMAKE_LFLAGS, the linker is picky about
+     # library ordering (so it needs to be here too).
+     LIBS += -lpython3.4m
+-
+-    # ldconfig is being used to find libboost_python, but it's in a different
+-    # place in different distros (and is not in the default $PATH on Debian).
+-    # First, check to see if it's on the default $PATH.
+-    system(which ldconfig > /dev/null) {
+-        LDCONFIG_BIN = "ldconfig"
+-    }
+-    # If that failed, then search for it in its usual places.
+-    isEmpty(LDCONFIG_BIN) {
+-        for(p, $$list(/sbin/ldconfig /usr/bin/ldconfig)) {
+-            exists($$p): LDCONFIG_BIN = $$p
+-        }
+-    }
+-    # If that search failed too, then exit with an error.
+-    isEmpty(LDCONFIG_BIN) {
+-        error("Could not find ldconfig!")
+-    }
+-
+-    # Check for different boost::python naming schemes
+-    LDCONFIG_OUT = $$system($$LDCONFIG_BIN -p|grep python)
+-    for (b, $$list(boost_python-py34 boost_python3)) {
+-        contains(LDCONFIG_OUT, "lib$${b}.so") {
+-            LIBS += "-l$$b"
+-            GOT_BOOST_PYTHON = True
+-        }
+-    }
+-
+-    # If we couldn't find boost::python, exit with an error.
+-    isEmpty(GOT_BOOST_PYTHON) {
+-        error("Could not find boost::python3")
+-    }
++    LIBS += -lboost_python3
+ }
diff --git a/pkgs/applications/graphics/apitrace/default.nix b/pkgs/applications/graphics/apitrace/default.nix
index af499c51f973..cd107a6d279d 100644
--- a/pkgs/applications/graphics/apitrace/default.nix
+++ b/pkgs/applications/graphics/apitrace/default.nix
@@ -1,17 +1,18 @@
-{ stdenv, fetchFromGitHub, cmake, python, libX11, qt4 }:
+{ stdenv, fetchFromGitHub, cmake, libX11, procps, python, qt5 }:
 
-let version = "6.1"; in
+let version = "7.0"; in
 stdenv.mkDerivation {
   name = "apitrace-${version}";
 
   src = fetchFromGitHub {
-    sha256 = "1v38111ljd35v5sahshs3inhk6nsv7rxh4r0ck8k0njkwzlx2yqk";
+    sha256 = "0nn3z7i6cd4zkmms6jpp1v2q194gclbs06v0f5hyiwcsqaxzsg5b";
     rev = version;
     repo = "apitrace";
     owner = "apitrace";
   };
 
-  buildInputs = [ cmake python libX11 qt4 ];
+  buildInputs = [ libX11 procps python qt5.base ];
+  nativeBuildInputs = [ cmake ];
 
   buildPhase = ''
     cmake
@@ -19,9 +20,10 @@ stdenv.mkDerivation {
   '';
 
   meta = with stdenv.lib; {
+    inherit version;
     homepage = https://apitrace.github.io;
     description = "Tools to trace OpenGL, OpenGL ES, Direct3D, and DirectDraw APIs";
-    license = with licenses; mit;
+    license = licenses.mit;
     platforms = platforms.linux;
     maintainers = with maintainers; [ nckx ];
   };
diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix
index 2f384b0ec91e..454dad5cf899 100644
--- a/pkgs/applications/graphics/darktable/default.nix
+++ b/pkgs/applications/graphics/darktable/default.nix
@@ -9,12 +9,12 @@
 assert stdenv ? glibc;
 
 stdenv.mkDerivation rec {
-  version = "1.6.4";
+  version = "1.6.8";
   name = "darktable-${version}";
 
   src = fetchurl {
     url = "https://github.com/darktable-org/darktable/releases/download/release-${version}/darktable-${version}.tar.xz";
-    sha256 = "0ald6qqg7abgr8hj2qk45260cqh3fddzqbxc1p7ll0ac2vl0bxy5";
+    sha256 = "0189d5pn6g01rynfkhxynrqgfi24v94x8fp0fs7ilrncv0dzhxmn";
   };
 
   buildInputs =
diff --git a/pkgs/applications/graphics/digikam/2.nix b/pkgs/applications/graphics/digikam/2.nix
deleted file mode 100644
index e2ca03fe044e..000000000000
--- a/pkgs/applications/graphics/digikam/2.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-{ stdenv, fetchurl, cmake, qt4, kdelibs, automoc4, phonon, qimageblitz, qca2, eigen,
-lcms, jasper, libgphoto2, kdepimlibs, gettext, soprano, libjpeg, libtiff,
-liblqr1, lensfun, pkgconfig, qjson, libkdcraw, opencv, libkexiv2, libkipi, boost,
-shared_desktop_ontologies, marble, libmysql }:
-
-stdenv.mkDerivation rec {
-  name = "digikam-2.9.0";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/digikam/${name}.tar.bz2";
-    sha256 = "181vf065j1zz26zahkb7hy3fk4837nvwm61cnykvni7w40w0zpbk";
-  };
-
-  nativeBuildInputs = [ cmake automoc4 pkgconfig ];
-
-  buildInputs = [ qt4 kdelibs phonon qimageblitz qca2 eigen lcms libjpeg libtiff
-    jasper libgphoto2 kdepimlibs gettext soprano liblqr1 lensfun qjson libkdcraw
-    opencv libkexiv2 libkipi boost shared_desktop_ontologies marble libmysql ];
-
-  # Make digikam find some FindXXXX.cmake
-  KDEDIRS="${marble}:${qjson}";
-
-  enableParallelBuilding = true;
-
-  meta = {
-    description = "Photo Management Program";
-    license = "GPL";
-    homepage = http://www.digikam.org;
-    maintainers = with stdenv.lib.maintainers; [ viric urkud ];
-    inherit (kdelibs.meta) platforms;
-  };
-}
diff --git a/pkgs/applications/graphics/digikam/default.nix b/pkgs/applications/graphics/digikam/default.nix
index 70966196b077..bdf8077624db 100644
--- a/pkgs/applications/graphics/digikam/default.nix
+++ b/pkgs/applications/graphics/digikam/default.nix
@@ -1,24 +1,24 @@
 { stdenv, fetchurl, automoc4, boost, shared_desktop_ontologies, cmake
 , eigen, lcms, gettext, jasper, kdelibs, kdepimlibs, lensfun
 , libgphoto2, libjpeg, libkdcraw, libkexiv2, libkipi, libpgf, libtiff
-, libusb1, liblqr1, marble, mysql, opencv, phonon, pkgconfig, qca2
-, qimageblitz, qjson, qt4, soprano
+, libusb1, liblqr1, marble, mysql, opencv, perl, phonon, pkgconfig
+, qca2, qimageblitz, qjson, qt4, soprano
 }:
 
 stdenv.mkDerivation rec {
-  name = "digikam-4.6.0";
+  name = "digikam-4.12.0";
 
   src = fetchurl {
     url = "http://download.kde.org/stable/digikam/${name}.tar.bz2";
-    sha256 = "0id3anikki8c3rzqzapdbg00h577qwybknvkbz1kdq0348bs6ixh";
+    sha256 = "081ldsaf3frf5khznjd3sxkjmi4dyp6w6nqnc2a0agkk0kxkl10m";
   };
 
-  nativeBuildInputs = [ cmake automoc4 pkgconfig ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
 
   buildInputs = [
-    boost eigen gettext jasper kdelibs kdepimlibs lcms lensfun
-    libgphoto2 libjpeg libkdcraw libkexiv2 libkipi liblqr1 libpgf
-    libtiff marble mysql.lib opencv phonon qca2 qimageblitz qjson qt4
+    boost eigen jasper kdelibs kdepimlibs lcms lensfun libgphoto2
+    libjpeg libkdcraw libkexiv2 libkipi liblqr1 libpgf libtiff marble
+    mysql.lib opencv phonon qca2 qimageblitz qjson qt4
     shared_desktop_ontologies soprano
   ];
 
@@ -26,7 +26,11 @@ stdenv.mkDerivation rec {
   KDEDIRS="${marble}:${qjson}";
 
   # Help digiKam find libusb, otherwise gphoto2 support is disabled
-  cmakeFlags = "-DLIBUSB_LIBRARIES=${libusb1}/lib -DLIBUSB_INCLUDE_DIR=${libusb1}/include/libusb-1.0";
+  cmakeFlags = [
+    "-DLIBUSB_LIBRARIES=${libusb1}/lib"
+    "-DLIBUSB_INCLUDE_DIR=${libusb1}/include/libusb-1.0"
+    "-DDIGIKAMSC_COMPILE_LIBKFACE=ON"
+  ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/applications/graphics/djview/default.nix b/pkgs/applications/graphics/djview/default.nix
index 4ded807cb29a..e5c49846b23c 100644
--- a/pkgs/applications/graphics/djview/default.nix
+++ b/pkgs/applications/graphics/djview/default.nix
@@ -1,27 +1,29 @@
-{stdenv, fetchurl, djvulibre, qt4, pkgconfig }:
+{ stdenv, fetchurl, pkgconfig, djvulibre, qt4, xorg, libtiff }:
 
+let
+  qt = qt4;
+  # TODO: qt = qt5.base; # should work but there's a mysterious "-silent" error
+in
 stdenv.mkDerivation rec {
-	name = "djview-4.8";
-	src = fetchurl {
-		url = "mirror://sourceforge/djvu/${name}.tar.gz";
-		sha256 = "17y8jvbvj98h25qwsr93v24x75famv8d0jbb0h46xjj555y6wx4c";
-	};
-
-	buildInputs = [djvulibre qt4];
+  name = "djview-4.10.3";
+  src = fetchurl {
+    url = "mirror://sourceforge/djvu/${name}.tar.gz";
+    sha256 = "09dbws0k8giizc0xqpad8plbyaply8x1pjc2k3207v2svk6hxf2h";
+  };
 
   nativeBuildInputs = [ pkgconfig ];
 
-  patches = [ ./djview4-qt-4.8.patch ];
+  buildInputs = [ djvulibre qt xorg.libXt libtiff ];
 
   passthru = {
     mozillaPlugin = "/lib/netscape/plugins";
   };
 
-	meta = {
-		homepage = http://djvu.sourceforge.net/djview4.html;
-		description = "A new portable DjVu viewer and browser plugin";
-		license = stdenv.lib.licenses.gpl2;
-    inherit (qt4.meta) platforms;
-    maintainers = [ stdenv.lib.maintainers.urkud ];
-	};
+  meta = with stdenv.lib; {
+    homepage = http://djvu.sourceforge.net/djview4.html;
+    description = "A portable DjVu viewer and browser plugin";
+    license = licenses.gpl2;
+    inherit (qt.meta) platforms;
+    maintainers = [ maintainers.urkud ];
+  };
 }
diff --git a/pkgs/applications/graphics/djview/djview4-qt-4.8.patch b/pkgs/applications/graphics/djview/djview4-qt-4.8.patch
deleted file mode 100644
index ce3694197f60..000000000000
--- a/pkgs/applications/graphics/djview/djview4-qt-4.8.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Origin: OpenSUSE
-Index: djview-4.8/src/qdjvuwidget.cpp
-===================================================================
---- djview-4.8.orig/src/qdjvuwidget.cpp
-+++ djview-4.8/src/qdjvuwidget.cpp
-@@ -153,7 +153,7 @@ all_numbers(const char *s)
- }
- 
- template<class T> static inline void 
--swap(T& x, T& y)
-+myswap(T& x, T& y)
- {
-   T tmp;
-   tmp = x;
-@@ -173,11 +173,11 @@ ksmallest(T *v, int n, int k)
-       /* Sort v[lo], v[m], v[hi] by insertion */
-       m = (lo+hi)/2;
-       if (v[lo]>v[m])
--        swap(v[lo],v[m]);
-+        myswap(v[lo],v[m]);
-       if (v[m]>v[hi]) {
--        swap(v[m],v[hi]);
-+        myswap(v[m],v[hi]);
-         if (v[lo]>v[m])
--          swap(v[lo],v[m]);
-+          myswap(v[lo],v[m]);
-       }
-       /* Extract pivot, place sentinel */
-       pivot = v[m];
-@@ -191,7 +191,7 @@ ksmallest(T *v, int n, int k)
-       do ++l; while (v[l]<pivot);
-       do --h; while (v[h]>pivot);
-       if (l < h) { 
--        swap(v[l],v[h]); 
-+        myswap(v[l],v[h]); 
-         goto loop; 
-       }
-       /* Finish up */
diff --git a/pkgs/applications/graphics/fbida/default.nix b/pkgs/applications/graphics/fbida/default.nix
index 927ca2ab6797..bacfa500ede1 100644
--- a/pkgs/applications/graphics/fbida/default.nix
+++ b/pkgs/applications/graphics/fbida/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "fbida-2.09";
+  name = "fbida-2.10";
   
   src = fetchurl {
     url = "http://dl.bytesex.org/releases/fbida/${name}.tar.gz";
-    sha256 = "1riia87v5nsx858xnlvc7sspr1p36adjqrdch1255ikr5xbv6h6x";
+    sha256 = "1dkc1d6qlfa1gn94wcbyr7ayiy728q52fvbipwmnl2mlc6n3lnks";
   };
 
   nativeBuildInputs = [ pkgconfig which ];
@@ -29,7 +29,10 @@ stdenv.mkDerivation rec {
     makeFlags = makeFlags ++ [ "CC=${stdenv.cross.config}-gcc" "STRIP="];
   };
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Image viewing and manipulation programs";
+    homepage = https://www.kraxel.org/blog/linux/fbida/;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ pSub ];
   };
 }
diff --git a/pkgs/applications/graphics/feh/default.nix b/pkgs/applications/graphics/feh/default.nix
index ad6367722372..266f70e3008f 100644
--- a/pkgs/applications/graphics/feh/default.nix
+++ b/pkgs/applications/graphics/feh/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, makeWrapper, fetchurl, x11, imlib2, libjpeg, libpng
+{ stdenv, makeWrapper, fetchurl, xlibsWrapper, imlib2, libjpeg, libpng
 , libXinerama, curl, libexif }:
 
 stdenv.mkDerivation rec {
-  name = "feh-2.12.1";
+  name = "feh-2.13.1";
 
   src = fetchurl {
     url = "http://feh.finalrewind.org/${name}.tar.bz2";
-    sha256 = "18b6yjk88ybqxsa5knk6qwi2xy7fclbzl5cpzwg0wmkr3phfq9lh";
+    sha256 = "1059mflgw8hl398lwy55fj50a98xryvdf23wkpbn4s0z9388hl46";
   };
 
-  buildInputs = [ makeWrapper x11 imlib2 libjpeg libpng libXinerama curl libexif ];
+  buildInputs = [ makeWrapper xlibsWrapper imlib2 libjpeg libpng libXinerama curl libexif ];
 
   preBuild = ''
     makeFlags="PREFIX=$out exif=1"
diff --git a/pkgs/applications/graphics/geeqie/default.nix b/pkgs/applications/graphics/geeqie/default.nix
index e1eb7bb5a7b7..e2cc0ec5c01e 100644
--- a/pkgs/applications/graphics/geeqie/default.nix
+++ b/pkgs/applications/graphics/geeqie/default.nix
@@ -1,22 +1,21 @@
-{ stdenv, fetchurl, pkgconfig, autoconf, automake, gtk, libpng, exiv2
-, lcms, intltool, gettext, fbida
+{ stdenv, fetchurl, pkgconfig, gtk, libpng, exiv2
+, lcms, intltool, gettext, libchamplain, fbida
 }:
 
 stdenv.mkDerivation rec {
   name = "geeqie-${version}";
-  version = "1.2";
+  version = "1.1"; # Don't upgrade to 1.2; see fee59b1235e658954b207ff6679264654c4708d2.
 
   src = fetchurl {
-    url = "mirror://debian/pool/main/g/geeqie/geeqie_${version}.orig.tar.gz";
-    sha256 = "0wkcpyh3f6ig36x1q6h9iqgq225w37visip48m72j8rpghmv1rn3";
+    url = "mirror://sourceforge/geeqie/${name}.tar.gz";
+    sha256 = "1kzy39z9505xkayyx7rjj2wda76xy3ch1s5z35zn8yli54ffhi2m";
   };
 
-  preConfigure = "./autogen.sh";
-
   configureFlags = [ "--enable-gps" ];
 
   buildInputs = [
-    pkgconfig autoconf automake gtk libpng exiv2 lcms intltool gettext
+    pkgconfig gtk libpng exiv2 lcms intltool gettext
+    #libchamplain
   ];
 
   postInstall = ''
diff --git a/pkgs/applications/graphics/gimp/2.8.nix b/pkgs/applications/graphics/gimp/2.8.nix
index 83f409457fbb..7c394ae11c6f 100644
--- a/pkgs/applications/graphics/gimp/2.8.nix
+++ b/pkgs/applications/graphics/gimp/2.8.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, intltool, babl, gegl, gtk, 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, xlibs, wrapPython }:
+, python, pygtk, libart_lgpl, libexif, gettext, xorg, wrapPython }:
 
 stdenv.mkDerivation rec {
   name = "gimp-2.8.14";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     [ pkgconfig intltool babl gegl gtk 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 xlibs.libXpm
+      python pygtk libart_lgpl libexif gettext xorg.libXpm
       wrapPython
     ];
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   #configureFlags = [ "--disable-print" ];
 
   # "screenshot" needs this.
-  NIX_LDFLAGS = "-rpath ${xlibs.libX11}/lib"
+  NIX_LDFLAGS = "-rpath ${xorg.libX11}/lib"
     + stdenv.lib.optionalString stdenv.isDarwin " -lintl";
 
   meta = {
diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix
index 5f43abfcfc1e..ea638de7925d 100644
--- a/pkgs/applications/graphics/gimp/plugins/default.nix
+++ b/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -59,12 +59,12 @@ rec {
       sed -e 's,^\(GIMP_PLUGIN_DIR=\).*,\1'"$out/${gimp.name}-plugins", \
        -e 's,^\(GIMP_DATA_DIR=\).*,\1'"$out/share/${gimp.name}", -i configure
     '';
-    meta = {
+    meta = with stdenv.lib; {
       description = "The GIMP Animation Package";
       homepage = http://www.gimp.org;
       # The main code is given in GPLv3, but it has ffmpeg in it, and I think ffmpeg license
       # falls inside "free".
-      license = [ "GPLv3" "free" ];
+      license = with licenses; [ gpl3 free ];
     };
   };
 
@@ -159,24 +159,25 @@ rec {
   };
 
   gmic =
-  let
-    imagemagick = pkgs.imagemagickBig; # maybe the non big version is enough?
-  in pluginDerivation rec {
-      name = "gmic-1.5.7.2";
-      buildInputs = [imagemagick pkgconfig pkgs.fftw gimp] ++ gimp.nativeBuildInputs;
+    pluginDerivation rec {
+      name = "gmic-1.6.5.0";
+
+      buildInputs = [pkgconfig pkgs.fftw pkgs.opencv gimp] ++ gimp.nativeBuildInputs;
+
       src = fetchurl {
-        url = mirror://sourceforge/gmic/gmic_1.5.7.2.tar.gz;
-        sha256 = "1cpbxb3p2c8bcv2cbr150whapzjc7w09i3jza0z9x3xj8c0vdyv1";
+        url = http://gmic.eu/files/source/gmic_1.6.5.0.tar.gz;
+        sha256 = "1vb6zm5zpqfnzxjvb9yfvczaqacm55rf010ib0yk9f28b17qrjgb";
       };
-      preConfigure = ''
-        export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${imagemagick}/include/ImageMagick"
-      '';
+
       sourceRoot = "${name}/src";
-      buildPhase = "make gimp";
+
+      buildFlags = "gimp";
+
       installPhase = "installPlugins gmic_gimp";
+
       meta = {
         description = "script language for image processing which comes with its open-source interpreter";
-        homepage = http://gmic.sourceforge.net/repository.shtml;
+        homepage = http://gmic.eu/gimp.shtml;
         license = stdenv.lib.licenses.cecill20;
         /*
         The purpose of this Free Software license agreement is to grant users
diff --git a/pkgs/applications/graphics/graphicsmagick/default.nix b/pkgs/applications/graphics/graphicsmagick/default.nix
index 536249e70a60..95cfcaef01a2 100644
--- a/pkgs/applications/graphics/graphicsmagick/default.nix
+++ b/pkgs/applications/graphics/graphicsmagick/default.nix
@@ -2,14 +2,14 @@
 , libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz
 , libX11, quantumdepth ? 8}:
 
-let version = "1.3.18"; in
+let version = "1.3.21"; in
 
 stdenv.mkDerivation {
   name = "graphicsmagick-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/graphicsmagick/GraphicsMagick-${version}.tar.xz";
-    sha256 = "1axh4j2jr3l92dan15b2nmx9da4l7i0rcz9b5bvfd4q742zfwj7x";
+    sha256 = "07rwpxy62r9m4r2cg6yll2nr698mxyvbji8vgsivcxhpk56k0ich";
   };
 
   configureFlags = "--enable-shared --with-quantum-depth=" + toString quantumdepth;
diff --git a/pkgs/applications/graphics/hoodle/default.nix b/pkgs/applications/graphics/hoodle/default.nix
deleted file mode 100644
index afa3a8ca0c7c..000000000000
--- a/pkgs/applications/graphics/hoodle/default.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-# This file was auto-generated by cabal2nix. Please do NOT edit manually!
-
-{ cabal, cmdargs, configurator, dyre, filepath, hoodleCore, mtl }:
-
-cabal.mkDerivation (self: {
-  pname = "hoodle";
-  version = "0.3";
-  sha256 = "01wz7bwdr3i43ikaiaq8vpn6b0clxjnjyaw6nl6zaq489dhj6fv5";
-  isLibrary = true;
-  isExecutable = true;
-  buildDepends = [
-    cmdargs configurator dyre filepath hoodleCore mtl
-  ];
-  meta = {
-    homepage = "http://ianwookim.org/hoodle";
-    description = "Executable for hoodle";
-    license = self.stdenv.lib.licenses.gpl3;
-    platforms = self.ghc.meta.platforms;
-    hydraPlatforms = self.stdenv.lib.platforms.none;
-    maintainers = with self.stdenv.lib.maintainers; [ ianwookim ];
-  };
-})
diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix
index ca52a4f2766d..409fd0a767ce 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -2,9 +2,20 @@
 , libpng, zlib, popt, boehmgc, libxml2, libxslt, glib, gtkmm
 , glibmm, libsigcxx, lcms, boost, gettext, makeWrapper, intltool
 , gsl, python, pyxml, lxml, poppler, imagemagick, libwpg, librevenge
-, libvisio, libcdr, libexif
+, libvisio, libcdr, libexif, unzip
+, boxMakerPlugin ? false # boxmaker plugin
 }:
 
+let 
+
+boxmaker = fetchurl {
+  # http://www.inkscapeforum.com/viewtopic.php?f=11&t=10403
+  url = "http://www.keppel.demon.co.uk/111000/files/BoxMaker0.91.zip";
+  sha256 = "5c5697f43dc3a95468f61f479cb50b7e2b93379a1729abf19e4040ac9f43a1a8";
+};
+
+in
+
 stdenv.mkDerivation rec {
   name = "inkscape-0.91";
 
@@ -18,7 +29,7 @@ stdenv.mkDerivation rec {
     patchShebangs share/extensions
   ''
   # Clang gets misdetected, so hardcode the right answer
-  + stdenv.lib.optionalString (stdenv.cc.cc.isClang or false) ''
+  + stdenv.lib.optionalString stdenv.cc.isClang ''
     substituteInPlace src/ui/tool/node.h \
       --replace "#if __cplusplus >= 201103L" "#if true"
   '';
@@ -34,12 +45,23 @@ stdenv.mkDerivation rec {
     libxml2 libxslt glib gtkmm glibmm libsigcxx lcms boost gettext
     makeWrapper intltool gsl poppler imagemagick libwpg librevenge
     libvisio libcdr libexif
-  ];
+  ] ++ stdenv.lib.optional boxMakerPlugin unzip;
 
   enableParallelBuilding = true;
   doCheck = true;
 
   postInstall = ''
+    ${if boxMakerPlugin then "
+      mkdir -p $out/share/inkscape/extensions/
+      # boxmaker packaged version 0.91 in a directory called 0.85 ?!??
+      unzip ${boxmaker};
+      cp boxmake-upd-0.85/* $out/share/inkscape/extensions/
+      rm -Rf boxmake-upd-0.85
+      "
+    else 
+      ""
+    }
+
     # Make sure PyXML modules can be found at run-time.
     for i in "$out/bin/"*
     do
diff --git a/pkgs/applications/graphics/ipe/default.nix b/pkgs/applications/graphics/ipe/default.nix
index 53df14f8704f..ede0dc07afb8 100644
--- a/pkgs/applications/graphics/ipe/default.nix
+++ b/pkgs/applications/graphics/ipe/default.nix
@@ -1,12 +1,13 @@
 { stdenv, fetchurl, pkgconfig, zlib, qt4, freetype, cairo, lua5, texLive, ghostscriptX
+, libjpeg
 , makeWrapper }:
 let ghostscript = ghostscriptX; in
 stdenv.mkDerivation rec {
-  name = "ipe-7.1.2";
+  name = "ipe-7.1.8";
 
   src = fetchurl {
-    url = "mirror://sourceforge/ipe7/ipe/7.1.0/${name}-src.tar.gz";
-    sha256 = "04fs5slci3bmpgz8d038h3hnzzdw57xykcpsmisdxci2xrkxx41k";
+    url = "http://github.com/otfried/ipe/raw/master/releases/7.1/${name}-src.tar.gz";
+    sha256 = "1zx6dyr1rb6m6rvawagg9f8bc2li9nbighv2dglzjbh11bxqsyva";
   };
 
   # changes taken from Gentoo portage
@@ -21,9 +22,10 @@ stdenv.mkDerivation rec {
 
   IPEPREFIX="$$out";
   URWFONTDIR="${texLive}/texmf-dist/fonts/type1/urw/";
+  LUA_PACKAGE = "lua";
 
   buildInputs = [
-    pkgconfig zlib qt4 freetype cairo lua5 texLive ghostscript makeWrapper
+    libjpeg pkgconfig zlib qt4 freetype cairo lua5 texLive ghostscript makeWrapper
   ];
 
   postInstall = ''
@@ -36,12 +38,14 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "An editor for drawing figures";
-    homepage = http://ipe7.sourceforge.net;
+    homepage = http://ipe.otfried.org;
     license = stdenv.lib.licenses.gpl3Plus;
     longDescription = ''
       Ipe is an extensible drawing editor for creating figures in PDF and Postscript format.
       It supports making small figures for inclusion into LaTeX-documents
       as well as presentations in PDF.
     '';
+    maintainers = [ stdenv.lib.maintainers.ttuegel ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/kgraphviewer/default.nix b/pkgs/applications/graphics/kgraphviewer/default.nix
index 21caf8f80028..6eb57c3dd5f1 100644
--- a/pkgs/applications/graphics/kgraphviewer/default.nix
+++ b/pkgs/applications/graphics/kgraphviewer/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, kdelibs, automoc4, boost, pkgconfig, graphviz, gettext }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, kdelibs, boost, graphviz
+}:
 
 stdenv.mkDerivation rec {
   name = "kgraphviewer-${version}";
@@ -9,7 +11,8 @@ stdenv.mkDerivation rec {
     sha256 = "13zhjs57xavzrj4nrlqs35n35ihvzij7hgbszf5fhlp2a4d4rrqs";
   };
 
-  buildInputs = [ kdelibs automoc4 boost pkgconfig graphviz gettext ];
+  buildInputs = [ kdelibs boost graphviz ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
 
   meta = with stdenv.lib; {
     description = "A Graphviz dot graph viewer for KDE";
diff --git a/pkgs/applications/graphics/kuickshow/default.nix b/pkgs/applications/graphics/kuickshow/default.nix
index 7a4106429585..cfecd19df46d 100644
--- a/pkgs/applications/graphics/kuickshow/default.nix
+++ b/pkgs/applications/graphics/kuickshow/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, kdelibs, imlib, cmake, pkgconfig, gettext }:
+{ stdenv, fetchurl, automoc4, kdelibs, imlib, cmake, pkgconfig, gettext }:
 
 stdenv.mkDerivation rec {
   name = "kuickshow-0.9.1";
@@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs imlib ];
 
-  nativeBuildInputs = [ cmake gettext pkgconfig ];
+  nativeBuildInputs = [ automoc4 cmake gettext pkgconfig ];
 }
diff --git a/pkgs/applications/graphics/meshlab/default.nix b/pkgs/applications/graphics/meshlab/default.nix
index 9352ae092be4..49bfb47c85a4 100644
--- a/pkgs/applications/graphics/meshlab/default.nix
+++ b/pkgs/applications/graphics/meshlab/default.nix
@@ -1,22 +1,18 @@
 {stdenv, fetchurl, qt4, bzip2, lib3ds, levmar, muparser, unzip}:
 
 stdenv.mkDerivation rec {
-  name = "meshlab-1.3.2";
+  name = "meshlab-1.3.3";
 
   src = fetchurl {
-    url = "mirror://sourceforge/meshlab/meshlab/MeshLab%20v1.3.2/MeshLabSrc_AllInc_v132.tgz";
-    sha256 = "d57f0a99a55421aac54a66e2475d48f00f7b1752f9587cd69cf9b5b9c1a519b1";
+    url = "mirror://sourceforge/meshlab/meshlab/MeshLab%20v1.3.3/MeshLabSrc_AllInc_v133.tgz";
+    sha256 = "03wqaibfbfag2w1zi1a5z6h546r9d7pg2sjl5pwg24w7yp8rr0n9";
   };
 
   # I don't know why I need this; without this, the rpath set at the beginning of the
   # buildPhase gets removed from the 'meshlab' binary
   dontPatchELF = true;
 
-  # Patches are from the Arch Linux package
-  patchPhase = ''
-    patch -Np0 -i "${./qt-4.8.patch}"
-    patch -Np1 -i "${./gcc-4.7.patch}"
-  '';
+  patches = [ ./include-unistd.diff ];
 
   buildPhase = ''
     mkdir -p "$out/include"
@@ -50,5 +46,6 @@ stdenv.mkDerivation rec {
     license = stdenv.lib.licenses.gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
+    broken = stdenv.isLinux && stdenv.isi686;
   };
 }
diff --git a/pkgs/applications/graphics/meshlab/gcc-4.7.patch b/pkgs/applications/graphics/meshlab/gcc-4.7.patch
deleted file mode 100644
index 07dc1a08aff5..000000000000
--- a/pkgs/applications/graphics/meshlab/gcc-4.7.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-diff --git a/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h b/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h
-index 2351b2a..90c6d76 100644
---- a/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h
-+++ b/meshlab/src/meshlabplugins/decorate_base/colorhistogram.h
-@@ -40,7 +40,7 @@ public:
- 
-   //! Reset histogram data.
-   void Clear() {
--    this->::Clear();
-+    Histogram<ScalarType>::Clear();
-     CV.clear();
-   }
-   /*
-diff --git a/vcglib/wrap/gl/trimesh.h b/vcglib/wrap/gl/trimesh.h
-index 5d40404..ab9d0aa 100644
---- a/vcglib/wrap/gl/trimesh.h
-+++ b/vcglib/wrap/gl/trimesh.h
-@@ -1003,7 +1003,7 @@ void Crease(MESH_TYPE &m, typename MESH_TYPE::scalar_type angleRad)
- 			}
- 		}
- 
--	m.vert.math::Swap(newvert);
-+	m.vert.math.Swap(newvert);
- 	m.vn=m.vert.size();
- }
- 
-diff --git a/vcglib/wrap/ply/plystuff.h b/vcglib/wrap/ply/plystuff.h
-index 3e41e63..4af9508 100644
---- a/vcglib/wrap/ply/plystuff.h
-+++ b/vcglib/wrap/ply/plystuff.h
-@@ -75,6 +75,7 @@ using namespace vcg;
- #define pb_close  _close
- #define DIR_SEP "\\"
- #else
-+#include <unistd.h>
- #define pb_mkdir(n)  mkdir(n,0755)
- #define pb_access access
- #define pb_stat   stat
diff --git a/pkgs/applications/graphics/meshlab/include-unistd.diff b/pkgs/applications/graphics/meshlab/include-unistd.diff
new file mode 100644
index 000000000000..74f28a4d2119
--- /dev/null
+++ b/pkgs/applications/graphics/meshlab/include-unistd.diff
@@ -0,0 +1,13 @@
+*** old/vcglib/wrap/ply/plystuff.h	2013-02-09 00:00:04.110705851 -0500
+--- new/vcglib/wrap/ply/plystuff.h	2013-02-09 15:20:53.482205183 -0500
+***************
+*** 75,80 ****
+--- 75,81 ----
+  #define pb_close  _close
+  #define DIR_SEP "\\"
+  #else
++ #include <unistd.h>
+  #define pb_mkdir(n)  mkdir(n,0755)
+  #define pb_access access
+  #define pb_stat   stat
+
diff --git a/pkgs/applications/graphics/meshlab/qt-4.8.patch b/pkgs/applications/graphics/meshlab/qt-4.8.patch
deleted file mode 100644
index abfd77d6f25d..000000000000
--- a/pkgs/applications/graphics/meshlab/qt-4.8.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-diff -Nur meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp
---- meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp	2011-01-25 18:51:28.000000000 +1100
-+++ meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Raytracer/RayTracer.cpp	2012-01-07 11:47:12.836800072 +1100
-@@ -7,6 +7,12 @@
- #include "SyntopiaCore/Logging/Logging.h"

- #include "SyntopiaCore/Misc/MiniParser.h"

- 

-+#ifdef Q_WS_MAC

-+#include <OpenGL/glu.h>

-+#else

-+#include <GL/glu.h>

-+#endif

-+

- using namespace SyntopiaCore::Math;

- using namespace SyntopiaCore::Misc;

- 

-diff -Nur meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h
---- meshlab.orig/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h	2011-01-25 18:51:28.000000000 +1100
-+++ meshlab/src/external/structuresynth/ssynth/SyntopiaCore/GLEngine/Sphere.h	2012-01-07 11:45:26.795586149 +1100
-@@ -3,6 +3,12 @@
- #include "SyntopiaCore/Math/Vector3.h"

- #include "Object3D.h"

- 

-+#ifdef Q_WS_MAC

-+#include <OpenGL/glu.h>

-+#else

-+#include <GL/glu.h>

-+#endif

-+

- namespace SyntopiaCore {

- 	namespace GLEngine {	

- 

-diff -Nur meshlab.orig/src/external/structuresynth/structuresynth.pro meshlab/src/external/structuresynth/structuresynth.pro
---- meshlab.orig/src/external/structuresynth/structuresynth.pro	2011-01-25 18:49:34.000000000 +1100
-+++ meshlab/src/external/structuresynth/structuresynth.pro	2012-01-07 11:51:46.695981995 +1100
-@@ -113,6 +113,7 @@
-            ssynth/StructureSynth/Model/Rendering/TemplateRenderer.cpp

- CONFIG+=opengl

- QT+=xml opengl script

-+unix:LIBS += -lGLU

- macx:DESTDIR       = ../lib/macx

- win32-g++:DESTDIR       = ../lib/win32-gcc

- win32-msvc2005:DESTDIR       = ../lib/win32-msvc2005

-diff -Nur meshlab.orig/src/meshlab/meshlab.pro meshlab/src/meshlab/meshlab.pro
---- meshlab.orig/src/meshlab/meshlab.pro	2011-02-15 20:39:47.000000000 +1100
-+++ meshlab/src/meshlab/meshlab.pro	2012-01-07 11:57:18.055586086 +1100
-@@ -85,6 +85,7 @@
- QT += xmlpatterns
- QT += network
- QT += script
-+unix:LIBS += -lGLU
- 
- 
- # the following line is needed to avoid mismatch between
diff --git a/pkgs/applications/graphics/ocrad/default.nix b/pkgs/applications/graphics/ocrad/default.nix
index b4becafdb0b4..3ec25b503ebf 100644
--- a/pkgs/applications/graphics/ocrad/default.nix
+++ b/pkgs/applications/graphics/ocrad/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, lzip, texinfo }:
 
 stdenv.mkDerivation rec {
-  name = "ocrad-0.24";
+  name = "ocrad-0.25";
 
   src = fetchurl {
     url = "mirror://gnu/ocrad/${name}.tar.lz";
-    sha256 = "0hhlx072d00bi9qia0nj5izsq4qkscpfz2mpbyfc72msl3hfvslv";
+    sha256 = "1m2dblgvvjs48rsglfdwq0ib9zk8h9n34xsh67ibrg0g0ffbw477";
   };
 
   buildInputs = [ lzip texinfo ];
@@ -14,7 +14,6 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Optical character recognition (OCR) program & library";
-
     longDescription =
       '' GNU Ocrad is an OCR (Optical Character Recognition) program based on
          a feature extraction method.  It reads images in pbm (bitmap), pgm
@@ -29,7 +28,6 @@ stdenv.mkDerivation rec {
       '';
 
     license = licenses.gpl3Plus;
-
     maintainers = with maintainers; [ pSub ];
     platforms = platforms.gnu;  # arbitrary choice
   };
diff --git a/pkgs/applications/graphics/openimageio/default.nix b/pkgs/applications/graphics/openimageio/default.nix
index 473db68dc274..6bffa834ae0b 100644
--- a/pkgs/applications/graphics/openimageio/default.nix
+++ b/pkgs/applications/graphics/openimageio/default.nix
@@ -3,12 +3,12 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "oiio-${version}";
-  version = "1.4.15";
+  name = "openimageio-${version}";
+  version = "1.4.16";
 
   src = fetchurl {
     url = "https://github.com/OpenImageIO/oiio/archive/Release-${version}.zip";
-    sha256 = "1fc5v3qmrzf9qx765fd15r2dc3ccrz4xf4f9q4cwsrspmaxqyqzs";
+    sha256 = "0f9gspsjhniz992c04dm4lvffzz7zjqn1n34nqn6c32r498kimcj";
   };
 
   buildInputs = [
@@ -20,11 +20,13 @@ stdenv.mkDerivation rec {
     "-DUSE_PYTHON=OFF"
   ];
 
-  buildPhase = ''
-    make ILMBASE_HOME=${ilmbase} OPENEXR_HOME=${openexr} USE_PYTHON=0 \
-      INSTALLDIR=$out dist_dir=
+  preBuild = ''
+    makeFlags="ILMBASE_HOME=${ilmbase} OPENEXR_HOME=${openexr} USE_PYTHON=0
+      INSTALLDIR=$out dist_dir="
   '';
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     homepage = http://www.openimageio.org;
     description = "A library and tools for reading and writing images";
diff --git a/pkgs/applications/graphics/openscad/default.nix b/pkgs/applications/graphics/openscad/default.nix
index e6d5ee5528f0..7557e19896ff 100644
--- a/pkgs/applications/graphics/openscad/default.nix
+++ b/pkgs/applications/graphics/openscad/default.nix
@@ -1,23 +1,22 @@
 { stdenv, fetchurl, qt4, bison, flex, eigen, boost, mesa, glew, opencsg, cgal
-, mpfr, gmp, glib, pkgconfig
+, mpfr, gmp, glib, pkgconfig, harfbuzz, qscintilla, gettext
 }:
 
 stdenv.mkDerivation rec {
-  version = "2014.03";
+  version = "2015.03-1";
   name = "openscad-${version}";
 
   src = fetchurl {
     url = "http://files.openscad.org/${name}.src.tar.gz";
-    sha256 = "1hv1lmq1ayhlvrz5sqipg650xryq25a9k22ysdw0dsrwg9ixqpw6";
+    sha256 = "61e0dd3cd107e5670d727526700104cca5ac54a1f0a84117fcc9e57bf3b6b279";
   };
 
   buildInputs = [
     qt4 bison flex eigen boost mesa glew opencsg cgal mpfr gmp glib
-    pkgconfig
+    pkgconfig harfbuzz qscintilla gettext
   ];
 
   configurePhase = ''
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${eigen}/include/eigen*) "
     qmake PREFIX="$out" VERSION=${version}
   '';
 
diff --git a/pkgs/applications/graphics/pencil/default.nix b/pkgs/applications/graphics/pencil/default.nix
index fc1b5795d40c..94ab1b76cda6 100644
--- a/pkgs/applications/graphics/pencil/default.nix
+++ b/pkgs/applications/graphics/pencil/default.nix
@@ -1,25 +1,30 @@
-{ stdenv, fetchurl, xulrunner }:
+{ stdenv, fetchurl, makeWrapper, xulrunner }:
 
 stdenv.mkDerivation rec {
-  version = "2.0.10";
+  version = "2.0.13";
   name = "pencil-${version}";
 
   src = fetchurl {
     url = "https://github.com/prikhi/pencil/releases/download/v${version}/Pencil-${version}-linux-pkg.tar.gz";
-    sha256 = "b5dcb12986108bf3eb13cdd1ee1fc1f8d1a88c7fadf2a5c44e7a59a254f2b0dd";
+    sha256 = "150jsaq27n01l0vf10jiyrlfm0canqhphdxi42di96b9zsfkphpk";
+
   };
 
   buildPhase = "";
 
+  buildInputs = [ makeWrapper ];
+
   installPhase = ''
     mkdir -p "$out"
     cp -r usr/* "$out"
-    sed -e "s|/usr/bin/xulrunner|${xulrunner}/bin/xulrunner|" \
-        -e "s|/usr/share/evolus-pencil|$out/share/evolus-pencil|" \
+    sed -e "s|/usr/share/evolus-pencil|$out/share/evolus-pencil|" \
         -i "$out/bin/pencil"
     sed -e "s|/usr/bin/pencil|$out/bin/pencil|" \
         -e "s|Icon=.*|Icon=$out/share/evolus-pencil/skin/classic/icon.svg|" \
         -i "$out/share/applications/pencil.desktop"
+
+    wrapProgram $out/bin/pencil \
+      --prefix PATH ":" ${xulrunner}/bin
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/graphics/photoqt/default.nix b/pkgs/applications/graphics/photoqt/default.nix
index 9e2c3a18a637..7ae6d6e050fa 100644
--- a/pkgs/applications/graphics/photoqt/default.nix
+++ b/pkgs/applications/graphics/photoqt/default.nix
@@ -1,23 +1,30 @@
-{ stdenv, fetchurl, cmake, qt5, exiv2, graphicsmagick }:
+{ stdenv, fetchurl, cmake, makeWrapper, qt5, exiv2, graphicsmagick }:
 
 let
-  version = "1.1.0.1";
+  version = "1.3";
+  qmlPath = stdenv.lib.makeSearchPath "lib/qt5/qml/" [
+    qt5.quickcontrols
+    qt5.declarative
+    qt5.multimedia
+  ];
 in
 stdenv.mkDerivation rec {
   name = "photoqt-${version}";
   src = fetchurl {
     url = "http://photoqt.org/pkgs/photoqt-${version}.tar.gz";
-    sha256 = "1y59ys1dgjppahs7v7kxwva7ik23s0x7j2f6glv6sn23l9cfq9rp";
+    sha256 = "0j2kvxfb5pd9abciv161nkcsyam6n8kfqs8ymwj2mxiqflwbmfl1";
   };
 
-  buildInputs = [ cmake qt5.base qt5.tools exiv2 graphicsmagick ];
-
-  patches = [ ./graphicsmagick-path.patch ];
+  buildInputs = [ cmake makeWrapper qt5.base qt5.tools exiv2 graphicsmagick ];
 
   preConfigure = ''
     export MAGICK_LOCATION="${graphicsmagick}/include/GraphicsMagick"
   '';
 
+  postInstall = ''
+    wrapProgram $out/bin/photoqt --set QML2_IMPORT_PATH "${qmlPath}"
+  '';
+
   meta = {
     homepage = "http://photoqt.org/";
     description = "Simple, yet powerful and good looking image viewer";
diff --git a/pkgs/applications/graphics/photoqt/graphicsmagick-path.patch b/pkgs/applications/graphics/photoqt/graphicsmagick-path.patch
deleted file mode 100644
index da9b70e31ed5..000000000000
--- a/pkgs/applications/graphics/photoqt/graphicsmagick-path.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- a/CMake/FindMagick.cmake	2014-10-13 19:24:30.000000000 +0200
-+++ b/CMake/FindMagick.cmake	2014-12-27 18:54:19.611759021 +0100
-@@ -19,28 +19,11 @@
- SET(MAGICK++_FOUND "NO" )
- 
- FIND_PATH( MAGICK_INCLUDE_DIR magick/magick.h
--  "$ENV{MAGICK_LOCATION}/magick"
--  "$ENV{MAGICK_LOCATION}/include/magick"
--  "$ENV{MAGICK_HOME}/include/magick"
--  /usr/include/magick
--  /usr/include/
--  /usr/include/GraphicsMagick
--  /opt/local/include/GraphicsMagick/magick
--  /opt/local/include/GraphicsMagick
-+  "$ENV{MAGICK_LOCATION}"
-   )
- 
- FIND_PATH( MAGICK++_INCLUDE_DIR Magick++.h
--  "$ENV{MAGICK++_LOCATION}/Magick++"
--  "$ENV{MAGICK++_LOCATION}/include/"
--  "$ENV{MAGICK_LOCATION}/Magick++"
--  "$ENV{MAGICK_LOCATION}/include/Magick++"
--  "$ENV{MAGICK_LOCATION}/include/"
--  "$ENV{MAGICK_HOME}/include/"
--  /usr/include/Magick++
--  /usr/include/GraphicsMagick
--  /usr/include/
--  /opt/local/include/GraphicsMagick/Magick++
--  /opt/local/include/GraphicsMagick
-+  "$ENV{MAGICK_LOCATION}"
-   )
-   
- FIND_LIBRARY( Magick GraphicsMagick
-@@ -55,12 +38,7 @@
- 
- FIND_LIBRARY( Magick++ GraphicsMagick++
-   PATHS 
--  "$ENV{MAGICK++_LOCATION}/.libs"
--  "$ENV{MAGICK_LOCATION}/.libs"
--  "$ENV{MAGICK++_LOCATION}/lib"
-   "$ENV{MAGICK_LOCATION}/lib"
--  "$ENV{MAGICK_HOME}/lib"
--  /opt/local/lib
-   DOC   "GraphicsMagick Magick++ library"
- )
- 
diff --git a/pkgs/applications/graphics/potrace/default.nix b/pkgs/applications/graphics/potrace/default.nix
index f58fe0e28c1d..13636e1f1fe5 100644
--- a/pkgs/applications/graphics/potrace/default.nix
+++ b/pkgs/applications/graphics/potrace/default.nix
@@ -1,16 +1,15 @@
 { stdenv, fetchurl, zlib }:
 
-let version = "1.11"; in
-
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "potrace-${version}";
+  version = "1.12";
 
   src = fetchurl {
-    url = "http://potrace.sourceforge.net/download/potrace-${version}.tar.gz";
-    sha256 = "1bbyl7jgigawmwc8r14znv8lb6lrcxh8zpvynrl6s800dr4yp9as";
+    url = "http://potrace.sourceforge.net/download/${version}/potrace-${version}.tar.gz";
+    sha256 = "0fqpfq5wwqz8j6pfh4p2pbflf6r86s4h63r8jawzrsyvpbbz3fxh";
   };
 
-  configureFlags = ["--with-libpotrace"];
+  configureFlags = [ "--with-libpotrace" ];
 
   buildInputs = [ zlib ];
 
diff --git a/pkgs/applications/graphics/processing/default.nix b/pkgs/applications/graphics/processing/default.nix
index ecce0e260bb2..69e5ccb85ec9 100644
--- a/pkgs/applications/graphics/processing/default.nix
+++ b/pkgs/applications/graphics/processing/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, ant, jre, makeWrapper, libXxf86vm, which }:
+{ fetchurl, stdenv, ant, jdk, makeWrapper, libXxf86vm, which }:
 
 stdenv.mkDerivation rec {
   name = "processing-${version}";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   # Stop it trying to download its own version of java
   patches = [ ./use-nixpkgs-jre.patch ];
 
-  buildInputs = [ ant jre makeWrapper libXxf86vm which ];
+  buildInputs = [ ant jdk makeWrapper libXxf86vm which ];
 
   buildPhase = "cd build && ant build";
 
@@ -21,12 +21,12 @@ stdenv.mkDerivation rec {
     mkdir -p $out/bin
    cp -r linux/work/* $out/${name}/
    makeWrapper $out/${name}/processing $out/bin/processing \
-     --prefix PATH : "${jre}/bin:${which}/bin" \
+     --prefix PATH : "${jdk}/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 PATH : "${jdk}/bin:${which}/bin" \
      --prefix LD_LIBRARY_PATH : ${libXxf86vm}/lib
-   ln -s ${jre} $out/${name}/java
+   ln -s ${jdk} $out/${name}/java
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/graphics/sane/backends.nix b/pkgs/applications/graphics/sane/backends.nix
index 743215493187..66fc4810e7d9 100644
--- a/pkgs/applications/graphics/sane/backends.nix
+++ b/pkgs/applications/graphics/sane/backends.nix
@@ -20,6 +20,8 @@ stdenv.mkDerivation rec {
     sha256 = "0ba68m6bzni54axjk15i51rya7hfsdliwvqyan5msl7iaid0iir7";
   };
 
+  outputs = [ "out" "doc" "man" ];
+
   udevSupport = hotplugSupport;
 
   configureFlags = stdenv.lib.optional (libusb != null) "--enable-libusb_1_0";
diff --git a/pkgs/applications/graphics/sane/config.nix b/pkgs/applications/graphics/sane/config.nix
index fc1cd81ebc6e..4b8c7a4fe921 100644
--- a/pkgs/applications/graphics/sane/config.nix
+++ b/pkgs/applications/graphics/sane/config.nix
@@ -4,17 +4,27 @@
 
 with stdenv.lib;
 let installSanePath = path: ''
-      find "${path}/lib/sane" -not -type d -maxdepth 1 | while read backend; do
-        ln -s $backend $out/lib/sane/$(basename $backend)
-      done
+      if test -e "${path}/lib/sane"; then
+        find "${path}/lib/sane" -maxdepth 1 -not -type d | while read backend; do
+          ln -s $backend $out/lib/sane/$(basename $backend)
+        done
+      fi
 
-      find "${path}/etc/sane.d" -not -type d -maxdepth 1 | while read conf; do
-        ln -s $conf $out/etc/sane.d/$(basename $conf)
-      done
+      if test -e "${path}/etc/sane.d"; then
+        find "${path}/etc/sane.d" -maxdepth 1 -not -type d | while read conf; do
+          if test $(basename $conf) = "dll.conf"; then
+            cat $conf >> $out/etc/sane.d/dll.conf
+          else
+            ln -s $conf $out/etc/sane.d/$(basename $conf)
+          fi
+        done
+      fi
 
-      find "${path}/etc/sane.d/dll.d" -not -type d -maxdepth 1 | while read conf; do
-        ln -s $conf $out/etc/sane.d/dll.d/$(basename $conf)
-      done
+      if test -e "${path}/etc/sane.d/dll.d"; then
+        find "${path}/etc/sane.d/dll.d" -maxdepth 1 -not -type d | while read conf; do
+          ln -s $conf $out/etc/sane.d/dll.d/$(basename $conf)
+        done
+      fi
     '';
 in
 stdenv.mkDerivation {
diff --git a/pkgs/applications/graphics/shotwell/default.nix b/pkgs/applications/graphics/shotwell/default.nix
index 629126503c92..052ba9402bed 100644
--- a/pkgs/applications/graphics/shotwell/default.nix
+++ b/pkgs/applications/graphics/shotwell/default.nix
@@ -1,23 +1,11 @@
-{ fetchurl, stdenv, m4, glibc, gtk3, libexif, libgphoto2, libsoup, libxml2, vala, sqlite, webkitgtk24x
-, pkgconfig, gnome3, gst_all_1, which, udev, libraw, glib, json_glib, gettext, desktop_file_utils
-, lcms2, gdk_pixbuf, librsvg, makeWrapper, gnome_doc_utils, hicolor_icon_theme }:
+{ fetchurl, stdenv, m4, glibc, gtk3, libexif, libgphoto2, libsoup, libxml2, vala, sqlite
+, webkitgtk24x, pkgconfig, gnome3, gst_all_1, which, udev, libraw, glib, json_glib
+, gettext, desktop_file_utils, lcms2, gdk_pixbuf, librsvg, makeWrapper
+, gnome_doc_utils, hicolor_icon_theme }:
 
 # for dependencies see http://www.yorba.org/projects/shotwell/install/
 
-let
-  rest = stdenv.mkDerivation rec {
-    name = "rest-0.7.12";
-
-    src = fetchurl {
-      url = "mirror://gnome/sources/rest/0.7/${name}.tar.xz";
-      sha256 = "0fmg7fq5fx0jg3ryk71kwdkspsvj42acxy9imk7vznkqj29a9zqn";
-    };
-    
-    configureFlags = "--with-ca-certificates=/etc/ssl/certs/ca-bundle.crt";
-    
-    buildInputs = [ pkgconfig glib libsoup ];
-  };
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   version = "0.20.2";
   name = "shotwell-${version}";
 
@@ -27,9 +15,9 @@ in stdenv.mkDerivation rec {
   };
 
   NIX_CFLAGS_COMPILE = "-I${glib}/include/glib-2.0 -I${glib}/lib/glib-2.0/include";
-  
+
   configureFlags = [ "--disable-gsettings-convert-install" ];
-  
+
   preConfigure = ''
     patchShebangs .
   '';
@@ -47,12 +35,12 @@ in stdenv.mkDerivation rec {
   '';
 
 
-  buildInputs = [ m4 glibc gtk3 libexif libgphoto2 libsoup libxml2 vala sqlite webkitgtk24x pkgconfig
-                  gst_all_1.gstreamer gst_all_1.gst-plugins-base gnome3.libgee which udev gnome3.gexiv2
-                  libraw rest json_glib gettext desktop_file_utils glib lcms2 gdk_pixbuf librsvg
-                  makeWrapper gnome_doc_utils
-                  gnome3.gnome_icon_theme gnome3.gnome_icon_theme_symbolic
-                  hicolor_icon_theme ];
+  buildInputs = [ m4 glibc gtk3 libexif libgphoto2 libsoup libxml2 vala sqlite webkitgtk24x
+                  pkgconfig gst_all_1.gstreamer gst_all_1.gst-plugins-base gnome3.libgee
+                  which udev gnome3.gexiv2 hicolor_icon_theme
+                  libraw json_glib gettext desktop_file_utils glib lcms2 gdk_pixbuf librsvg
+                  makeWrapper gnome_doc_utils gnome3.rest
+                  gnome3.defaultIconTheme ];
 
   meta = with stdenv.lib; {
     description = "Popular photo organizer for the GNOME desktop";
diff --git a/pkgs/applications/graphics/simple-scan/default.nix b/pkgs/applications/graphics/simple-scan/default.nix
index b47a8215fd46..c5d1b936233b 100644
--- a/pkgs/applications/graphics/simple-scan/default.nix
+++ b/pkgs/applications/graphics/simple-scan/default.nix
@@ -1,16 +1,30 @@
-{ stdenv, fetchurl, cairo, colord, glib, gtk3, intltool, itstool, libxml2
-, makeWrapper, pkgconfig, saneBackends, systemd, vala }:
+{ stdenv, fetchurl, cairo, colord, glib, gtk3, gusb, intltool, itstool, libusb
+, libxml2, makeWrapper, packagekit, pkgconfig, saneBackends, systemd, vala }:
 
-let version = "3.16.0.1"; in
+let version = "3.18.0"; in
 stdenv.mkDerivation rec {
   name = "simple-scan-${version}";
 
   src = fetchurl {
-    sha256 = "0p1knmbrdwrnjjk5x0szh3ja2lfamaaynj2ai92zgci2ma5xh2ma";
-    url = "https://launchpad.net/simple-scan/3.16/${version}/+download/${name}.tar.xz";
+    sha256 = "09qki4h1px65fxwpr7jppzqsi5cfcb8168p13blp3wcfizjgb9gl";
+    url = "https://launchpad.net/simple-scan/3.18/${version}/+download/${name}.tar.xz";
   };
 
+  buildInputs = [ cairo colord glib gusb gtk3 libusb libxml2 packagekit
+    saneBackends systemd vala ];
+  nativeBuildInputs = [ intltool itstool makeWrapper pkgconfig ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  preFixup = ''
+    wrapProgram "$out/bin/simple-scan" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
+
   meta = with stdenv.lib; {
+    inherit version;
     description = "Simple scanning utility";
     longDescription = ''
       A really easy way to scan both documents and photos. You can crop out the
@@ -21,20 +35,8 @@ stdenv.mkDerivation rec {
       interface is well tested.
     '';
     homepage = https://launchpad.net/simple-scan;
-    license = with licenses; gpl3Plus;
-    platforms = with platforms; linux;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
     maintainers = with maintainers; [ nckx ];
   };
-
-  buildInputs = [ cairo colord glib gtk3 intltool itstool libxml2 makeWrapper
-    pkgconfig saneBackends systemd vala ];
-
-  enableParallelBuilding = true;
-
-  doCheck = true;
-
-  preFixup = ''
-    wrapProgram "$out/bin/simple-scan" \
-      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
-  '';
 }
diff --git a/pkgs/applications/graphics/solvespace/default.nix b/pkgs/applications/graphics/solvespace/default.nix
index cba69c476b54..67513bcf9230 100644
--- a/pkgs/applications/graphics/solvespace/default.nix
+++ b/pkgs/applications/graphics/solvespace/default.nix
@@ -4,7 +4,7 @@
 stdenv.mkDerivation {
   name = "solvespace-2.0";
   src = fetchgit {
-    url = "https://gitorious.org/solvespace/solvespace.git";
+    url = "https://github.com/jwesthues/solvespace.git";
     sha256 = "0sakxkmj2f0k27f67wy1xz2skpnwzg15yqrf7av97pgc5s8xb3da";
     rev = "e587d0e";
   };
diff --git a/pkgs/applications/graphics/synfigstudio/default.nix b/pkgs/applications/graphics/synfigstudio/default.nix
index 9fa624435ed4..372c11b5bda5 100644
--- a/pkgs/applications/graphics/synfigstudio/default.nix
+++ b/pkgs/applications/graphics/synfigstudio/default.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchurl, boost, cairo, fontsConf, gettext, glibmm, gtk, gtkmm
-, libsigcxx, libtool, libxmlxx, pango, pkgconfig, imagemagick
-, intltool
+{ stdenv, fetchurl, boost, cairo, fontsConf, gettext, glibmm, gtk3, gtkmm3
+, libjack2, libsigcxx, libtool, libxmlxx, makeWrapper, mlt-qt5, pango, pkgconfig
+, imagemagick, intltool
 }:
 
 let
-  version = "0.64.3";
+  version = "1.0.1";
 
   ETL = stdenv.mkDerivation rec {
-    name = "ETL-0.04.17";
+    name = "ETL-0.04.19";
 
     src = fetchurl {
-       url = "mirror://sourceforge/synfig/${name}.tar.gz";
-       sha256 = "0rb9czkgan41q6xlck97kh77g176vjm1wnq620sqky7k2hiahr3s";
+       url = "http://download.tuxfamily.org/synfig/releases/${version}/${name}.tar.gz";
+       sha256 = "1zmqv2fa5zxprza3wbhk5mxjk7491jqshxxai92s7fdiza0nhs91";
     };
   };
 
@@ -19,8 +19,8 @@ let
     name = "synfig-${version}";
 
     src = fetchurl {
-       url = "mirror://sourceforge/synfig/synfig-${version}.tar.gz";
-       sha256 = "0p4wqjidb4k3viahck4wzbh777f5ifpivn4vxhxs5fbq8nsvqksh";
+       url = "http://download.tuxfamily.org/synfig/releases/${version}/${name}.tar.gz";
+       sha256 = "0l1f2xwmzds32g46fqwsq7j5qlnfps6944chbv14d3ynzgyyp1i3";
     };
 
     configureFlags = [
@@ -28,10 +28,8 @@ let
       "--with-boost-libdir=${boost.lib}/lib"
     ];
 
-    patches = [ ./synfig-cstring.patch ];
-
     buildInputs = [
-      ETL boost cairo gettext glibmm libsigcxx libtool libxmlxx pango
+      ETL boost cairo gettext glibmm mlt-qt5 libsigcxx libtool libxmlxx pango
       pkgconfig
     ];
   };
@@ -40,22 +38,19 @@ stdenv.mkDerivation rec {
   name = "synfigstudio-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/synfig/${name}.tar.gz";
-    sha256 = "1li3ac8qvg25h9fgym0zywnq5bg3sgbv162xs4c6pwksn75i6gsv";
+    url = "http://download.tuxfamily.org/synfig/releases/${version}/${name}.tar.gz";
+    sha256 = "0jfa946rfh0dbagp18zknlj9ffrd4h45xcy2dh2vlhn6jdm08yfi";
   };
 
   buildInputs = [
-    ETL boost cairo gettext glibmm gtk gtkmm imagemagick intltool
-    intltool libsigcxx libtool libxmlxx pkgconfig synfig
-  ];
-
-  configureFlags = [
-    "--with-boost=${boost.dev}"
-    "--with-boost-libdir=${boost.lib}/lib"
+    ETL boost cairo gettext glibmm gtk3 gtkmm3 imagemagick intltool
+    libjack2 libsigcxx libtool libxmlxx makeWrapper mlt-qt5 pkgconfig
+    synfig
   ];
 
-  preBuild = ''
-    export FONTCONFIG_FILE=${fontsConf}
+  postInstall = ''
+    wrapProgram "$out/bin/synfigstudio" \
+      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/applications/graphics/synfigstudio/synfig-cstring.patch b/pkgs/applications/graphics/synfigstudio/synfig-cstring.patch
deleted file mode 100644
index 51eb77042161..000000000000
--- a/pkgs/applications/graphics/synfigstudio/synfig-cstring.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-http://www.synfig.org/issues/thebuggenie/synfig/issues/438
---- a/src/modules/mod_png/trgt_png.cpp
-+++ b/src/modules/mod_png/trgt_png.cpp
-@@ -39,6 +39,7 @@
- #include <algorithm>
- #include <functional>
- #include <ETL/misc>
-+#include <cstring>
- 
- #endif
- 
-
diff --git a/pkgs/applications/graphics/tesseract/default.nix b/pkgs/applications/graphics/tesseract/default.nix
index 83aff09e2aae..b531c41e2d8a 100644
--- a/pkgs/applications/graphics/tesseract/default.nix
+++ b/pkgs/applications/graphics/tesseract/default.nix
@@ -1,26 +1,31 @@
-{ stdenv, fetchurl, autoconf, automake, libtool, leptonica, libpng, libtiff }:
+{ stdenv, fetchurl, autoconf, automake, libtool, leptonica, libpng, libtiff
+, enableLanguages ? null
+}:
+
+with stdenv.lib;
 
 let
   majVersion = "3.02";
   version = "${majVersion}.02";
 
-  f = lang : sha256 : let
-      src = fetchurl {
-        url = "http://tesseract-ocr.googlecode.com/files/tesseract-ocr-${majVersion}.${lang}.tar.gz";
-        inherit sha256;
-      };
-    in
-      "tar xfvz ${src} -C $out/share/ --strip=1";
-
-  extraLanguages = ''
-    ${f "cat" "0d1smiv1b3k9ay2s05sl7q08mb3ln4w5iiiymv2cs8g8333z8jl9"}
-    ${f "rus" "059336mkhsj9m3hwfb818xjlxkcdpy7wfgr62qwz65cx914xl709"}
-    ${f "spa" "1c9iza5mbahd9pa7znnq8yv09v5kz3gbd2sarcgcgc1ps1jc437l"}
-    ${f "nld" "162acxp1yb6gyki2is3ay2msalmfcsnrlsd9wml2ja05k94m6bjy"}
-    ${f "eng" "1y5xf794n832s3lymzlsdm2s9nlrd2v27jjjp0fd9xp7c2ah4461"}
-    ${f "slv" "0rqng43435cly32idxm1lvxkcippvc3xpxbfizwq5j0155ym00dr"}
-    ${f "jpn" "07v8pymd0iwyzh946lxylybda20gsw7p4fsb09jw147955x49gq9"}
-  '';
+  mkLang = lang: sha256: let
+    src = fetchurl {
+      url = "http://tesseract-ocr.googlecode.com/files/tesseract-ocr-${majVersion}.${lang}.tar.gz";
+      inherit sha256;
+    };
+  in "tar xfvz ${src} -C $out/share/ --strip=1";
+
+  wantLang = name: const (enableLanguages == null || elem name enableLanguages);
+
+  extraLanguages = mapAttrsToList mkLang (filterAttrs wantLang {
+    cat = "0d1smiv1b3k9ay2s05sl7q08mb3ln4w5iiiymv2cs8g8333z8jl9";
+    rus = "059336mkhsj9m3hwfb818xjlxkcdpy7wfgr62qwz65cx914xl709";
+    spa = "1c9iza5mbahd9pa7znnq8yv09v5kz3gbd2sarcgcgc1ps1jc437l";
+    nld = "162acxp1yb6gyki2is3ay2msalmfcsnrlsd9wml2ja05k94m6bjy";
+    eng = "1y5xf794n832s3lymzlsdm2s9nlrd2v27jjjp0fd9xp7c2ah4461";
+    slv = "0rqng43435cly32idxm1lvxkcippvc3xpxbfizwq5j0155ym00dr";
+    jpn = "07v8pymd0iwyzh946lxylybda20gsw7p4fsb09jw147955x49gq9";
+  });
 in
 
 stdenv.mkDerivation rec {
@@ -40,7 +45,7 @@ stdenv.mkDerivation rec {
                   'LIBLEPT_HEADERSDIR=${leptonica}/include'
   '';
 
-  postInstall = extraLanguages;
+  postInstall = concatStringsSep "; " extraLanguages;
 
   meta = {
     description = "OCR engine";
diff --git a/pkgs/applications/graphics/xaos/default.nix b/pkgs/applications/graphics/xaos/default.nix
index cacefc9bcc12..7e01d3847d56 100644
--- a/pkgs/applications/graphics/xaos/default.nix
+++ b/pkgs/applications/graphics/xaos/default.nix
@@ -1,4 +1,4 @@
-a :
+a @ { libXt, libX11, libXext, xextproto, xproto, gsl, aalib, zlib, intltool, gettext, perl, ... }:
 let
   fetchurl = a.fetchurl;
 
diff --git a/pkgs/applications/graphics/xfig/builder.sh b/pkgs/applications/graphics/xfig/builder.sh
index bb1cd7f49c48..9d95eca01226 100644
--- a/pkgs/applications/graphics/xfig/builder.sh
+++ b/pkgs/applications/graphics/xfig/builder.sh
@@ -5,8 +5,7 @@ makeFlags="XAWLIB=-lXaw3d BINDIR=$out/bin XAPPLOADDIR=$out/etc/X11/app-defaults
 # We need chmod +wx on dirs, not just chmod +w
 dontMakeSourcesWritable=1
 postUnpack() {
-	find . -type d | xargs -n1 chmod +x
-	find . -type d | xargs -n1 chmod +x
+    find . -type d -exec chmod +x '{}' \;
 }
 
 preBuild() {
diff --git a/pkgs/applications/graphics/xfig/default.nix b/pkgs/applications/graphics/xfig/default.nix
index 88183c5e5a3b..9e53fe3efe2c 100644
--- a/pkgs/applications/graphics/xfig/default.nix
+++ b/pkgs/applications/graphics/xfig/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, makeWrapper, imake
-, x11, libXpm, libXmu, libXi, libXp, Xaw3d, libpng, libjpeg}:
+, xlibsWrapper, libXpm, libXmu, libXi, libXp, Xaw3d, libpng, libjpeg}:
 
 let version = "3.2.5b"; in
 stdenv.mkDerivation {
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   builder = ./builder.sh;
 
-  buildInputs = [x11 libXpm libXmu libXi libXp Xaw3d libpng libjpeg];
+  buildInputs = [xlibsWrapper libXpm libXmu libXi libXp Xaw3d libpng libjpeg];
 
   nativeBuildInputs = [ imake makeWrapper ];
 
diff --git a/pkgs/applications/graphics/yed/default.nix b/pkgs/applications/graphics/yed/default.nix
index 6e9a1fdeb095..e3b7d001174f 100644
--- a/pkgs/applications/graphics/yed/default.nix
+++ b/pkgs/applications/graphics/yed/default.nix
@@ -1,11 +1,12 @@
-{ stdenv, fetchurl, makeWrapper, unzip, jre }:
+{ stdenv, fetchurl, requireFile, makeWrapper, unzip, jre }:
 
 stdenv.mkDerivation rec {
-  name = "yEd-3.14.1";
+  name = "yEd-3.14.3";
 
-  src = fetchurl {
-    url = "http://www.yworks.com/products/yed/demo/${name}.zip";
-    sha256 = "09zik3pjs5x0vc0jvndm762blk85y44lxac3vdfqqbinwd9gfnm2";
+  src = requireFile {
+    name = "${name}.zip";
+    url = "https://www.yworks.com/en/products/yfiles/yed/";
+    sha256 = "0xgazknbz82sgk65hxmvbycl1vd25z80a7jgwjgw7syicrgmplcl";
   };
 
   nativeBuildInputs = [ unzip makeWrapper ];
@@ -20,7 +21,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    license = licenses.unfreeRedistributable;
+    license = licenses.unfree;
     homepage = http://www.yworks.com/en/products/yfiles/yed/;
     description = "A powerful desktop application that can be used to quickly and effectively generate high-quality diagrams";
     platforms = jre.meta.platforms;
diff --git a/pkgs/applications/graphics/zgrviewer/default.nix b/pkgs/applications/graphics/zgrviewer/default.nix
index a6c299d1ab3a..724bddda6cf0 100644
--- a/pkgs/applications/graphics/zgrviewer/default.nix
+++ b/pkgs/applications/graphics/zgrviewer/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     # Quicker to unpack locally than load Hydra
     hydraPlatforms = [];
     maintainers = with stdenv.lib.maintainers; [raskin];
-    license = with stdenv.lib.licenses; lgpl21Plus;
+    license = stdenv.lib.licenses.lgpl21Plus;
     description = "GraphViz graph viewer/navigator";
   };
 }