diff mbox series

[bug#44400,v3,1/5] WIP: gnu: Add phosh.

Message ID IruD3EyXSCGFp-IpoM65x9I9b7XTOyHF8H2-5fqOZgvewo6XjaZ6ezFtZdTjoB3Kcx5BaIn_OltI59Qp8YIm5KQ6csweyRVIfqcLrbibMQY=@protonmail.com
State New
Headers show
Series [bug#44400,v3,1/5] WIP: gnu: Add phosh. | expand

Commit Message

phodina March 24, 2022, 1:32 p.m. UTC
Hi Jonathan,

the current patch set is based on the master branch. Running the Guix command
gives me 26 dependent packages - not a massive number.
```
./pre-inst-env guix refresh --list-dependent libhandy
Building the following 26 packages would ensure 54 dependent packages are rebuilt:
cozy@1.2.0 markets@0.5.3 gtranslator@40.0 apostrophe@2.5 eiciel@0.9.13.1 denemo@2.6.0
gpaste@3.42.2 arc-theme@20210412 gnome-shell-extension-gsconnect@48
 numix-gtk-theme@2.6.7 eolie@0.9.101 deja-dup@42.8 lollypop@1.4.24 gnome-tweaks@40.0
 passwordsafe@5.1 geary@40.0 komikku@0.37.0 phosh@0.14.0 seahorse@41.0 gnome@41.0
 tootle@1.0 chatty@0.4.0 sideload@6.0.2 giara@0.3 gfeeds@0.16.2 blanket@0.5.0
```

I've given up on meson build system and just build it as a regular Rust package
with cargo build system.

Btw squeekboard is a requirement for Phosh to work as stated by Guido [1].

See the patches attached.

The current issue I face is probably due to the fact I fix the requirements
as squeekboard depends on older versions of packages that are no longer in Guix.

Should I bring the packages back or attempt to patch the Phosh upstream to use
newer versions of Rust crates?

> Regarding that schema issue: does it occur as well when you install the
> phosh package?

I'm stuck with squeekboard with these errors:

```
Compiling rs v0.1.0 (/tmp/guix-build-squeekboard-1.17.0.drv-0/source)
error[E0599]: no function or associated item named `from_glib_none` found for struct `gtk::Widget` in the current scope
   --> src/drawing.rs:262:40
    |
262 |     let widget = unsafe { gtk::Widget::from_glib_none(keyboard.0) };
    |                                        ^^^^^^^^^^^^^^ function or associated item not found in `gtk::Widget`
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
3   | use glib::translate::FromGlibPtrNone;
    |

error[E0599]: no method named `unwrap` found for struct `glib::variant::Variant` in the current scope
   --> src/popover.rs:136:52
    |
136 |         let inputs = settings.get_value("sources").unwrap();
    |                                                    ^^^^^^ method not found in `glib::variant::Variant`

error[E0308]: mismatched types
   --> src/popover.rs:145:13
    |
145 |             &variants::ArrayPairString(inputs).to_variant(),
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `glib::variant::Variant`, found struct `glib::Variant`
    |
    = note: expected reference `&glib::variant::Variant`
               found reference `&glib::Variant`
    = note: perhaps two different versions of crate `glib` are being used?

error[E0599]: no function or associated item named `from_glib_none` found for struct `gtk::Widget` in the current scope
   --> src/popover.rs:253:40
    |
253 |     let window = unsafe { gtk::Widget::from_glib_none(window.0) };
    |                                        ^^^^^^^^^^^^^^ function or associated item not found in `gtk::Widget`
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
3   | use glib::translate::FromGlibPtrNone;
    |

error[E0599]: no method named `unwrap` found for struct `glib::variant::Variant` in the current scope
   --> src/popover.rs:264:56
    |
264 |             let inputs = settings.get_value("sources").unwrap();
    |                                                        ^^^^^^ method not found in `glib::variant::Variant`

error[E0308]: mismatched types
   --> src/popover.rs:340:18
    |
340 |             Some(current_layout_name.to_variant().type_()),
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `glib::variant_type::VariantTy`, found struct `VariantTy`
    |
    = note: expected reference `&glib::variant_type::VariantTy`
               found reference `&VariantTy`
    = note: perhaps two different versions of crate `glib` are being used?

error[E0308]: mismatched types
   --> src/popover.rs:341:13
    |
341 |             &current_layout_name.to_variant()
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `glib::variant::Variant`, found struct `glib::Variant`
    |
    = note: expected reference `&glib::variant::Variant`
               found reference `&glib::Variant`
    = note: perhaps two different versions of crate `glib` are being used?

error[E0308]: mismatched types
   --> src/popover.rs:387:9
    |
387 |         Continue(false)
    |         ^^^^^^^^^^^^^^^ expected struct `glib::Continue`, found struct `gdk::prelude::Continue`
    |
    = note: perhaps two different versions of crate `glib` are being used?

error[E0599]: no method named `to_glib_full` found for struct `CssProvider` in the current scope
   --> src/style.rs:64:18
    |
64  |         provider.to_glib_full()
    |                  ^^^^^^^^^^^^ method not found in `CssProvider`
    |
   ::: /tmp/guix-build-squeekboard-1.17.0.drv-0/source/guix-vendor/rust-glib-0.9.3.tar.gz/src/translate.rs:279:8
    |
279 |     fn to_glib_full(&self) -> P {
    |        ------------ the method is available for `CssProvider` here
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
29  |     use glib::translate::ToGlibPtr;
    |

error[E0599]: the method `get_property` exists for reference `&gtk::Settings`, but its trait bounds were not satisfied
   --> src/style.rs:104:44
    |
104 |       let prop = |s: &gtk::Settings, name| s.get_property(name);
    |                                              ^^^^^^^^^^^^ method cannot be called on `&gtk::Settings` due to unsatisfied trait bounds
    |
   ::: /tmp/guix-build-squeekboard-1.17.0.drv-0/source/guix-vendor/rust-gtk-0.8.1.tar.gz/src/auto/settings.rs:23:1
    |
23  | / glib_wrapper! {
24  | |     pub struct Settings(Object<gtk_sys::GtkSettings, gtk_sys::GtkSettingsClass, SettingsClass>) @implements StyleProvider;
25  | |
26  | |     match fn {
27  | |         get_type => || gtk_sys::gtk_settings_get_type(),
28  | |     }
29  | | }
    | | -
    | | |
    | |_doesn't satisfy `gtk::Settings: glib::ObjectExt`
    |   doesn't satisfy `gtk::Settings: glib::ObjectType`
    |
    = note: the following trait bounds were not satisfied:
            `gtk::Settings: glib::ObjectType`
            which is required by `gtk::Settings: glib::ObjectExt`
            `&gtk::Settings: glib::ObjectType`
            which is required by `&gtk::Settings: glib::ObjectExt`
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
21  | use gdk::prelude::ObjectExt;
    |

Some errors have detailed explanations: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `rs` due to 10 previous errors
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "cargo" arguments: ("build" "--release") exit-status: 101 term-signal: #f stop-signal: #f>
```

[1] https://gitlab.gnome.org/World/Phosh/phosh/-/issues/692

----
Petr
diff mbox series

Patch

From 1fc1bca4767f9876dd6d6cb102e76ab8d8bca120 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 17 Nov 2021 11:14:15 +0100
Subject: [PATCH v3 5/5] gnu: Add phosh.

* gnu/packages/gnome.scm (phosh): New variable.

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index a481b1db79..c2e1223725 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -91,6 +91,7 @@  (define-module (gnu packages gnome)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages aidc)
   #:use-module (gnu packages aspell)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages backup)
@@ -1353,6 +1354,112 @@  (define-public phodav
    (home-page "https://wiki.gnome.org/phodav")
    (license license:lgpl2.1+)))
 
+(define-public phosh
+  (package
+    (name "phosh")
+    (version "0.14.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://gitlab.gnome.org/World/Phosh/phosh")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0fhp2jmwjzzxd66b4figc2wdpzdjycpq3cf4lx3z04dzl9vmw65a"))))
+    (build-system meson-build-system)
+    (arguments
+     `(#:modules ((guix build meson-build-system)
+	              ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
+				  (guix build utils)
+				  (ice-9 match))
+       #:imported-modules ((guix build glib-or-gtk-build-system)
+	                       ,@%meson-build-system-modules)
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'get-libgnome-volume-control
+           (lambda* (#:key inputs #:allow-other-keys)
+             (copy-recursively (assoc-ref inputs "libgnome-volume-control-source")
+                               "subprojects/gvc")))
+         (add-after 'unpack 'get-libcall-ui
+           (lambda* (#:key inputs #:allow-other-keys)
+             (copy-recursively (assoc-ref inputs "libcall-ui")
+                               "subprojects/libcall-ui")))
+         ;; we use elogind instead of systemd
+         (add-after 'unpack 'patch-systemd
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "meson.build"
+               (("libsystemd") "libelogind"))
+             (substitute* "src/meson.build"
+               (("libsystemd_dep") "libelogind_dep"))
+             (substitute* "src/util.c"
+               (("systemd/sd-login.h") "elogind/sd-login.h"))
+             (substitute* "src/main.c"
+               (("systemd/sd-daemon.h") "elogind/sd-daemon.h"))))
+         (add-before 'configure 'fix-phoc-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "data/phosh.in"
+               (("@bindir@") (string-append (assoc-ref inputs "phoc") "/bin")))))
+		 (add-after 'install 'glib-or-gtk-compile-schemas
+		  (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
+		 (add-after 'install 'glib-or-gtk-wrap
+		  (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
+         (delete 'check)    ; TODO: needs a running wayland compositor
+         )))
+    (native-inputs
+     `(("elogind" ,elogind)
+       ("gcr" ,gcr)
+       ("gettext" ,gettext-minimal)
+       ("git" ,git)
+       ("glib:bin" ,glib "bin")
+	   ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
+       ("gnome-desktop" ,gnome-desktop)
+       ("gtk+:bin" ,gtk+ "bin")
+       ("pkg-config" ,pkg-config)))
+	(inputs `(
+       ("libgnome-volume-control-source" ; needs to be present in subprojects/gvc folder
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://gitlab.gnome.org/GNOME/libgnome-volume-control.git")
+                 (commit "ae1a34aafce7026b8c0f65a43c9192d756fe1057")))
+           (file-name (string-append name "-" version "-checkout"))
+           (sha256
+            (base32
+             "0a4qh5pgyjki904qf7qmvqz2ksxb0p8xhgl2aixfbhixn0pw6saw"))))
+       ("libcall-ui" ; needs to be present in subprojects/libcall-ui folder
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://gitlab.gnome.org/World/Phosh/libcall-ui")
+                 (commit "465f6add090b623fb80c6c5cbb9ab2880ff531a4")))
+           (file-name (string-append name "-" version "-checkout"))
+           (sha256
+            (base32
+             "1as857npl2yra4zh4bfph9wvhvjck53i2qp3zzbv3mbpi36nscfr"))))
+       ("callaudiod" ,callaudiod)
+       ("libsecret" ,libsecret)
+       ("linux-pam" ,linux-pam)
+       ("network-manager" ,network-manager)
+       ("polkit" ,polkit)
+       ("upower" ,upower)
+       ("feedbackd" ,feedbackd)
+       ("libhandy" ,libhandy)
+       ("libgudev" ,libgudev)
+       ("pulseaudio" ,pulseaudio)))
+    (propagated-inputs
+     ;; "missing" schema files
+     ;; org.gnome.DejaDup.File org.guido-berhoerster.code.package-update-indicator org.blueberry
+     `(("gsettings-desktop-schemas" ,gsettings-desktop-schemas) ;org.gnome.desktop.wm.keybindings
+       ("gnome-session" ,gnome-session)
+       ("mutter" ,mutter)               ;org.gnome.mutter.keybindings
+       ("network-manager-applet" ,network-manager-applet) ;org.gnome.nm-applet
+       ("phoc" ,phoc)))                 ;sm.puri.phoc
+    (synopsis "Wayland shell for GNOME on mobile devices")
+    (description "Phosh is a pure Wayland prototype intended for mobile devices.")
+    (home-page "https://gitlab.gnome.org/World/Phosh/phosh")
+    (license license:gpl3+)))
+
 (define-public gnome-color-manager
   (package
    (name "gnome-color-manager")
-- 
2.34.0