gimp-with-plugins: install plug-ins into subdirs

GIMP 3 will require all plugins to be installed into their own subdirectories, so let’s just do that now.
This commit is contained in:
Jan Tojnar 2019-11-03 04:35:30 +01:00
parent ae21a2bc60
commit 8da26cc578
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -8,22 +8,24 @@ let
inherit (pkgs) stdenv fetchurl pkgconfig intltool glib fetchFromGitHub; inherit (pkgs) stdenv fetchurl pkgconfig intltool glib fetchFromGitHub;
inherit (gimp) targetPluginDir targetScriptDir; inherit (gimp) targetPluginDir targetScriptDir;
pluginDerivation = a: stdenv.mkDerivation ({ pluginDerivation = a: let
name = a.name or "${a.pname}-${a.version}";
in stdenv.mkDerivation ({
prePhases = "extraLib"; prePhases = "extraLib";
extraLib = '' extraLib = ''
installScripts(){ installScripts(){
mkdir -p $out/${targetScriptDir}; mkdir -p $out/${targetScriptDir}/${name};
for p in "$@"; do cp "$p" $out/${targetScriptDir}; done for p in "$@"; do cp "$p" -r $out/${targetScriptDir}/${name}; done
} }
installPlugins(){ installPlugins(){
mkdir -p $out/${targetPluginDir}; mkdir -p $out/${targetPluginDir}/${name};
for p in "$@"; do cp "$p" $out/${targetPluginDir}; done for p in "$@"; do cp "$p" -r $out/${targetPluginDir}/${name}; done
} }
''; '';
} }
// a // a
// { // {
name = "gimp-plugin-${a.name or "${a.pname}-${a.version}"}"; name = "gimp-plugin-${name}";
buildInputs = [ gimp gimp.gtk glib ] ++ (a.buildInputs or []); buildInputs = [ gimp gimp.gtk glib ] ++ (a.buildInputs or []);
nativeBuildInputs = [ pkgconfig intltool ] ++ (a.nativeBuildInputs or []); nativeBuildInputs = [ pkgconfig intltool ] ++ (a.nativeBuildInputs or []);
} }