1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 buildPythonApplication,
6 pem,
7 pyside6,
8 twisted,
9 certifi,
10 qt6,
11 appnope,
12 enableGUI ? true,
13}:
14
15buildPythonApplication rec {
16 pname = "syncplay";
17 version = "1.7.4";
18
19 format = "other";
20
21 src = fetchFromGitHub {
22 owner = "Syncplay";
23 repo = "syncplay";
24 tag = "v${version}";
25 sha256 = "sha256-23OTj+KUmYtrhzIS4A9Gq/tClOLwaeo50+Fcm1tn47M=";
26 };
27
28 patches = [
29 ./trusted_certificates.patch
30 ];
31
32 buildInputs = lib.optionals enableGUI [
33 (if stdenv.hostPlatform.isLinux then qt6.qtwayland else qt6.qtbase)
34 ];
35 propagatedBuildInputs = [
36 certifi
37 pem
38 twisted
39 ]
40 ++ twisted.optional-dependencies.tls
41 ++ lib.optional enableGUI pyside6
42 ++ lib.optional (stdenv.hostPlatform.isDarwin && enableGUI) appnope;
43 nativeBuildInputs = lib.optionals enableGUI [ qt6.wrapQtAppsHook ];
44
45 makeFlags = [
46 "DESTDIR="
47 "PREFIX=$(out)"
48 ];
49
50 postFixup = lib.optionalString enableGUI ''
51 wrapQtApp $out/bin/syncplay
52 '';
53
54 meta = with lib; {
55 homepage = "https://syncplay.pl/";
56 description = "Free software that synchronises media players";
57 license = licenses.asl20;
58 platforms = platforms.linux ++ platforms.darwin;
59 maintainers = with maintainers; [ assistant ];
60 };
61}