Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
27 lines
673 B
Nix
27 lines
673 B
Nix
{ lib
|
|
, inkscape
|
|
, symlinkJoin
|
|
, makeWrapper
|
|
, inkscapeExtensions ? [ ]
|
|
, inkscape-extensions
|
|
}:
|
|
|
|
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
|
|
|
|
symlinkJoin {
|
|
name = "inkscape-with-extensions-${lib.getVersion inkscape}";
|
|
|
|
paths = [ inkscape ] ++ selectedExtensions;
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
postBuild = ''
|
|
rm -f $out/bin/inkscape
|
|
makeWrapper "${inkscape}/bin/inkscape" "$out/bin/inkscape" --set INKSCAPE_DATADIR "$out/share"
|
|
'';
|
|
|
|
inherit (inkscape) meta;
|
|
}
|