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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
{ lib, fetchurl, substituteAll, python3, pkg-config, writeText
, xorg, gtk3, glib, pango, cairo, gdk-pixbuf, atk, pandoc
, wrapGAppsHook, xorgserver, getopt, xauth, util-linux, which
, ffmpeg, x264, libvpx, libwebp, x265
, libfakeXinerama
, gst_all_1, pulseaudio, gobject-introspection
, pam }:
with lib;
let
inherit (python3.pkgs) cython buildPythonApplication;
xf86videodummy = xorg.xf86videodummy.overrideDerivation (p: {
patches = [
# patch provided by Xpra upstream
./0002-Constant-DPI.patch
# https://github.com/Xpra-org/xpra/issues/349
./0003-fix-pointer-limits.patch
# patch provided by Xpra upstream
./0005-support-for-30-bit-depth-in-dummy-driver.patch
];
});
xorgModulePaths = writeText "module-paths" ''
Section "Files"
ModulePath "${xorgserver}/lib/xorg/modules"
ModulePath "${xorgserver}/lib/xorg/modules/extensions"
ModulePath "${xorgserver}/lib/xorg/modules/drivers"
ModulePath "${xf86videodummy}/lib/xorg/modules/drivers"
EndSection
'';
in buildPythonApplication rec {
pname = "xpra";
version = "4.1.3";
src = fetchurl {
url = "https://xpra.org/src/${pname}-${version}.tar.gz";
sha256 = "TesmPRmfWy+IqqxoNFd04oX/b2ryGreZPeh2r4sL8JQ=";
};
patches = [
(substituteAll { # correct hardcoded paths
src = ./fix-paths.patch;
inherit (xorg) xkeyboardconfig;
inherit libfakeXinerama;
})
./fix-41106.patch # https://github.com/NixOS/nixpkgs/issues/41106
];
postPatch = ''
substituteInPlace setup.py --replace '/usr/include/security' '${pam}/include/security'
'';
nativeBuildInputs = [ pkg-config wrapGAppsHook pandoc ];
buildInputs = with xorg; [
libX11 xorgproto libXrender libXi
libXtst libXfixes libXcomposite libXdamage
libXrandr libxkbfile
] ++ [
cython
pango cairo gdk-pixbuf atk.out gtk3 glib
ffmpeg libvpx x264 libwebp x265
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-plugins-bad
gst_all_1.gst-libav
pam
gobject-introspection
];
propagatedBuildInputs = with python3.pkgs; [
pillow rencode pycrypto cryptography pycups lz4 dbus-python
netifaces numpy pygobject3 pycairo gst-python pam
pyopengl paramiko opencv4 python-uinput pyxdg
ipaddress idna
];
# error: 'import_cairo' defined but not used
NIX_CFLAGS_COMPILE = "-Wno-error=unused-function";
setupPyBuildFlags = [
"--with-Xdummy"
"--without-strict"
"--with-gtk3"
# Override these, setup.py checks for headers in /usr/* paths
"--with-pam"
"--with-vsock"
];
dontWrapGApps = true;
preFixup = ''
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
--set XPRA_INSTALL_PREFIX "$out"
--set XPRA_COMMAND "$out/bin/xpra"
--prefix LD_LIBRARY_PATH : ${libfakeXinerama}/lib
--prefix PATH : ${lib.makeBinPath [ getopt xorgserver xauth which util-linux pulseaudio ]}
)
'';
# append module paths to xorg.conf
postInstall = ''
cat ${xorgModulePaths} >> $out/etc/xpra/xorg.conf
'';
doCheck = false;
enableParallelBuilding = true;
passthru = {
inherit xf86videodummy;
updateScript = ./update.sh;
};
meta = {
homepage = "http://xpra.org/";
downloadPage = "https://xpra.org/src/";
downloadURLRegexp = "xpra-.*[.]tar[.]xz$";
description = "Persistent remote applications for X";
platforms = platforms.linux;
license = licenses.gpl2;
maintainers = with maintainers; [ tstrobel offline numinit ];
};
}
|