2021-05-21 10:49:59 +01:00
|
|
|
{ lib
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
2021-05-25 06:07:52 +01:00
|
|
|
, substituteAll, python3, pkg-config, runCommand, writeText
|
2021-05-06 09:00:55 +01:00
|
|
|
, xorg, gtk3, glib, pango, cairo, gdk-pixbuf, atk, pandoc
|
2020-11-24 15:29:28 +00:00
|
|
|
, wrapGAppsHook, xorgserver, getopt, xauth, util-linux, which
|
2021-05-21 10:49:59 +01:00
|
|
|
, ffmpeg, x264, libvpx, libwebp, x265, librsvg
|
2016-09-03 14:52:39 +01:00
|
|
|
, libfakeXinerama
|
2018-12-02 11:41:15 +00:00
|
|
|
, gst_all_1, pulseaudio, gobject-introspection
|
2021-05-25 06:07:52 +01:00
|
|
|
, withNvenc ? false, cudatoolkit, nv-codec-headers-10, nvidia_x11 ? null
|
2016-12-04 21:26:43 +00:00
|
|
|
, pam }:
|
2016-09-03 14:52:39 +01:00
|
|
|
|
|
|
|
with lib;
|
2008-03-17 13:45:50 +00:00
|
|
|
|
2016-08-14 11:01:09 +01:00
|
|
|
let
|
2018-09-13 16:43:31 +01:00
|
|
|
inherit (python3.pkgs) cython buildPythonApplication;
|
2018-07-15 09:32:53 +01:00
|
|
|
|
2020-03-31 07:29:46 +01:00
|
|
|
xf86videodummy = xorg.xf86videodummy.overrideDerivation (p: {
|
|
|
|
patches = [
|
2021-05-06 09:00:55 +01:00
|
|
|
# patch provided by Xpra upstream
|
2020-03-31 07:29:46 +01:00
|
|
|
./0002-Constant-DPI.patch
|
2021-05-06 09:00:55 +01:00
|
|
|
# https://github.com/Xpra-org/xpra/issues/349
|
2020-03-31 07:29:46 +01:00
|
|
|
./0003-fix-pointer-limits.patch
|
2021-05-06 09:00:55 +01:00
|
|
|
# patch provided by Xpra upstream
|
2020-03-31 07:29:46 +01:00
|
|
|
./0005-support-for-30-bit-depth-in-dummy-driver.patch
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2020-03-31 07:30:26 +01:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-05-25 06:07:52 +01:00
|
|
|
nvencHeaders = runCommand "nvenc-headers" {
|
|
|
|
inherit nvidia_x11;
|
|
|
|
} ''
|
|
|
|
mkdir -p $out/include $out/lib/pkgconfig
|
|
|
|
cp ${nv-codec-headers-10}/include/ffnvcodec/nvEncodeAPI.h $out/include
|
|
|
|
substituteAll ${./nvenc.pc} $out/lib/pkgconfig/nvenc.pc
|
|
|
|
'';
|
2016-08-14 11:01:09 +01:00
|
|
|
in buildPythonApplication rec {
|
2018-07-15 09:32:53 +01:00
|
|
|
pname = "xpra";
|
2021-05-21 10:49:59 +01:00
|
|
|
version = "4.2";
|
2017-11-11 12:00:17 +00:00
|
|
|
|
2008-03-17 13:45:50 +00:00
|
|
|
src = fetchurl {
|
2021-05-06 09:00:55 +01:00
|
|
|
url = "https://xpra.org/src/${pname}-${version}.tar.gz";
|
2021-05-21 10:49:59 +01:00
|
|
|
hash = "sha256-KkQw4FJeH4G5jZ4GdP3aXZ3zxu4GALbiOI6POKJW6fk=";
|
2008-03-17 13:45:50 +00:00
|
|
|
};
|
|
|
|
|
2018-09-13 16:43:31 +01:00
|
|
|
patches = [
|
2021-05-06 09:00:55 +01:00
|
|
|
(substituteAll { # correct hardcoded paths
|
2018-09-13 16:43:31 +01:00
|
|
|
src = ./fix-paths.patch;
|
2020-05-16 20:19:00 +01:00
|
|
|
inherit libfakeXinerama;
|
2018-09-13 16:43:31 +01:00
|
|
|
})
|
2021-05-06 09:00:55 +01:00
|
|
|
./fix-41106.patch # https://github.com/NixOS/nixpkgs/issues/41106
|
2021-05-21 10:49:59 +01:00
|
|
|
# Xorg won't start without. Remove on next version!
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Xpra-org/xpra/commit/f9f242abad69363dfa558e1f6f7956ae99164b67.patch";
|
|
|
|
sha256 = "sha256-TOP9RuXPuqxyKY/7LSSrCWnAmJstEE+D5EwjMiVmchM=";
|
|
|
|
})
|
2018-09-13 16:43:31 +01:00
|
|
|
];
|
|
|
|
|
2019-03-22 19:27:55 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py --replace '/usr/include/security' '${pam}/include/security'
|
|
|
|
'';
|
|
|
|
|
2021-05-25 06:07:52 +01:00
|
|
|
nativeBuildInputs = [ pkg-config wrapGAppsHook pandoc ]
|
|
|
|
++ lib.optional withNvenc cudatoolkit;
|
2018-12-31 03:40:47 +00:00
|
|
|
buildInputs = with xorg; [
|
|
|
|
libX11 xorgproto libXrender libXi
|
|
|
|
libXtst libXfixes libXcomposite libXdamage
|
|
|
|
libXrandr libxkbfile
|
|
|
|
] ++ [
|
2017-09-14 20:24:37 +01:00
|
|
|
cython
|
2021-05-21 10:49:59 +01:00
|
|
|
librsvg
|
2012-07-06 02:33:52 +01:00
|
|
|
|
2019-05-22 12:03:39 +01:00
|
|
|
pango cairo gdk-pixbuf atk.out gtk3 glib
|
2008-03-17 13:45:50 +00:00
|
|
|
|
2020-06-13 03:31:01 +01:00
|
|
|
ffmpeg libvpx x264 libwebp x265
|
2015-02-24 23:34:58 +00:00
|
|
|
|
2016-09-03 14:52:39 +01:00
|
|
|
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
|
|
|
|
|
2016-12-04 21:26:43 +00:00
|
|
|
pam
|
2019-03-22 19:27:55 +00:00
|
|
|
gobject-introspection
|
2021-05-25 06:07:52 +01:00
|
|
|
] ++ lib.optional withNvenc nvencHeaders;
|
2018-09-13 16:43:31 +01:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
pillow rencode pycrypto cryptography pycups lz4 dbus-python
|
2019-03-22 19:27:55 +00:00
|
|
|
netifaces numpy pygobject3 pycairo gst-python pam
|
2019-08-24 14:14:00 +01:00
|
|
|
pyopengl paramiko opencv4 python-uinput pyxdg
|
2021-05-21 10:49:59 +01:00
|
|
|
ipaddress idna pyinotify
|
2021-05-25 06:07:52 +01:00
|
|
|
] ++ lib.optionals withNvenc (with python3.pkgs; [pynvml pycuda]);
|
2012-07-06 02:33:52 +01:00
|
|
|
|
2018-09-13 16:43:31 +01:00
|
|
|
# error: 'import_cairo' defined but not used
|
2019-10-30 11:34:47 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error=unused-function";
|
2013-03-29 01:30:18 +00:00
|
|
|
|
2018-09-13 16:43:31 +01:00
|
|
|
setupPyBuildFlags = [
|
|
|
|
"--with-Xdummy"
|
2021-05-21 10:49:59 +01:00
|
|
|
"--without-Xdummy_wrapper"
|
2018-09-13 16:43:31 +01:00
|
|
|
"--without-strict"
|
|
|
|
"--with-gtk3"
|
2019-03-22 19:27:55 +00:00
|
|
|
# Override these, setup.py checks for headers in /usr/* paths
|
|
|
|
"--with-pam"
|
|
|
|
"--with-vsock"
|
2021-05-25 06:07:52 +01:00
|
|
|
] ++ lib.optional withNvenc "--with-nvenc";
|
2018-09-13 16:43:31 +01:00
|
|
|
|
2020-05-16 21:15:56 +01:00
|
|
|
dontWrapGApps = true;
|
2018-09-13 16:43:31 +01:00
|
|
|
preFixup = ''
|
2020-05-16 21:15:56 +01:00
|
|
|
makeWrapperArgs+=(
|
|
|
|
"''${gappsWrapperArgs[@]}"
|
2018-09-13 16:43:31 +01:00
|
|
|
--set XPRA_INSTALL_PREFIX "$out"
|
2020-08-22 21:38:10 +01:00
|
|
|
--set XPRA_COMMAND "$out/bin/xpra"
|
2021-05-21 10:49:59 +01:00
|
|
|
--set XPRA_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb"
|
2018-09-13 16:43:31 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : ${libfakeXinerama}/lib
|
2021-01-15 09:19:50 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ getopt xorgserver xauth which util-linux pulseaudio ]}
|
2021-05-25 06:07:52 +01:00
|
|
|
'' + lib.optionalString withNvenc ''
|
|
|
|
--prefix LD_LIBRARY_PATH : ${nvidia_x11}/lib
|
|
|
|
'' + ''
|
2018-09-13 16:43:31 +01:00
|
|
|
)
|
2015-02-24 23:34:58 +00:00
|
|
|
'';
|
|
|
|
|
2020-03-31 07:30:26 +01:00
|
|
|
# append module paths to xorg.conf
|
|
|
|
postInstall = ''
|
|
|
|
cat ${xorgModulePaths} >> $out/etc/xpra/xorg.conf
|
|
|
|
'';
|
|
|
|
|
2018-09-13 16:43:31 +01:00
|
|
|
doCheck = false;
|
2015-02-24 23:34:58 +00:00
|
|
|
|
2019-03-22 19:27:55 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-10 18:21:27 +00:00
|
|
|
passthru = {
|
|
|
|
inherit xf86videodummy;
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
};
|
2015-02-24 23:34:58 +00:00
|
|
|
|
2008-03-17 13:45:50 +00:00
|
|
|
meta = {
|
2021-05-21 10:49:59 +01:00
|
|
|
homepage = "https://xpra.org/";
|
2017-11-11 12:00:17 +00:00
|
|
|
downloadPage = "https://xpra.org/src/";
|
2021-05-21 10:49:59 +01:00
|
|
|
downloadURLRegexp = "xpra-.*[.]tar[.][gx]z$";
|
2008-03-17 13:45:50 +00:00
|
|
|
description = "Persistent remote applications for X";
|
2016-09-03 14:52:39 +01:00
|
|
|
platforms = platforms.linux;
|
2018-09-12 20:42:39 +01:00
|
|
|
license = licenses.gpl2;
|
2021-05-21 10:49:59 +01:00
|
|
|
maintainers = with maintainers; [ tstrobel offline numinit mvnetbiz ];
|
2008-03-17 13:45:50 +00:00
|
|
|
};
|
|
|
|
}
|