~ruther/guix-local

bc7c4cee26b093315601f9bb39e5a4ffbb1b5784 — Andy Tai 4 months ago 11374d1
gnu: xpra-5: New variable.

* 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 <ludo@gnu.org>
M gnu/local.mk => gnu/local.mk +2 -0
@@ 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		\

A gnu/packages/patches/xpra-5.0-install_libs.patch => gnu/packages/patches/xpra-5.0-install_libs.patch +42 -0
@@ 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

A gnu/packages/patches/xpra-5.0-systemd-run.patch => gnu/packages/patches/xpra-5.0-systemd-run.patch +48 -0
@@ 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:

M gnu/packages/xorg.scm => gnu/packages/xorg.scm +18 -0
@@ 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")