about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-04-26 15:26:45 +0300
committerNikolay Amiantov <ab@fmap.me>2016-04-26 15:37:42 +0300
commitd04dafd64eaaff5b55ba277662a7ec376cc2f10f (patch)
tree356b363633da44fa4e853779df994f809fdf25d9 /pkgs
parent41b6a178260ad1fe627c0a9faf795920b4dd68dc (diff)
downloadnixlib-d04dafd64eaaff5b55ba277662a7ec376cc2f10f.tar
nixlib-d04dafd64eaaff5b55ba277662a7ec376cc2f10f.tar.gz
nixlib-d04dafd64eaaff5b55ba277662a7ec376cc2f10f.tar.bz2
nixlib-d04dafd64eaaff5b55ba277662a7ec376cc2f10f.tar.lz
nixlib-d04dafd64eaaff5b55ba277662a7ec376cc2f10f.tar.xz
nixlib-d04dafd64eaaff5b55ba277662a7ec376cc2f10f.tar.zst
nixlib-d04dafd64eaaff5b55ba277662a7ec376cc2f10f.zip
gimp: add version to derivation, use symlinkJoin for a wrapper
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/graphics/gimp/2.8.nix3
-rw-r--r--pkgs/applications/graphics/gimp/wrapper.nix19
2 files changed, 8 insertions, 14 deletions
diff --git a/pkgs/applications/graphics/gimp/2.8.nix b/pkgs/applications/graphics/gimp/2.8.nix
index b09838656929..5943cb9cdacf 100644
--- a/pkgs/applications/graphics/gimp/2.8.nix
+++ b/pkgs/applications/graphics/gimp/2.8.nix
@@ -4,7 +4,8 @@
 , python, pygtk, libart_lgpl, libexif, gettext, xorg, wrapPython }:
 
 stdenv.mkDerivation rec {
-  name = "gimp-2.8.16";
+  name = "gimp-${version}";
+  version = "2.8.16";
 
   # This declarations for `gimp-with-plugins` wrapper,
   # (used for determining $out/lib/gimp/${majorVersion}/ paths)
diff --git a/pkgs/applications/graphics/gimp/wrapper.nix b/pkgs/applications/graphics/gimp/wrapper.nix
index 53067dc39c9a..7455a69dde97 100644
--- a/pkgs/applications/graphics/gimp/wrapper.nix
+++ b/pkgs/applications/graphics/gimp/wrapper.nix
@@ -1,24 +1,18 @@
-{ stdenv, lib, buildEnv, gimp, makeWrapper, gimpPlugins, plugins ? null}:
+{ stdenv, lib, symlinkJoin, gimp, makeWrapper, gimpPlugins, plugins ? null}:
 
 let
 allPlugins = lib.filter (pkg: builtins.isAttrs pkg && pkg.type == "derivation") (lib.attrValues gimpPlugins);
 selectedPlugins = if plugins == null then allPlugins else plugins;
 extraArgs = map (x: x.wrapArgs or "") selectedPlugins;
 
-drv = buildEnv {
-  name = "gimp-with-plugins-" + (builtins.parseDrvName gimp.name).version;
+in symlinkJoin {
+  name = "gimp-with-plugins-${gimp.version}";
 
   paths = [ gimp ] ++ selectedPlugins;
 
+  buildInputs = [ makeWrapper ];
+
   postBuild = ''
-    # TODO: This could be avoided if buildEnv could be forced to create all directories
-    if [ -L $out/bin ]; then
-      rm $out/bin
-      mkdir $out/bin
-      for i in ${gimp}/bin/*; do
-        ln -s $i $out/bin
-      done
-    fi
     for each in gimp-2.8 gimp-console-2.8; do
       wrapProgram $out/bin/$each \
         --set GIMP2_PLUGINDIR "$out/lib/gimp/2.0" \
@@ -29,5 +23,4 @@ drv = buildEnv {
       ln -sf "$each-2.8" $out/bin/$each
     done
   '';
-  };
-in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })
+}