unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#56169] [PATCH] gnu: Add cambalache.
@ 2022-06-23 14:17 Liliana Marie Prikler
  2022-06-29  7:21 ` Daniel Meißner via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Liliana Marie Prikler @ 2022-06-23 14:17 UTC (permalink / raw)
  To: 56169

* gnu/packages/gnome.scm (cambalache): New variable.
---
 gnu/packages/gnome.scm | 75 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 0cde3caebd..71667086f4 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -3208,6 +3208,81 @@ (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)
+             (for-each
+              (lambda (prog)
+                (unless (wrapped-program? prog)
+                  (wrap-program
+                   prog
+                   `("GI_TYPELIB_PATH" suffix (,(getenv "GI_TYPELIB_PATH"))))))
+              (find-files (string-append (assoc-ref outputs "out")
+                                         "/bin"))))))))
+   (inputs (list bash-minimal
+                 python python-pygobject python-lxml
+                 gtk
+                 `(,gtk+ "bin") ; broadwayd
+                 `(,gtk "bin")
+                 webkitgtk-with-libsoup2))
+   (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")
-- 
2.36.1





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#56169] [PATCH] gnu: Add cambalache.
  2022-06-23 14:17 [bug#56169] [PATCH] gnu: Add cambalache Liliana Marie Prikler
@ 2022-06-29  7:21 ` Daniel Meißner via Guix-patches via
  2022-06-29 16:59   ` Liliana Marie Prikler
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Meißner via Guix-patches via @ 2022-06-29  7:21 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: 56169

Hi Liliana,

Thanks for packaging Cambalache :-) I have applied your patch to my
local Guix checkout and it builds fine.  However, running

    ./pre-inst-env guix shell cambalache -- cambalace

Cambalache starts up but I am unable to add any widgets.  There are some
error messages written to stderr that complain about a missing
typelib: CambalachePrivate.  I see that you wrap the programme but you
did not include the path to the CambalachePrivate typelib.  So maybe
this is causing the problem?

Additionally, the icons in the headerbar are missing.  This seems to be
related to:

Missing dependency for Xournal++
https://issues.guix.gnu.org/51968

Best

-- 
Daniel




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#56169] [PATCH] gnu: Add cambalache.
  2022-06-29  7:21 ` Daniel Meißner via Guix-patches via
@ 2022-06-29 16:59   ` Liliana Marie Prikler
  2022-06-30  9:16     ` Daniel Meißner via Guix-patches via
  0 siblings, 1 reply; 5+ messages in thread
From: Liliana Marie Prikler @ 2022-06-29 16:59 UTC (permalink / raw)
  To: Daniel Meißner; +Cc: 56169

Am Mittwoch, dem 29.06.2022 um 09:21 +0200 schrieb Daniel Meißner:
> Hi Liliana,
> 
> Thanks for packaging Cambalache :-) I have applied your patch to my
> local Guix checkout and it builds fine.  However, running
> 
>     ./pre-inst-env guix shell cambalache -- cambalace
> 
> Cambalache starts up but I am unable to add any widgets.  There are
> some error messages written to stderr that complain about a missing
> typelib: CambalachePrivate.  I see that you wrap the programme but
> you did not include the path to the CambalachePrivate typelib.  So
> maybe this is causing the problem?
Thanks, I'll update the patch accordingly soon™.

> Additionally, the icons in the headerbar are missing.  This seems to
> be related to:
> 
> Missing dependency for Xournal++
> https://issues.guix.gnu.org/51968
For this class of bugs, I'd always try to include glib in the guix
shell and check if the issue persists.  We don't build icon caches per
package, so the only way to fix that is to get XDG_DATA_DIRS into your
profile.

Cheers




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#56169] [PATCH] gnu: Add cambalache.
  2022-06-29 16:59   ` Liliana Marie Prikler
@ 2022-06-30  9:16     ` Daniel Meißner via Guix-patches via
  2022-06-30 15:25       ` Liliana Marie Prikler
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Meißner via Guix-patches via @ 2022-06-30  9:16 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: 56169

Liliana Marie Prikler writes:

> Am Mittwoch, dem 29.06.2022 um 09:21 +0200 schrieb Daniel Meißner:
>> Hi Liliana,
>> 
>> Thanks for packaging Cambalache :-) I have applied your patch to my
>> local Guix checkout and it builds fine.  However, running
>> 
>>     ./pre-inst-env guix shell cambalache -- cambalace
>> 
>> Cambalache starts up but I am unable to add any widgets.  There are
>> some error messages written to stderr that complain about a missing
>> typelib: CambalachePrivate.  I see that you wrap the programme but
>> you did not include the path to the CambalachePrivate typelib.  So
>> maybe this is causing the problem?
> Thanks, I'll update the patch accordingly soon™.

I did a first try by wrapping the programme as follows:

