From bc7c4cee26b093315601f9bb39e5a4ffbb1b5784 Mon Sep 17 00:00:00 2001 From: Andy Tai Date: Sun, 9 Nov 2025 19:33:14 -0800 Subject: [PATCH] gnu: xpra-5: New variable. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/xorg.scm (xpra-5): New variable. * gnu/packages/patches/xpra-5.0-install_libs.patch: New file. * gnu/packages/patches/xpra-5.0-systemd-run.patch: New file. * gnu/local.mk (dist_patch_DATA): Update accordingly. Change-Id: Ib07d8227a6b175ad124aa07e25ec8a11a6a907d2 Signed-off-by: Ludovic Courtès --- gnu/local.mk | 2 + .../patches/xpra-5.0-install_libs.patch | 42 ++++++++++++++++ .../patches/xpra-5.0-systemd-run.patch | 48 +++++++++++++++++++ gnu/packages/xorg.scm | 18 +++++++ 4 files changed, 110 insertions(+) create mode 100644 gnu/packages/patches/xpra-5.0-install_libs.patch create mode 100644 gnu/packages/patches/xpra-5.0-systemd-run.patch diff --git a/gnu/local.mk b/gnu/local.mk index f33e7090277704ac5e6eb56e2899f3cfbe94fd38..6c4afb1a82a64cd814dd30349407325121fc7e59 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2487,6 +2487,8 @@ dist_patch_DATA = \ %D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \ %D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \ %D%/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch \ + %D%/packages/patches/xpra-5.0-install_libs.patch \ + %D%/packages/patches/xpra-5.0-systemd-run.patch \ %D%/packages/patches/xpra-6.0-systemd-run.patch \ %D%/packages/patches/xpra-6.1-install_libs.patch \ %D%/packages/patches/xterm-370-explicit-xcursor.patch \ diff --git a/gnu/packages/patches/xpra-5.0-install_libs.patch b/gnu/packages/patches/xpra-5.0-install_libs.patch new file mode 100644 index 0000000000000000000000000000000000000000..4d40bf1f79c34b596f42ccf2fa2d001c9e9acbc5 --- /dev/null +++ b/gnu/packages/patches/xpra-5.0-install_libs.patch @@ -0,0 +1,42 @@ +Distribution specific patch, not going upstream + +This workaround for Gentoo interferes with our use of --no-compile during +the 'install stage. + +diff --git a/setup.py b/setup.py +index e254bf99c..90db55c3f 100755 +--- a/setup.py ++++ b/setup.py +@@ -663,8 +663,6 @@ if modules_ENABLED: + # Utility methods for building with Cython + + def add_cython_ext(*args, **kwargs): +- if "--no-compile" in sys.argv and not ("build" in sys.argv and "install" in sys.argv): +- return + if not cython_ENABLED: + raise ValueError(f"cannot build {args}: cython compilation is disabled") + if cython_tracing_ENABLED: +@@ -1809,9 +1807,6 @@ else: + if root_prefix.endswith("/usr"): + #ie: "/" or "/usr/src/rpmbuild/BUILDROOT/xpra-0.18.0-0.20160513r12573.fc23.x86_64/" + root_prefix = root_prefix[:-4] +- for x in sys.argv: +- if x.startswith("--root="): +- root_prefix = x[len("--root="):] + print(f"install_data_override.run() root_prefix={root_prefix}") + build_xpra_conf(root_prefix) + +@@ -1955,13 +1950,6 @@ else: + if uinput_ENABLED: + add_data_files("lib/udev/rules.d/", ["fs/lib/udev/rules.d/71-xpra-virtual-pointer.rules"]) + +- #gentoo does weird things, calls --no-compile with build *and* install +- #then expects to find the cython modules!? ie: +- #> python2.7 setup.py build -b build-2.7 install --no-compile \ +- # --root=/var/tmp/portage/x11-wm/xpra-0.7.0/temp/images/2.7 +- #otherwise we use the flags to skip pkgconfig +- if ("--no-compile" in sys.argv or "--skip-build" in sys.argv) and not ("build" in sys.argv and "install" in sys.argv): +- pkgconfig = no_pkgconfig + + if OSX and "py2app" in sys.argv: + import py2app #@UnresolvedImport diff --git a/gnu/packages/patches/xpra-5.0-systemd-run.patch b/gnu/packages/patches/xpra-5.0-systemd-run.patch new file mode 100644 index 0000000000000000000000000000000000000000..437a8cc37f813d75a0fa79a1db3e54c54011c88f --- /dev/null +++ b/gnu/packages/patches/xpra-5.0-systemd-run.patch @@ -0,0 +1,48 @@ +Distriction specific patch, not going upstream + +Disable systemd-run if the command is not found. + +diff --git a/xpra/scripts/main.py b/xpra/scripts/main.py +index 3813331a5..46e2c83a6 100755 +--- a/xpra/scripts/main.py ++++ b/xpra/scripts/main.py +@@ -337,23 +337,26 @@ def use_systemd_run(s) -> bool: + cmd = ["systemd-run", "--quiet"] + if getuid()!=0: + cmd += ["--user"] +- cmd += ["--scope", "--", "true"] +- proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=False) + try: +- proc.communicate(timeout=2) +- r = proc.returncode +- except TimeoutExpired: # pragma: no cover +- r = None +- if r is None: +- try: +- proc.terminate() +- except Exception: +- pass ++ cmd = ["systemd-run", "--quiet", "--user", "--scope", "--", "true"] ++ proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=False) + try: +- proc.communicate(timeout=1) ++ proc.communicate(timeout=2) ++ r = proc.returncode + except TimeoutExpired: # pragma: no cover + r = None +- return r==0 ++ if r is None: ++ try: ++ proc.terminate() ++ except Exception: ++ pass ++ try: ++ proc.communicate(timeout=1) ++ except TimeoutExpired: # pragma: no cover ++ r = None ++ return r==0 ++ except FileNotFoundError: ++ return False + + def verify_gir(): + try: diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index f7e531765587e96e4b095fbeb818896e55d76d11..162a18d45e60447037fe47f84c637ae3febe6ecf 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -6697,6 +6697,24 @@ without losing any state. It can also be used to forward full desktops from X11 servers, Windows, or macOS.") (license license:gpl2+))) +(define-public xpra-5 + (package + (inherit xpra) + (name "xpra") + (version "5.1.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Xpra-org/xpra.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "150as385jvhz9isc6a9876hrs8700axd700d2m1wagd628xx8yh0")) + (patches (search-patches "xpra-5.0-systemd-run.patch" + "xpra-5.0-install_libs.patch")))))) + + (define-public uim (package (name "uim")