Files
nixpkgs/pkgs/by-name/dr/drawpile/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

125 lines
2.6 KiB
Nix

{
stdenv,
lib,
fetchFromGitHub,
cargo,
extra-cmake-modules,
rustc,
rustPlatform,
# common deps
libzip,
qt6Packages,
# client deps
ffmpeg,
libsecret,
libwebp,
# optional client deps
giflib,
libvpx,
miniupnpc,
# optional server deps
libmicrohttpd,
libsodium,
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
systemd ? null,
# options
buildClient ? true,
buildServer ? true,
buildServerGui ? true, # if false builds a headless server
buildExtraTools ? false,
}:
assert lib.assertMsg (
buildClient || buildServer || buildExtraTools
) "You must specify at least one of buildClient, buildServer, or buildExtraTools.";
let
clientDeps = with qt6Packages; [
qtbase
qtkeychain
qtmultimedia
qtsvg
qttools
ffmpeg
libsecret
libwebp
# optional:
giflib # gif animation export support
libvpx # WebM video export
miniupnpc # automatic port forwarding
];
serverDeps = [
# optional:
libmicrohttpd # HTTP admin api
libsodium # ext-auth support
]
++ lib.optional withSystemd systemd;
in
stdenv.mkDerivation rec {
pname = "drawpile";
version = "2.2.2";
src = fetchFromGitHub {
owner = "drawpile";
repo = "drawpile";
rev = version;
sha256 = "sha256-xcutcSpbFt+pb7QP1E/RG6iNnZwpfhIZTxr+1usLKHc=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
hash = "sha256-VUX6J7TfxWpa07HPFZ8JzpltIwJUYAl5TABIpBmGYYo=";
};
nativeBuildInputs = [
cargo
extra-cmake-modules
rustc
rustPlatform.cargoSetupHook
(
if buildClient || buildServerGui then
qt6Packages.wrapQtAppsHook
else
qt6Packages.wrapQtAppsNoGuiHook
)
];
buildInputs = [
libzip
qt6Packages.qtwebsockets
]
++ lib.optionals buildClient clientDeps
++ lib.optionals buildServer serverDeps;
cmakeFlags = [
(lib.cmakeFeature "INITSYS" (lib.optionalString withSystemd "systemd"))
(lib.cmakeBool "CLIENT" buildClient)
(lib.cmakeBool "SERVER" buildServer)
(lib.cmakeBool "SERVERGUI" buildServerGui)
(lib.cmakeBool "TOOLS" buildExtraTools)
];
meta = {
description = "Collaborative drawing program that allows multiple users to sketch on the same canvas simultaneously";
homepage = "https://drawpile.net/";
downloadPage = "https://drawpile.net/download/";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ fgaz ];
platforms = lib.platforms.unix;
broken = stdenv.hostPlatform.isDarwin;
}
// lib.optionalAttrs buildServer {
mainProgram = "drawpile-srv";
}
// lib.optionalAttrs buildClient {
mainProgram = "drawpile";
};
}