summary refs log tree commit diff
path: root/pkgs/applications/graphics/drawpile/default.nix
blob: abe3bd19f74401a1740f73632e4b4a6355c8c732 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{ lib
, mkDerivation
, fetchurl
, cmake
, extra-cmake-modules

# common deps
, karchive

# client deps
, qtbase
, qtmultimedia
, qtsvg
, qttools

# optional client deps
, giflib
, kdnssd
, libvpx
, miniupnpc
, qtx11extras # kis

# optional server deps
, libmicrohttpd
, libsodium

# options
, buildClient ? true
, buildServer ? true
, buildServerGui ? true # if false builds a headless server
, buildExtraTools ? false
, enableKisTablet ? false # enable improved graphics tablet support
}:

with lib;

let
  commonDeps = [
    karchive
  ];
  clientDeps = [
    qtbase
    qtmultimedia
    qtsvg
    qttools
    # optional:
    giflib # gif animation export support
    kdnssd # local server discovery with Zeroconf
    libvpx # WebM video export
    miniupnpc # automatic port forwarding
  ];
  serverDeps = [
    # optional:
    libmicrohttpd # HTTP admin api
    libsodium # ext-auth support
  ];
  kisDeps = [
    qtx11extras
  ];

in mkDerivation rec {
  pname = "drawpile";
  version = "2.1.16";

  src = fetchurl {
    url = "https://drawpile.net/files/src/drawpile-${version}.tar.gz";
    sha256 = "1mz64c1a5x906j2jqq7i16l1q1d97wgm2y0ybmmcyqzg09x9wyaw";
  };

  nativeBuildInputs = [
    cmake
    extra-cmake-modules
  ];
  buildInputs =
    commonDeps ++
    optionals buildClient      clientDeps ++
    optionals buildServer      serverDeps ++
    optionals enableKisTablet  kisDeps    ;

  cmakeFlags =
    optional (!buildClient    )  "-DCLIENT=off" ++
    optional (!buildServer    )  "-DSERVER=off" ++
    optional (!buildServerGui )  "-DSERVERGUI=off" ++
    optional ( buildExtraTools)  "-DTOOLS=on" ++
    optional ( enableKisTablet)  "-DKIS_TABLET=on";

  meta = {
    description = "A collaborative drawing program that allows multiple users to sketch on the same canvas simultaneously";
    homepage = https://drawpile.net/;
    downloadPage = https://drawpile.net/download/;
    license = licenses.gpl3;
    maintainers = with maintainers; [ fgaz ];
    platforms = platforms.unix;
  };
}