summary refs log tree commit diff
path: root/pkgs/applications/graphics/drawpile
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2019-04-15 22:20:13 +0000
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2019-04-15 18:20:13 -0400
commit7ba046d9065c65a7da063e8148ceae169abac508 (patch)
treedf752b3e1e60377d74226c66aa8eeb87c4063d29 /pkgs/applications/graphics/drawpile
parent71727f32a99b2a74654e3478bd78fd876c76f4f2 (diff)
downloadnixpkgs-7ba046d9065c65a7da063e8148ceae169abac508.tar
nixpkgs-7ba046d9065c65a7da063e8148ceae169abac508.tar.gz
nixpkgs-7ba046d9065c65a7da063e8148ceae169abac508.tar.bz2
nixpkgs-7ba046d9065c65a7da063e8148ceae169abac508.tar.lz
nixpkgs-7ba046d9065c65a7da063e8148ceae169abac508.tar.xz
nixpkgs-7ba046d9065c65a7da063e8148ceae169abac508.tar.zst
nixpkgs-7ba046d9065c65a7da063e8148ceae169abac508.zip
drawpile: add build options (#57573)
Also add server-headless variant
Diffstat (limited to 'pkgs/applications/graphics/drawpile')
-rw-r--r--pkgs/applications/graphics/drawpile/default.nix91
1 files changed, 66 insertions, 25 deletions
diff --git a/pkgs/applications/graphics/drawpile/default.nix b/pkgs/applications/graphics/drawpile/default.nix
index 8c547359820..6c354ebe37d 100644
--- a/pkgs/applications/graphics/drawpile/default.nix
+++ b/pkgs/applications/graphics/drawpile/default.nix
@@ -1,48 +1,89 @@
 { stdenv
 , fetchurl
 , cmake
+, extra-cmake-modules
+
+# common deps
+, karchive
+
+# client deps
 , qtbase
-, qtsvg
 , qtmultimedia
+, qtsvg
 , qttools
-, kdnssd
-, karchive
-, libsodium
-, libmicrohttpd
+
+# optional client deps
 , giflib
-, miniupnpc
-, extra-cmake-modules
+, 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
 }:
 
-stdenv.mkDerivation rec {
+with stdenv.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 stdenv.mkDerivation rec {
   name = "drawpile-${version}";
   version = "2.1.6";
+
   src = fetchurl {
     url = "https://drawpile.net/files/src/drawpile-${version}.tar.gz";
     sha256 = "0vwsdvphigrq1daiazi411qflahlvgx8x8ssp581bng2lbq1vrbd";
   };
+
   nativeBuildInputs = [
-    extra-cmake-modules
-  ];
-  buildInputs = [
-    # common deps:
     cmake
-    qtbase qtsvg qtmultimedia qttools
-    karchive
-    # optional deps:
-    #   server-specific:
-    libsodium # ext-auth support
-    libmicrohttpd # HTTP admin api
-    #   client-specific:
-    giflib # gif animation export support
-    miniupnpc # automatic port forwarding
-    kdnssd # local server discovery with Zeroconf
-    libvpx # WebM video export
+    extra-cmake-modules
   ];
-  configurePhase = "cmake -DCMAKE_INSTALL_PREFIX=$out .";
+  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 = with stdenv.lib; {
+  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/;