summary refs log tree commit diff
path: root/pkgs/applications/misc/camunda-modeler/default.nix
blob: c9caa508f171f065e1429c2e079bda111a5568ca (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{ stdenvNoCC
, lib
, fetchurl
, electron
, makeWrapper
, makeDesktopItem
, copyDesktopItems
}:

stdenvNoCC.mkDerivation rec {
  pname = "camunda-modeler";
  version = "5.17.0";

  src = fetchurl {
    url = "https://github.com/camunda/camunda-modeler/releases/download/v${version}/camunda-modeler-${version}-linux-x64.tar.gz";
    hash = "sha256-yxph3Aor5nZOhu2PY4MGcfScaz9w24JXqXbhT+QKlNI=";
  };
  sourceRoot = "camunda-modeler-${version}-linux-x64";

  dontConfigure = true;
  dontBuild = true;

  nativeBuildInputs = [
    makeWrapper
    copyDesktopItems
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin $out/share/${pname}
    cp -a {locales,resources} $out/share/${pname}
    install -Dm644 support/mime-types.xml $out/share/mime/packages/${pname}.xml

    for SIZE in 16 48 128; do
      install -D -m0644 support/icon_''${SIZE}.png "$out/share/icons/hicolor/''${SIZE}x''${SIZE}/apps/${pname}.png"
    done

    runHook postInstall
  '';

  postFixup = ''
    makeWrapper ${electron}/bin/electron $out/bin/${pname} \
      --add-flags $out/share/${pname}/resources/app.asar
  '';

  desktopItems = [
    (makeDesktopItem {
      name = pname;
      exec = pname;
      desktopName = "Camunda Modeler";
      icon = pname;
      keywords = [ "bpmn" "cmmn" "dmn" "form" "modeler" "camunda"];
      genericName = "Process Modeling Tool";
      comment = meta.description;
      mimeTypes = [ "application/bpmn" "application/cmmn" "application/dmn" "application/camunda-form" ];
      extraConfig = {
        X-Ayatana-Desktop-Shortcuts = "NewWindow;RepositoryBrowser";
      };
    })
  ];

  meta = with lib; {
    homepage = "https://github.com/camunda/camunda-modeler";
    description = "An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io";
    maintainers = teams.wdz.members;
    license = licenses.mit;
    inherit (electron.meta) platforms;
  };
}