2021-05-28 09:39:13 +00:00
|
|
|
{ lib
|
|
|
|
, fetchurl
|
2022-06-16 17:23:12 +00:00
|
|
|
, substituteAll
|
|
|
|
, pkg-config
|
|
|
|
, runCommand
|
|
|
|
, writeText
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2022-06-16 17:23:12 +00:00
|
|
|
, withNvenc ? false
|
|
|
|
, atk
|
|
|
|
, cairo
|
|
|
|
, cudatoolkit
|
|
|
|
, ffmpeg
|
|
|
|
, gdk-pixbuf
|
|
|
|
, getopt
|
|
|
|
, glib
|
|
|
|
, gobject-introspection
|
|
|
|
, gst_all_1
|
|
|
|
, gtk3
|
2023-10-09 19:29:22 +00:00
|
|
|
, libappindicator
|
2020-04-24 23:36:52 +00:00
|
|
|
, libfakeXinerama
|
2022-06-16 17:23:12 +00:00
|
|
|
, librsvg
|
|
|
|
, libvpx
|
|
|
|
, libwebp
|
2023-03-08 16:32:21 +00:00
|
|
|
, lz4
|
2022-06-16 17:23:12 +00:00
|
|
|
, nv-codec-headers-10
|
|
|
|
, nvidia_x11 ? null
|
|
|
|
, pam
|
|
|
|
, pandoc
|
|
|
|
, pango
|
|
|
|
, pulseaudio
|
|
|
|
, python3
|
|
|
|
, util-linux
|
|
|
|
, which
|
|
|
|
, x264
|
|
|
|
, x265
|
|
|
|
, xauth
|
|
|
|
, xorg
|
|
|
|
, xorgserver
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (python3.pkgs) cython buildPythonApplication;
|
|
|
|
|
|
|
|
xf86videodummy = xorg.xf86videodummy.overrideDerivation (p: {
|
|
|
|
patches = [
|
2021-05-20 23:08:51 +00:00
|
|
|
# patch provided by Xpra upstream
|
2020-04-24 23:36:52 +00:00
|
|
|
./0002-Constant-DPI.patch
|
2021-05-20 23:08:51 +00:00
|
|
|
# https://github.com/Xpra-org/xpra/issues/349
|
2020-04-24 23:36:52 +00:00
|
|
|
./0003-fix-pointer-limits.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-29 03:34:57 +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
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
in buildPythonApplication rec {
|
|
|
|
pname = "xpra";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "4.4.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-01-25 03:21:06 +00:00
|
|
|
url = "https://xpra.org/src/${pname}-${version}.tar.xz";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-BWf3nypfSrYCzpJ0OfBkecoHGbG1lEgu5jLZhfkIejQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-05-20 23:08:51 +00:00
|
|
|
(substituteAll { # correct hardcoded paths
|
2020-04-24 23:36:52 +00:00
|
|
|
src = ./fix-paths.patch;
|
2020-06-18 07:06:33 +00:00
|
|
|
inherit libfakeXinerama;
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
2021-05-20 23:08:51 +00:00
|
|
|
./fix-41106.patch # https://github.com/NixOS/nixpkgs/issues/41106
|
2022-06-16 17:23:12 +00:00
|
|
|
./fix-122159.patch # https://github.com/NixOS/nixpkgs/issues/122159
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
INCLUDE_DIRS = "${pam}/include";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
gobject-introspection
|
2022-06-16 17:23:12 +00:00
|
|
|
pkg-config
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2022-06-16 17:23:12 +00:00
|
|
|
pandoc
|
|
|
|
] ++ lib.optional withNvenc cudatoolkit;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = with xorg; [
|
2022-06-16 17:23:12 +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
|
2020-04-24 23:36:52 +00:00
|
|
|
cython
|
2022-06-16 17:23:12 +00:00
|
|
|
ffmpeg
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
|
|
|
gtk3
|
2023-10-09 19:29:22 +00:00
|
|
|
libappindicator
|
2021-05-28 09:39:13 +00:00
|
|
|
librsvg
|
2022-06-16 17:23:12 +00:00
|
|
|
libvpx
|
|
|
|
libwebp
|
2023-03-08 16:32:21 +00:00
|
|
|
lz4
|
2020-04-24 23:36:52 +00:00
|
|
|
pam
|
2022-06-16 17:23:12 +00:00
|
|
|
pango
|
|
|
|
x264
|
|
|
|
x265
|
2021-05-29 03:34:57 +00:00
|
|
|
] ++ lib.optional withNvenc nvencHeaders;
|
2022-06-16 17:23:12 +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
|
2023-01-11 07:51:40 +00:00
|
|
|
invoke
|
2022-06-16 17:23:12 +00:00
|
|
|
] ++ lib.optionals withNvenc [
|
|
|
|
pycuda
|
|
|
|
pynvml
|
|
|
|
]);
|
|
|
|
|
|
|
|
# error: 'import_cairo' defined but not used
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-error=unused-function";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
setupPyBuildFlags = [
|
|
|
|
"--with-Xdummy"
|
2021-05-28 09:39:13 +00:00
|
|
|
"--without-Xdummy_wrapper"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--without-strict"
|
|
|
|
"--with-gtk3"
|
|
|
|
# Override these, setup.py checks for headers in /usr/* paths
|
|
|
|
"--with-pam"
|
|
|
|
"--with-vsock"
|
2021-05-29 03:34:57 +00:00
|
|
|
] ++ lib.optional withNvenc "--with-nvenc";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
dontWrapGApps = true;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preFixup = ''
|
2020-09-25 04:45:31 +00:00
|
|
|
makeWrapperArgs+=(
|
|
|
|
"''${gappsWrapperArgs[@]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
--set XPRA_INSTALL_PREFIX "$out"
|
2020-09-25 04:45:31 +00:00
|
|
|
--set XPRA_COMMAND "$out/bin/xpra"
|
2021-05-28 09:39:13 +00:00
|
|
|
--set XPRA_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb"
|
2022-06-16 17:23:12 +00:00
|
|
|
--set XORG_CONFIG_PREFIX ""
|
2020-04-24 23:36:52 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${libfakeXinerama}/lib
|
2021-01-15 22:18:51 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ getopt xorgserver xauth which util-linux pulseaudio ]}
|
2021-05-29 03:34:57 +00:00
|
|
|
'' + lib.optionalString withNvenc ''
|
|
|
|
--prefix LD_LIBRARY_PATH : ${nvidia_x11}/lib
|
|
|
|
'' + ''
|
2020-04-24 23:36:52 +00:00
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2022-11-02 22:02:43 +00:00
|
|
|
# append module paths to xorg.conf
|
2020-04-24 23:36:52 +00:00
|
|
|
cat ${xorgModulePaths} >> $out/etc/xpra/xorg.conf
|
2023-03-24 00:07:29 +00:00
|
|
|
cat ${xorgModulePaths} >> $out/etc/xpra/xorg-uinput.conf
|
2022-11-02 22:02:43 +00:00
|
|
|
|
|
|
|
# make application icon visible to desktop environemnts
|
|
|
|
icon_dir="$out/share/icons/hicolor/64x64/apps"
|
|
|
|
mkdir -p "$icon_dir"
|
|
|
|
ln -sr "$out/share/icons/xpra.png" "$icon_dir"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
passthru = {
|
|
|
|
inherit xf86videodummy;
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
meta = with lib; {
|
2021-05-28 09:39:13 +00:00
|
|
|
homepage = "https://xpra.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
downloadPage = "https://xpra.org/src/";
|
|
|
|
description = "Persistent remote applications for X";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/Xpra-org/xpra/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2024-05-15 15:35:15 +00:00
|
|
|
license = licenses.gpl2Only;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ offline numinit mvnetbiz ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|