--8<---------------cut here---------------start------------->8---
(wrap-program prog
              `("GI_TYPELIB_PATH"
                suffix
                (,(getenv "GI_TYPELIB_PATH")
                 ,(string-append #$output "/lib/girepository-1.0"))))
--8<---------------cut here---------------end--------------->8---

Now, with this, cambalache finds the typelib but complains on two other
things:

1. There's another typelib called Adw which is not found
2. gi.repository.GLib.GError: gdk-pixbuf-error-quark: Format der Bilddatei unbekannt (3)

Now 2. is more severe since it occurs when I add for example a
GtkApplicationWindow to the project.  This widget does not show up and I
cannot add other widgets to the application window.


>> Additionally, the icons in the headerbar are missing.  This seems to
>> be related to:
>> 
>> Missing dependency for Xournal++
>> https://issues.guix.gnu.org/51968
> For this class of bugs, I'd always try to include glib in the guix
> shell and check if the issue persists.  We don't build icon caches per
> package, so the only way to fix that is to get XDG_DATA_DIRS into your
> profile.

Thanks for the hint.  IIUC, the inclusion of glib into the profile
triggers a hook for generating the appropiate XDG_DATA_DIRS env variable
into the profile, right?  Is the reason why icon caches are not
per-package so that different icon-themes can work?  Sorry, this is
taking an orthogonal direction.

Best

-- 
Daniel




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#56169] [PATCH] gnu: Add cambalache.
  2022-06-30  9:16     ` Daniel Meißner via Guix-patches via
@ 2022-06-30 15:25       ` Liliana Marie Prikler
  0 siblings, 0 replies; 5+ messages in thread
From: Liliana Marie Prikler @ 2022-06-30 15:25 UTC (permalink / raw)
  To: Daniel Meißner; +Cc: 56169

Am Donnerstag, dem 30.06.2022 um 11:16 +0200 schrieb Daniel Meißner:
> Liliana Marie Prikler writes:
> 
> > Am Mittwoch, dem 29.06.2022 um 09:21 +0200 schrieb Daniel Meißner:
> > > Hi Liliana,
> > > 
> > > Thanks for packaging Cambalache :-) I have applied your patch to
> > > my
> > > local Guix checkout and it builds fine.  However, running
> > > 
> > >     ./pre-inst-env guix shell cambalache -- cambalace
> > > 
> > > Cambalache starts up but I am unable to add any widgets.  There
> > > are
> > > some error messages written to stderr that complain about a
> > > missing
> > > typelib: CambalachePrivate.  I see that you wrap the programme
> > > but
> > > you did not include the path to the CambalachePrivate typelib. 
> > > So
> > > maybe this is causing the problem?
> > Thanks, I'll update the patch accordingly soon™.
> 
> I did a first try by wrapping the programme as follows:
> 
> --8<---------------cut here---------------start------------->8---
> (wrap-program prog
>               `("GI_TYPELIB_PATH"
>                 suffix
>                 (,(getenv "GI_TYPELIB_PATH")
>                  ,(string-append #$output "/lib/girepository-1.0"))))
> --8<---------------cut here---------------end--------------->8---
> 
> Now, with this, cambalache finds the typelib but complains on two
> other things:
> 
> 1. There's another typelib called Adw which is not found
Should be resolved by adding libadwaita to the inputs.
> 2. gi.repository.GLib.GError: gdk-pixbuf-error-quark: Format der
> Bilddatei unbekannt (3)
A broken image?  Any supporting hints like file paths?

> Now 2. is more severe since it occurs when I add for example a
> GtkApplicationWindow to the project.  This widget does not show up
> and I cannot add other widgets to the application window.
> 
> > > Additionally, the icons in the headerbar are missing.  This seems
> > > to
> > > be related to:
> > > 
> > > Missing dependency for Xournal++
> > > https://issues.guix.gnu.org/51968
> > For this class of bugs, I'd always try to include glib in the guix
> > shell and check if the issue persists.  We don't build icon caches
> > per package, so the only way to fix that is to get XDG_DATA_DIRS
> > into your profile.
> 
> Thanks for the hint.  IIUC, the inclusion of glib into the profile
> triggers a hook for generating the appropiate XDG_DATA_DIRS env
> variable into the profile, right?  Is the reason why icon caches are
> not per-package so that different icon-themes can work?  Sorry, this
> is taking an orthogonal direction.
It's a practical limitation.  There is a single file, that would leat
to a very large number of conflicts, most of them harmless but still
time-consuming to resolve.  Thus we leave it to a profile hook to
actually generate the icon themes.   This hook runs regardless, but
XDG_DATA_DIRS won't be set by it.

Cheers




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-30 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 14:17 [bug#56169] [PATCH] gnu: Add cambalache Liliana Marie Prikler
2022-06-29  7:21 ` Daniel Meißner via Guix-patches via
2022-06-29 16:59   ` Liliana Marie Prikler
2022-06-30  9:16     ` Daniel Meißner via Guix-patches via
2022-06-30 15:25       ` Liliana Marie Prikler

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).