gnu: xpra: Upgrade to 4.0.2.

* gnu/packages/xorg.scm (xpra)[version]: Upgrade. [source]: Add patch.
  [inputs]: Adjust to use Python 3 dependencies. [arguments]: Use Python
  3, add phases to patch hardcoded binary paths.
* gnu/local.mk (dist_patch_DATA): Add patch.
* gnu/packages/patches/xpra-4.0.1-systemd-run.patch: New file.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Lars-Dominik Braun 2020-06-27 15:11:05 +02:00 committed by Ludovic Courtès
parent 339184f1d0
commit dab195957b
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
3 changed files with 123 additions and 65 deletions

@ -1637,6 +1637,7 @@ dist_patch_DATA = \
%D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \ %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-libimage_gif.c.patch \
%D%/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch \ %D%/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch \
%D%/packages/patches/xpra-4.0.1-systemd-run.patch \
%D%/packages/patches/xsane-fix-memory-leak.patch \ %D%/packages/patches/xsane-fix-memory-leak.patch \
%D%/packages/patches/xsane-fix-pdf-floats.patch \ %D%/packages/patches/xsane-fix-pdf-floats.patch \
%D%/packages/patches/xsane-fix-snprintf-buffer-length.patch \ %D%/packages/patches/xsane-fix-snprintf-buffer-length.patch \

@ -0,0 +1,34 @@
Disable systemd-run if the command is not found.
diff -Naur xpra-4.0.1/xpra/scripts/main.py xpra-4.0.1.patched/xpra/scripts/main.py
--- xpra-4.0.1/xpra/scripts/main.py 2020-05-17 18:12:15.000000000 +0200
+++ xpra-4.0.1.patched/xpra/scripts/main.py 2020-06-01 12:12:18.500257507 +0200
@@ -312,16 +312,18 @@
if not is_systemd_pid1():
return False
#test it:
- cmd = ["systemd-run", "--quiet", "--user", "--scope", "--", "true"]
- proc = Popen(cmd, stdin=None, stdout=None, stderr=None, shell=False)
- r = pollwait(proc, timeout=1)
- if r is None:
- try:
- proc.terminate()
- except Exception:
- pass
- return r==0
-
+ try:
+ cmd = ["systemd-run", "--quiet", "--user", "--scope", "--", "true"]
+ proc = Popen(cmd, stdin=None, stdout=None, stderr=None, shell=False)
+ r = pollwait(proc, timeout=1)
+ if r is None:
+ try:
+ proc.terminate()
+ except Exception:
+ pass
+ return r==0
+ except FileNotFoundError:
+ return False
def run_mode(script_file, error_cb, options, args, mode, defaults):
#configure default logging handler:

