gimp: add version to derivation, use symlinkJoin for a wrapper

+8 -14
+2 -1
pkgs/applications/graphics/gimp/2.8.nix
··· 4 4 , python, pygtk, libart_lgpl, libexif, gettext, xorg, wrapPython }: 5 5 6 6 stdenv.mkDerivation rec { 7 - name = "gimp-2.8.16"; 7 + name = "gimp-${version}"; 8 + version = "2.8.16"; 8 9 9 10 # This declarations for `gimp-with-plugins` wrapper, 10 11 # (used for determining $out/lib/gimp/${majorVersion}/ paths)
+6 -13
pkgs/applications/graphics/gimp/wrapper.nix
··· 1 - { stdenv, lib, buildEnv, gimp, makeWrapper, gimpPlugins, plugins ? null}: 1 + { stdenv, lib, symlinkJoin, gimp, makeWrapper, gimpPlugins, plugins ? null}: 2 2 3 3 let 4 4 allPlugins = lib.filter (pkg: builtins.isAttrs pkg && pkg.type == "derivation") (lib.attrValues gimpPlugins); 5 5 selectedPlugins = if plugins == null then allPlugins else plugins; 6 6 extraArgs = map (x: x.wrapArgs or "") selectedPlugins; 7 7 8 - drv = buildEnv { 9 - name = "gimp-with-plugins-" + (builtins.parseDrvName gimp.name).version; 8 + in symlinkJoin { 9 + name = "gimp-with-plugins-${gimp.version}"; 10 10 11 11 paths = [ gimp ] ++ selectedPlugins; 12 + 13 + buildInputs = [ makeWrapper ]; 12 14 13 15 postBuild = '' 14 - # TODO: This could be avoided if buildEnv could be forced to create all directories 15 - if [ -L $out/bin ]; then 16 - rm $out/bin 17 - mkdir $out/bin 18 - for i in ${gimp}/bin/*; do 19 - ln -s $i $out/bin 20 - done 21 - fi 22 16 for each in gimp-2.8 gimp-console-2.8; do 23 17 wrapProgram $out/bin/$each \ 24 18 --set GIMP2_PLUGINDIR "$out/lib/gimp/2.0" \ ··· 29 23 ln -sf "$each-2.8" $out/bin/$each 30 24 done 31 25 ''; 32 - }; 33 - in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; }) 26 + }