diff mbox series

[bug#56169,v2] gnu: Add cambalache.

Message ID f948725ecb84176d843de662c548da2ebd0b4e89.camel@gmail.com
State Accepted
Headers show
Series [bug#56169,v2] gnu: Add cambalache. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Liliana Marie Prikler June 23, 2022, 2:17 p.m. UTC
* gnu/packages/gnome.scm (cambalache): New variable.
---
 gnu/packages/gnome.scm | 83 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

Comments

Daniel Meißner July 13, 2022, 9:37 a.m. UTC | #1
Hi Liliana,

I have tested v2 of your patch.  I installed cambalache into my user
profile using

./pre-inst-env guix install cambalache

Then launching a terminal from my DE (I use XFCE) and invoking
‘cambalache’.  It starts up fine, showing the Cambalache logo.  I then
click on the ‘new project’ icon in the header bar.  I choose GTK4 and
call the project ‘test’, then I click ‘Create’.  I am able to add a
GtkApplicationWindow with a GtkButton and change the label of that
button.  So far everything seems fine.  However, in the terminal it
still says:

--8<---------------cut here---------------start------------->8---
(.cambalache-real:7373): Gtk-WARNING **: 11:13:35.437: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
Traceback (most recent call last):
  File "/gnu/store/ax5i4mwlwjhk3jwr3kfb41n48fczp9hv-cambalache-0.10.2/lib/python3.9/site-packages/cambalache/cmb_property_controls.py", line 562, in __load_icon_finish
    self.__model[data][6] = info.load_icon_finish(res)
gi.repository.GLib.GError: gdk-pixbuf-error-quark: Format der Bilddatei unbekannt (3)
Traceback (most recent call last):
  File "/gnu/store/ax5i4mwlwjhk3jwr3kfb41n48fczp9hv-cambalache-0.10.2/lib/python3.9/site-packages/cambalache/cmb_property_controls.py", line 562, in __load_icon_finish
    self.__model[data][6] = info.load_icon_finish(res)
gi.repository.GLib.GError: gdk-pixbuf-error-quark: Format der Bilddatei unbekannt (3)
--8<---------------cut here---------------end--------------->8---

If I use the following command to start cambalache, there’s no such
warning about loading a pixbuf from an icon theme and no traceback:

    ./pre-inst-env guix shell  cambalache glib adwaita-icon-theme gsettings-desktop-schemas librsvg@2.50.7 --pure

I added the packages mentioned in the comment about using cambalache
from within guix shell.  The librsvg@2.50.7 is what I get if I call
librsvg-for-system from inside the module (gnu packages gnome).

Best
diff mbox series

Patch

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 0cde3caebd..1458a4cb5c 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -3208,6 +3208,89 @@  (define-public glade3
                                 (variable "GLADE_MODULE_SEARCH_PATH")
                                 (files '("lib/glade/modules")))))))
 
+(define-public cambalache
+  (package
+   (name "cambalache")
+   (version "0.10.2")
+   (source (origin
+            (method git-fetch)
+            (uri (git-reference
+                  (url "https://gitlab.gnome.org/jpu/cambalache")
+                  (commit version)))
+            (file-name (git-file-name name version))
+            (sha256
+             (base32 "1mw5gk98zx03yal3p8slaqwhwkc9p2vnh0cssnmg6ivxsjscqhgz"))))
+   (build-system meson-build-system)
+   (arguments
+    (list
+     #:glib-or-gtk? #t
+     #:imported-modules `((guix build python-build-system)
+                          ,@%meson-build-system-modules)
+     #:modules '((guix build meson-build-system)
+                 ((guix build python-build-system) #:prefix python:)
+                 (guix build utils))
+     #:phases
+     #~(modify-phases %standard-phases
+         (add-after 'unpack 'patch-source
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "cambalache/cmb_view.py"
+               (("GLib\\.find_program_in_path\\('(.*)'\\)" all cmd)
+                (string-append "'"
+                               (search-input-file inputs
+                                                  (string-append "/bin/" cmd))
+                               "'")))))
+         (add-after 'unpack 'patch-build
+           (lambda _
+             (substitute* "postinstall.py"
+               (("update-desktop-database") "true"))))
+         (add-after 'wrap 'python-wrap (assoc-ref python:%standard-phases 'wrap))
+         (delete 'check)
+         (add-after 'install 'add-install-to-pythonpath
+           (assoc-ref python:%standard-phases 'add-install-to-pythonpath))
+         (add-after 'add-install-to-pythonpath 'pre-check
+           (lambda _
+             (system "Xvfb :1 &")
+             (setenv "DISPLAY" ":1")))
+         (add-after 'pre-check 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (with-directory-excursion ".."
+                 (invoke "python3" "-m" "pytest")))))
+         (add-after 'glib-or-gtk-wrap 'wrap-typelib
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (for-each
+                (lambda (prog)
+                  (unless (wrapped-program? prog)
+                    (wrap-program
+                        prog
+                      `("GI_TYPELIB_PATH" suffix
+                        (,(string-append out "/lib/girepository-1.0")
+                         ,(getenv "GI_TYPELIB_PATH"))))))
+                (find-files (string-append out "/bin")))))))))
+   (inputs (list bash-minimal
+                 libadwaita
+                 python python-pygobject python-lxml
+                 gtk
+                 `(,gtk+ "bin") ; broadwayd
+                 `(,gtk "bin")
+                 webkitgtk-with-libsoup2))
+   ;; XXX: inside a pure shell, the following need to exist as well
+   ;; (in addition to glib) for cambalache to function as expected
+   ;; (propagated-inputs (list adwaita-icon-theme
+   ;;                          gsettings-desktop-schemas
+   ;;                          (librsvg-for-system)))
+   (native-inputs (list `(,glib "bin") gobject-introspection
+                        gettext-minimal pkg-config
+                        python-pytest xorg-server-for-tests))
+   (home-page "https://gitlab.gnome.org/jpu/cambalache")
+   (synopsis "Rapid application development tool")
+   (description "Cambalache is a rapid application development (RAD) tool for
+Gtk 4 and 3 with a clear model-view-controller (MVC) design and
+data model first philosophy.")
+   (license (list license:lgpl2.1
+                  license:gpl2)))) ; tools
+
 (define-public libcroco
   (package
     (name "libcroco")