depot/third_party/nixpkgs/pkgs/applications/graphics/inkscape/with-extensions.nix
Default email 841d9c7fc1 Project import generated by Copybara.
GitOrigin-RevId: 3a8d7958a610cd3fec3a6f424480f91a1b259185
2021-06-29 00:13:55 +01:00

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;
}