22 # optional client deps
28 # optional server deps
31 , withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
37 , buildServerGui ? true # if false builds a headless server
38 , buildExtraTools ? false
41 assert lib.assertMsg (buildClient || buildServer || buildExtraTools)
42 "You must specify at least one of buildClient, buildServer, or buildExtraTools.";
53 giflib # gif animation export support
54 kdnssd # local server discovery with Zeroconf
55 libvpx # WebM video export
56 miniupnpc # automatic port forwarding
61 libmicrohttpd # HTTP admin api
62 libsodium # ext-auth support
63 ] ++ lib.optional withSystemd systemd;
69 src = fetchFromGitHub {
73 sha256 = "sha256-NS1aQlWpn3f+SW0oUjlYwHtOS9ZgbjFTrE9grjK5REM=";
76 cargoDeps = rustPlatform.fetchCargoTarball {
78 hash = "sha256-V36yiwraXK7qlJd1r8EtEA4ULxlgvMEmpn/ka3m9GjA=";
85 rustPlatform.cargoSetupHook
92 ++ lib.optionals buildClient clientDeps
93 ++ lib.optionals buildServer serverDeps;
96 (lib.cmakeFeature "INITSYS" (lib.optionalString withSystemd "systemd"))
97 (lib.cmakeBool "CLIENT" buildClient)
98 (lib.cmakeBool "SERVER" buildServer)
99 (lib.cmakeBool "SERVERGUI" buildServerGui)
100 (lib.cmakeBool "TOOLS" buildExtraTools)
104 description = "Collaborative drawing program that allows multiple users to sketch on the same canvas simultaneously";
105 homepage = "https://drawpile.net/";
106 downloadPage = "https://drawpile.net/download/";
107 license = lib.licenses.gpl3Plus;
108 maintainers = with lib.maintainers; [ fgaz ];
109 platforms = lib.platforms.unix;
110 broken = stdenv.hostPlatform.isDarwin;
111 } // lib.optionalAttrs buildServer {
112 mainProgram = "drawpile-srv";
113 } // lib.optionalAttrs buildClient {
114 mainProgram = "drawpile";