@ -6276,7 +6276,7 @@ basic eye-candy effects.")
(define-public xpra (define-public xpra
(package (package
(name "xpra") (name "xpra")
(version "2.5.3") (version "4.0.2")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
@ -6284,85 +6284,108 @@ basic eye-candy effects.")
version ".tar.xz")) version ".tar.xz"))
(sha256 (sha256
(base32 (base32
"1ys35lj28903alccks9p055psy1fsk1nxi8ncchvw8bfxkkkvbys")))) "1cs39jzi59hkl421xmhi549ndmdfzkg0ap45f4nlsn9zr9zwmp3x"))
(patches (search-patches "xpra-4.0.1-systemd-run.patch"))))
(build-system python-build-system) (build-system python-build-system)
(inputs `(("ffmpeg" ,ffmpeg) ;; see also http://xpra.org/trac/wiki/Dependencies
("flac" ,flac) (inputs `(
("gtk+-2" ,gtk+-2) ;; no full GTK3 support yet ;; Essential dependencies.
("libjpeg" ,libjpeg-turbo) ("libjpeg" ,libjpeg-turbo)
("libpng" ,libpng) ("libwebp" ,libwebp)
("libvpx" ,libvpx) ("ffmpeg" ,ffmpeg)
("libx264" ,libx264) ("libx11" ,libx11)
("libxcomposite" ,libxcomposite)
("libxdamage" ,libxdamage)
("libxi" ,libxi)
("libxkbfile" ,libxkbfile)
("libxrandr" ,libxrandr) ("libxrandr" ,libxrandr)
("libxtst" ,libxtst) ("libxtst" ,libxtst)
("lzo" ,lzo) ("libxfixes" ,libxfixes)
("python2-cryptography" ,python2-cryptography) ("libxkbfile" ,libxkbfile)
("python2-dbus" ,python2-dbus) ("libxcomposite" ,libxcomposite)
("python2-lz4" ,python2-lz4) ("libxdamage" ,libxdamage)
("python2-lzo" ,python2-lzo) ("libxext" ,libxext)
("python2-netifaces" ,python2-netifaces) ("gtk+" ,gtk+)
("python2-numpy" ,python2-numpy) ("python-pycairo" ,python-pycairo)
("python2-pillow" ,python2-pillow) ("python-pygobject" ,python-pygobject)
("python2-pycairo" ,python2-pycairo) ("xauth" ,xauth)
("python2-pycrypto" ,python2-pycrypto) ("xorg-server" ,xorg-server)
("python2-pygobject" ,python2-pygobject) ("xf86-video-dummy" ,xf86-video-dummy)
("python2-pyopengl" ,python2-pyopengl) ("xf86-input-mouse" ,xf86-input-mouse)
("python2-pyopengl-accelerate" ,python2-pyopengl-accelerate) ("xf86-input-keyboard" ,xf86-input-keyboard)
("python2-pygtk" ,python2-pygtk) ("python-pillow" ,python-pillow)
("python2-rencode" ,python2-rencode) ;; Optional dependencies.
("xorg-server" ,xorg-server))) ("python-rencode" ,python-rencode) ; For speed.
("python-numpy", python-numpy)
("python-pyopengl" ,python-pyopengl) ; Drawing acceleration.
("python-pyopengl-accelerate" ,python-pyopengl-accelerate) ; Same.
("python-paramiko" ,python-paramiko) ; Tunneling over SSH.
("python-dbus" ,python-dbus) ; For desktop notifications.
("dbus" ,dbus) ; For dbus-launch command.
("python-lz4" ,python-lz4) ; Faster compression than zlib.
("python-netifaces" ,python-netifaces)))
(native-inputs `(("pkg-config" ,pkg-config) (native-inputs `(("pkg-config" ,pkg-config)
("python2-cython" ,python2-cython))) ("python-cython" ,python-cython)))
(arguments (arguments
`(#:python ,python-2 ;; no full Python 3 support yet `(#:configure-flags '("--without-Xdummy"
#:configure-flags '("--with-tests" "--without-Xdummy_wrapper"
"--with-bundle_tests" "--with-opengl"
"--without-Xdummy" ;; We use Xvfb instead. "--without-debug"
"--without-Xdummy_wrapper" "--without-strict") ; Ignore compiler warnings.
"--without-strict")
#:modules ((guix build python-build-system) #:modules ((guix build python-build-system)
(guix build utils)) (guix build utils))
#:tests? #f ; Do not run test-cases. This would rebuild all modules and
; they seem to require python2.
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
;; built by 'install phase
(delete 'build) (delete 'build)
(delete 'check) ;; There's no test suite at the moment. (add-before 'install 'fix-paths
;; Remove BUILD_CPU, BUILD_DATE, BUILD_TIME from build info to
;; prevent deterministic issues. Also correct some directories and
;; use the xvfb binary instead of xorg-server (which doesn't seem to
;; work).
(add-before 'install 'remove-timestamps&set-file-names
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(substitute* "add_build_info.py" ;; Fix binary paths.
((".*\"BUILD_CPU\", get_cpuinfo.*") "")) (substitute* '("xpra/scripts/config.py" "xpra/x11/vfb_util.py")
(substitute* "add_build_info.py" (("\"Xvfb\"")
((".*\"BUILD_DATE\", datetime.*") "")) (string-append "\"" (assoc-ref inputs "xorg-server") "/bin/Xvfb\""))
(substitute* "add_build_info.py" (("\"Xorg\"")
((".*\"BUILD_TIME\", datetime.*") "")) (string-append "\"" (assoc-ref inputs "xorg-server") "/bin/Xorg\""))
(substitute* "setup.py" (("\"xauth\"")
(("/etc/init.d/") (string-append "\"" (assoc-ref inputs "xauth") "/bin/xauth\"")))
(string-append (assoc-ref outputs "out") ;; Fix directory of config files.
"/etc/init.d/"))) (substitute* '("xpra/scripts/config.py" "xpra/platform/xposix/paths.py")
(substitute* "setup.py" (("\"/etc/xpra/?\"")
(("/usr/lib/") (string-append "\"" (assoc-ref outputs "out") "/etc/xpra/\"")))
(string-append (assoc-ref outputs "out") "/lib/"))) ;; XXX: Stolen from (gnu packages linux)
;; Use Xvfb with '-nolisten local' to disable abstract X11 sockets. (define (append-to-file name body)
(substitute* "./xpra/scripts/config.py" (let ((file (open-file name "a")))
((":.*join.*xvfb.*") (display body file)
(string-append ": \"" (assoc-ref inputs "xorg-server") (close-port file)))
"/bin/Xvfb +extension Composite" ;; Add Xorg module paths.
" -screen 0 5760x2560x24+32 -dpi 96 -nolisten" (append-to-file
" tcp -nolisten local -noreset -auth" "etc/xpra/xorg.conf"
" $XAUTHORITY\",\n"))) (string-append "\nSection \"Files\"\nModulePath \""
(assoc-ref inputs "xf86-video-dummy") "/lib/xorg/modules,"
(assoc-ref inputs "xf86-input-mouse") "/lib/xorg/modules,"
(assoc-ref inputs "xf86-input-keyboard") "/lib/xorg/modules,"
(assoc-ref inputs "xorg-server") "/lib/xorg/modules\"\n"
"EndSection\n\n"))
(substitute* '("xpra/scripts/config.py"
"etc/xpra/conf.d/60_server.conf.in"
"unittests/unit/server/mixins/notification_test.py")
;; The trailing -- is intentional, so we only replace it inside
;; a command line.
(("dbus-launch --")
(string-append (assoc-ref inputs "dbus") "/bin/dbus-launch --")))
;; /run/user does not exist on guix system
(substitute* "./xpra/scripts/config.py" (substitute* "./xpra/scripts/config.py"
(("socket-dir.*: \"\",") (("socket-dir.*: \"\",")
"socket-dir\" : \"~/.xpra\",")) "socket-dir\" : \"~/.xpra\","))
#t))))) #t))
;; GTK3 will not be found, if GI cant find its typelibs.
(add-after
'install 'wrap-program
(lambda* (#:key outputs #:allow-other-keys)
(let ((prog (string-append (assoc-ref outputs "out")
"/bin/xpra")))
;; XXX: only export typelibs in inputs
(wrap-program prog
`("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH"))))
#t))))))
(home-page "https://www.xpra.org/") (home-page "https://www.xpra.org/")
(synopsis "Remote access to individual applications or full desktops") (synopsis "Remote access to individual applications or full desktops")
(description "Xpra is a persistent remote display server and client for (description "Xpra is a persistent remote display server and client for