From 228be2a154607fa97d561366bd6f7e99fbcf61ab Mon Sep 17 00:00:00 2001 From: Petr Hodina Date: Wed, 17 Nov 2021 10:58:55 +0100 Subject: [PATCH v3 2/5] gnu: Add phoc. * gnu/packages/gnome.scm (phoc): New variable. diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index bc99454b1b..0bf5a8ed2f 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -69,6 +69,7 @@ ;;; Copyright © 2022 Pierre Langlois ;;; Copyright © 2022 John Kehayias ;;; Copyright © 2022 Denis 'GNUtoo' Carikli +;;; Copyright © 2021, 2022 Petr Hodina ;;; ;;; This file is part of GNU Guix. ;;; @@ -1168,6 +1169,81 @@ (define-public mm-common (home-page "https://gitlab.gnome.org/GNOME/mm-common") (license license:gpl2+))) +(define-public phoc + (package + (name "phoc") + (version "0.9.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.gnome.org/World/Phosh/phoc") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "18nwjbyjxq11ppfdky3bnfh9pr23fjl2543jwva0iz1n6c8mkpd9")))) + (build-system meson-build-system) + (arguments + `(#:tests? #f ; requires server connection + #:phases + (modify-phases %standard-phases + ; source of wlroots required in subprojects/wlroots folder + (add-after 'unpack 'get-wlroots + (lambda* (#:key inputs #:allow-other-keys) + (copy-recursively (assoc-ref inputs "wlroots-librem5-source") + "subprojects/wlroots") + #t)) + (add-after 'get-wlroots 'patch-paths + (lambda _ + (substitute* "src/server.c" + (("/bin/sh") (which "sh"))) + (substitute* "tests/test-run.c" + (("/bin/true") (which "true")) + (("/bin/false") (which "false"))) + #t)) + ;; Those check a running phoc server against some screenshots in the repo. + ;; They differ only by the mouse cursor (shadow vs. no shadow). + (add-before 'patch-paths 'disable-failing-tests + (lambda _ + (substitute* "tests/meson.build" + (("'layer-shell',") "") + (("'xdg-shell',") "") + (("'phosh'") "")) + #t)) + (add-before 'check 'pre-check + (lambda* (#:key inputs #:allow-other-keys) + ;; Tests require a running X server. + (system "Xvfb :1 &") + (setenv "DISPLAY" ":1") + #t))))) + (native-inputs + `(("gobject-introspection" ,gobject-introspection) + ("glib:bin" ,glib "bin") + ("gnome-desktop" ,gnome-desktop) + ("libinput" ,libinput) + ("libxkbcommon" ,libxkbcommon) + ("pkg-config" ,pkg-config) + ("wayland" ,wayland) + ("wayland-protocols" ,wayland-protocols) + ("wlroots-librem5-source" ; patched version for Librem 5 + ,(origin + (method git-fetch) + (uri (git-reference + (url "https://source.puri.sm/Librem5/wlroots.git") + (commit "5413b1ec61c6e3390929db595c0ec92f92ea2594"))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "02q70244sfs2jzl8mxsvd51rrv59jxllyss821xgg0cmq49rgq5w")))) + ("xorg-server" ,xorg-server-for-tests))) + (propagated-inputs + `(("mutter" ,mutter))) + (synopsis "Wayland compositor for mobile phones") + (description "Phoc is a wayland compositor for mobile phones based on + wlroots.") + (home-page "https://gitlab.gnome.org/World/Phosh/phoc") + (license license:gpl3+))) + (define-public phodav (package (name "phodav") -- 2.34.0