nixpkgs/pkgs/tools/X11/xpra/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

212 lines
4.3 KiB
Nix
Raw Normal View History

{ lib
, fetchurl
2022-05-20 12:32:42 +00:00
, substituteAll
, pkg-config
, runCommand
, writeText
, wrapGAppsHook
, withNvenc ? false
, atk
, cairo
, cudatoolkit
, ffmpeg
, gdk-pixbuf
, getopt
, glib
, gobject-introspection
, gst_all_1
, gtk3
2016-09-03 13:52:39 +00:00
, libfakeXinerama
2022-05-20 12:32:42 +00:00
, librsvg
, libvpx
, libwebp
, nv-codec-headers-10
, nvidia_x11 ? null
, pam
, pandoc
, pango
, pulseaudio
, python3
, util-linux
, which
, x264
, x265
, xauth
, xorg
, xorgserver
}:
2016-09-03 13:52:39 +00:00
with lib;
let
inherit (python3.pkgs) cython buildPythonApplication;
2018-07-15 08:32:53 +00:00
2020-03-31 06:29:46 +00:00
xf86videodummy = xorg.xf86videodummy.overrideDerivation (p: {
patches = [
2021-05-06 08:00:55 +00:00
# patch provided by Xpra upstream
2020-03-31 06:29:46 +00:00
./0002-Constant-DPI.patch
2021-05-06 08:00:55 +00:00
# https://github.com/Xpra-org/xpra/issues/349
2020-03-31 06:29:46 +00:00
./0003-fix-pointer-limits.patch
2021-05-06 08:00:55 +00:00
# patch provided by Xpra upstream
2020-03-31 06:29:46 +00:00
./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
'';
2021-05-25 05:07:52 +00: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
'';
in buildPythonApplication rec {
2018-07-15 08:32:53 +00:00
pname = "xpra";
2022-05-20 12:32:42 +00:00
version = "4.3.3";
src = fetchurl {
2022-01-22 09:41:09 +00:00
url = "https://xpra.org/src/${pname}-${version}.tar.xz";
2022-05-20 12:32:42 +00:00
hash = "sha256-J6zzkho0A1faCVzS/0wDlbgLtJmyPrnBkEcR7kDld7A=";
};
patches = [
2021-05-06 08:00:55 +00:00
(substituteAll { # correct hardcoded paths
src = ./fix-paths.patch;
2020-05-16 19:19:00 +00:00
inherit libfakeXinerama;
})
2021-05-06 08:00:55 +00:00
./fix-41106.patch # https://github.com/NixOS/nixpkgs/issues/41106
2022-05-20 12:32:42 +00:00
./fix-122159.patch # https://github.com/NixOS/nixpkgs/issues/122159
];
2022-01-22 09:41:09 +00:00
INCLUDE_DIRS = "${pam}/include";
2019-03-22 19:27:55 +00:00
2022-05-20 12:32:42 +00:00
nativeBuildInputs = [
2022-08-08 19:51:49 +00:00
gobject-introspection
2022-05-20 12:32:42 +00:00
pkg-config
wrapGAppsHook
pandoc
] ++ lib.optional withNvenc cudatoolkit;
buildInputs = with xorg; [
2022-05-20 12:32:42 +00:00
libX11
libXcomposite
libXdamage
libXfixes
libXi
libxkbfile
libXrandr
libXrender
libXres
libXtst
xorgproto
] ++ (with gst_all_1; [
gst-libav
gst-plugins-bad
gst-plugins-base
gst-plugins-good
gstreamer
]) ++ [
atk.out
cairo
cython
2022-05-20 12:32:42 +00:00
ffmpeg
gdk-pixbuf
glib
gtk3
librsvg
2022-05-20 12:32:42 +00:00
libvpx
libwebp
2016-12-04 21:26:43 +00:00
pam
2022-05-20 12:32:42 +00:00
pango
x264
x265
2021-05-25 05:07:52 +00:00
] ++ lib.optional withNvenc nvencHeaders;
2022-05-20 12:32:42 +00:00
propagatedBuildInputs = with python3.pkgs; ([
cryptography
dbus-python
gst-python
idna
lz4
netifaces
numpy
opencv4
pam
paramiko
pillow
pycairo
pycrypto
pycups
pygobject3
pyinotify
pyopengl
python-uinput
pyxdg
rencode
] ++ lib.optionals withNvenc [
pycuda
pynvml
]);
# 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
setupPyBuildFlags = [
"--with-Xdummy"
"--without-Xdummy_wrapper"
"--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 05:07:52 +00:00
] ++ lib.optional withNvenc "--with-nvenc";
dontWrapGApps = true;
2022-05-20 12:32:42 +00:00
preFixup = ''
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
--set XPRA_INSTALL_PREFIX "$out"
2020-08-22 20:38:10 +00:00
--set XPRA_COMMAND "$out/bin/xpra"
--set XPRA_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb"
2022-05-20 12:32:42 +00:00
--set XORG_CONFIG_PREFIX ""
--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 05:07:52 +00:00
'' + lib.optionalString withNvenc ''
--prefix LD_LIBRARY_PATH : ${nvidia_x11}/lib
'' + ''
)
2015-02-24 23:34:58 +00:00
'';
# append module paths to xorg.conf
postInstall = ''
cat ${xorgModulePaths} >> $out/etc/xpra/xorg.conf
'';
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
meta = {
homepage = "https://xpra.org/";
downloadPage = "https://xpra.org/src/";
description = "Persistent remote applications for X";
2016-09-03 13:52:39 +00:00
platforms = platforms.linux;
2018-09-12 19:42:39 +00:00
license = licenses.gpl2;
maintainers = with maintainers; [ offline numinit mvnetbiz ];
};
}