about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/graphics/inkscape/with-extensions.nix
blob: 14fffadd0360607081c8ab455876f3760f92c7d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ 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;
}