From be9b7e0f653e27030c402194c7020aea873f30a5 Mon Sep 17 00:00:00 2001 From: Andy Tai Date: Wed, 27 Sep 2023 09:36:13 -0700 Subject: gnu: xpra: Update to 5.0.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/xpra-4.2-install_libs.patch: Move to ... * gnu/packages/patches/xpra-5.0-install_libs.patch: ... this file. * gnu/packages/patches/xpra-4.2-systemd-run.patch: Move to ... * gnu/packages/patches/xpra-5.0-systemd-run.patch: ... this file. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/xorg.scm (xpra): Update to 5.0.2. [source] : Rename per version changes [inputs]: Add cups. Signed-off-by: Ludovic Courtès --- gnu/packages/patches/xpra-4.2-install_libs.patch | 29 -------------- gnu/packages/patches/xpra-4.2-systemd-run.patch | 45 ---------------------- gnu/packages/patches/xpra-5.0-install_libs.patch | 42 +++++++++++++++++++++ gnu/packages/patches/xpra-5.0-systemd-run.patch | 48 ++++++++++++++++++++++++ gnu/packages/xorg.scm | 14 ++++--- 5 files changed, 98 insertions(+), 80 deletions(-) delete mode 100644 gnu/packages/patches/xpra-4.2-install_libs.patch delete mode 100644 gnu/packages/patches/xpra-4.2-systemd-run.patch create mode 100644 gnu/packages/patches/xpra-5.0-install_libs.patch create mode 100644 gnu/packages/patches/xpra-5.0-systemd-run.patch (limited to 'gnu/packages') diff --git a/gnu/packages/patches/xpra-4.2-install_libs.patch b/gnu/packages/patches/xpra-4.2-install_libs.patch deleted file mode 100644 index 65d489a3b8..0000000000 --- a/gnu/packages/patches/xpra-4.2-install_libs.patch +++ /dev/null @@ -1,29 +0,0 @@ -This workaround for Gentoo interferes with our use of --no-compile during -the 'install stage. - ---- a/setup.py 2022-01-04 10:10:05.039825000 +0100 -+++ b/setup.py 2022-01-06 15:10:31.952656039 +0100 -@@ -589,8 +589,6 @@ - }) - - def add_cython_ext(*args, **kwargs): -- if "--no-compile" in sys.argv and not ("build" in sys.argv and "install" in sys.argv): -- return - assert cython_ENABLED, "cython compilation is disabled" - if cython_tracing_ENABLED: - kwargs["define_macros"] = [ -@@ -1703,14 +1701,6 @@ - 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 - assert py2app is not None diff --git a/gnu/packages/patches/xpra-4.2-systemd-run.patch b/gnu/packages/patches/xpra-4.2-systemd-run.patch deleted file mode 100644 index 8dfd9c82f0..0000000000 --- a/gnu/packages/patches/xpra-4.2-systemd-run.patch +++ /dev/null @@ -1,45 +0,0 @@ -Disable systemd-run if the command is not found. - -diff -ru xpra-4.2~/xpra/scripts/main.py xpra-4.2/xpra/scripts/main.py ---- xpra-4.2~/xpra/scripts/main.py 2021-06-06 08:51:13.756815842 -0700 -+++ xpra-4.2/xpra/scripts/main.py 2021-06-06 16:07:13.371024486 -0700 -@@ -331,23 +331,26 @@ - if not is_systemd_pid1(): - return False # pragma: no cover - #test it: -- cmd = ["systemd-run", "--quiet", "--user", "--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: -+ cmd = ["systemd-run", "--quiet", "--user", "--scope", "--", "true"] -+ proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=False) - try: -- proc.terminate() -- except Exception: -- pass -- 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 run_mode(script_file, error_cb, options, args, mode, defaults): 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 0000000000..4d40bf1f79 --- /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 0000000000..437a8cc37f --- /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 cd1335661b..ec846093e2 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -72,6 +72,7 @@ #:use-module (gnu packages bash) #:use-module (gnu packages bison) #:use-module (gnu packages check) + #:use-module (gnu packages cups) #:use-module (gnu packages compression) #:use-module (gnu packages emacs) #:use-module (gnu packages flex) @@ -6110,16 +6111,16 @@ basic eye-candy effects.") (define-public xpra (package (name "xpra") - (version "4.4.6") + (version "5.0.2") (source (origin (method url-fetch) (uri (string-append "https://www.xpra.org/src/xpra-" version ".tar.xz")) (sha256 - (base32 "0d3s13wqbn9jwqp4i55mn4chgjkrckq3jx4jrq1bcjjz5agzfrq5")) - (patches (search-patches "xpra-4.2-systemd-run.patch" - "xpra-4.2-install_libs.patch")))) + (base32 "0gxv0h1spg2jl3g9cc6qxxkq6a7prmb92dqqwk0s6pvrj8w3izlk")) + (patches (search-patches "xpra-5.0-systemd-run.patch" + "xpra-5.0-install_libs.patch")))) (build-system python-build-system) (inputs (list bash-minimal ; for wrap-program @@ -6158,7 +6159,8 @@ basic eye-candy effects.") python-dbus ; For desktop notifications. dbus ; For dbus-launch command. python-lz4 ; Faster compression than zlib. - python-netifaces)) + python-netifaces + python-pycups)) (native-inputs (list pkg-config pandoc python-cython)) (arguments (list @@ -6193,7 +6195,7 @@ basic eye-candy effects.") (format #f "~s" (search-input-file inputs "bin/xauth")))) ;; Fix directory of config files. (substitute* '("xpra/scripts/config.py" - "xpra/platform/xposix/paths.py") + "xpra/platform/posix/paths.py") (("\"/etc/xpra/?\"") (string-append "\"" #$output "/etc/xpra/\""))) ;; XXX: Stolen from (gnu packages linux) -- cgit 1.4.1