2020-08-10 21:24:20 +00:00
|
|
|
{ lib
|
|
|
|
, inkscape
|
|
|
|
, symlinkJoin
|
|
|
|
, makeWrapper
|
2021-06-24 23:25:41 +00:00
|
|
|
, inkscapeExtensions ? [ ]
|
|
|
|
, inkscape-extensions
|
2020-08-10 21:24:20 +00:00
|
|
|
}:
|
|
|
|
|
2021-06-24 23:25:41 +00:00
|
|
|
let
|
|
|
|
allExtensions = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues inkscape-extensions);
|
|
|
|
selectedExtensions = if inkscapeExtensions == null then allExtensions else inkscapeExtensions;
|
|
|
|
in
|
|
|
|
|
2020-08-10 21:24:20 +00:00
|
|
|
symlinkJoin {
|
|
|
|
name = "inkscape-with-extensions-${lib.getVersion inkscape}";
|
|
|
|
|
2021-06-24 23:25:41 +00:00
|
|
|
paths = [ inkscape ] ++ selectedExtensions;
|
2020-08-10 21:24:20 +00:00
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-08-10 21:24:20 +00:00
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
rm -f $out/bin/inkscape
|
|
|
|
makeWrapper "${inkscape}/bin/inkscape" "$out/bin/inkscape" --set INKSCAPE_DATADIR "$out/share"
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit (inkscape) meta;
|
|
|
|
}
|