summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2018-04-29 02:59:26 +0200
committerJan Tojnar <jtojnar@gmail.com>2018-04-29 08:39:06 +0200
commit63a234c4a720f3457801043276e1884e451d3b85 (patch)
treef32eae23b4cbc9a825a6c7eaf236a8e8c420772b /pkgs/applications/graphics
parent882682827a0c23537951d3ad0241df11b3dbb36e (diff)
downloadnixlib-63a234c4a720f3457801043276e1884e451d3b85.tar
nixlib-63a234c4a720f3457801043276e1884e451d3b85.tar.gz
nixlib-63a234c4a720f3457801043276e1884e451d3b85.tar.bz2
nixlib-63a234c4a720f3457801043276e1884e451d3b85.tar.lz
nixlib-63a234c4a720f3457801043276e1884e451d3b85.tar.xz
nixlib-63a234c4a720f3457801043276e1884e451d3b85.tar.zst
nixlib-63a234c4a720f3457801043276e1884e451d3b85.zip
ufraw: build gimp plugin
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/gimp/plugins/default.nix27
-rw-r--r--pkgs/applications/graphics/ufraw/default.nix24
2 files changed, 21 insertions, 30 deletions
diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix
index 444fb37ae338..86e3c4e20c54 100644
--- a/pkgs/applications/graphics/gimp/plugins/default.nix
+++ b/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -179,32 +179,7 @@ rec {
       installPhase = "installPlugins gmic_gimp";
   };
 
-  # this is more than a gimp plugin !
-  # either load the raw image with gimp (and the import dialog will popup)
-  # or use the binary
-  ufraw = pluginDerivation rec {
-    name = "ufraw-0.19.2";
-    buildInputs = with pkgs; [ gtkimageview lcms ];
-      # --enable-mime - install mime files, see README for more information
-      # --enable-extras - build extra (dcraw, nikon-curve) executables
-      # --enable-dst-correction - enable DST correction for file timestamps.
-      # --enable-contrast - enable the contrast setting option.
-      # --enable-interp-none: enable 'None' interpolation (mostly for debugging).
-      # --with-lensfun: use the lensfun library - experimental feature, read this before using it.
-      # --with-prefix=PREFIX - use also PREFIX as an input prefix for the build
-      # --with-dosprefix=PREFIX - PREFIX in the the prefix in dos format (needed only for ms-window
-    configureFlags = "--enable-extras --enable-dst-correction --enable-contrast";
-
-    src = fetchurl {
-      url = "mirror://sourceforge/ufraw/${name}.tar.gz";
-      sha256 = "1lxba7pb3vcsq94dwapg9bk9mb3ww6r3pvvcyb0ah5gh2sgzxgkk";
-    };
-    installPhase = "
-      installPlugins ufraw-gimp
-      mkdir -p $out/bin
-      cp ufraw $out/bin
-    ";
-  };
+  ufraw = pkgs.ufraw.gimpPlugin;
 
   gimplensfun = pluginDerivation rec {
     version = "0.2.4";
diff --git a/pkgs/applications/graphics/ufraw/default.nix b/pkgs/applications/graphics/ufraw/default.nix
index fc8e7a62c2ba..cb1c37aefebf 100644
--- a/pkgs/applications/graphics/ufraw/default.nix
+++ b/pkgs/applications/graphics/ufraw/default.nix
@@ -1,6 +1,9 @@
 { fetchurl, stdenv, pkgconfig, gtk2, gettext, bzip2, zlib
+, withGimpPlugin ? true, gimp ? null
 , libjpeg, libtiff, cfitsio, exiv2, lcms2, gtkimageview, lensfun }:
 
+assert withGimpPlugin -> gimp != null;
+
 stdenv.mkDerivation rec {
   name = "ufraw-0.22";
 
@@ -10,10 +13,23 @@ stdenv.mkDerivation rec {
     sha256 = "0pm216pg0vr44gwz9vcvq3fsf8r5iayljhf5nis2mnw7wn6d5azp";
   };
 
-  buildInputs =
-    [ pkgconfig gtk2 gtkimageview gettext bzip2 zlib
-      libjpeg libtiff cfitsio exiv2 lcms2 lensfun
-    ];
+  outputs = [ "out" ] ++ stdenv.lib.optional withGimpPlugin "gimpPlugin";
+
+  nativeBuildInputs = [ pkgconfig gettext ];
+  buildInputs = [
+    gtk2 gtkimageview bzip2 zlib
+    libjpeg libtiff cfitsio exiv2 lcms2 lensfun
+  ] ++ stdenv.lib.optional withGimpPlugin gimp;
+
+  configureFlags = [
+    "--enable-extras"
+    "--enable-dst-correction"
+    "--enable-contrast"
+  ] ++ stdenv.lib.optional withGimpPlugin "--with-gimp";
+
+  postInstall = stdenv.lib.optionalString withGimpPlugin ''
+    moveToOutput "lib/gimp" "$gimpPlugin"
+  '';
 
   meta = {
     homepage = http://ufraw.sourceforge.net/;