all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Parnikkapore via Guix-patches via <guix-patches@gnu.org>
To: 64021@debbugs.gnu.org
Subject: [bug#64021] [PATCH v2 2/6] gnu: gajim: Update to 1.7.3.
Date: Tue,  4 Jul 2023 23:31:09 +0700	[thread overview]
Message-ID: <fd84fffcd04a4dcbe2f8556c19fd3ec51d969698.1688488273.git.poomklao@yahoo.com> (raw)
In-Reply-To: <61a27ed52288bab9945aa256a1193e6956b60616.1688488273.git.poomklao@yahoo.com>

* gnu/packages/messaging.scm (gajim): Update to 1.7.3.
  [arguments]: Switch to "python -m build".
  To use pyproject-build-system, support for backend-path is needed.
  [arguments]: Add metadata build and install phase.
  [arguments]: Switch to "python -m unittest" as test method,
  following upstream recommendation.
  [arguments]: Generate gdk-pixbuf cache and include result in wrapper.
  Allows Gajim to run in pure environments.
  [native-search-paths]: Update.
---
 gnu/packages/messaging.scm | 62 +++++++++++++++++++++++---------------
 1 file changed, 37 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index 1b721e8f8e..8fc4c48e47 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -1126,7 +1126,7 @@ (define-public python-nbxmpp
 (define-public gajim
   (package
     (name "gajim")
-    (version "1.4.7")
+    (version "1.7.3")
     (source
      (origin
        (method url-fetch)
@@ -1135,7 +1135,7 @@ (define-public gajim
                        (version-major+minor version)
                        "/gajim-" version ".tar.gz"))
        (sha256
-        (base32 "1ww46qlxr14nq0ka8wsf8qpn5qfi5dvgyksfh9411crl7azhfj0s"))
+        (base32 "066kvkjw3qcdanr3nczy0wgcwihk9jc9zhzfr5bwlqvcyxcv7k5p"))
        (patches (search-patches "gajim-honour-GAJIM_PLUGIN_PATH.patch"))))
     (build-system python-build-system)
     (arguments
@@ -1148,13 +1148,27 @@ (define-public gajim
          #:prefix glib-or-gtk:)
         (guix build utils))
        #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'disable-failing-tests
+       ,#~(modify-phases %standard-phases
+         (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
+           (assoc-ref glib-or-gtk:%standard-phases
+                      'generate-gdk-pixbuf-loaders-cache-file))
+         (add-before 'build 'build-metadata
            (lambda _
-             ;; XXX Gajim builds fine on some (my) machines but fails elsewhere:
-             ;; ModuleNotFoundError: No module named 'gajim.gui.emoji_data'
-             ;; https://dev.gajim.org/gajim/gajim/-/issues/11041
-             (delete-file "test/no_gui/test_styling.py")))
+             (invoke "./pep517build/build_metadata.py" "-o" "dist/metadata")))
+         ;; TODO: Change to pyproject-build-system once it supports
+         ;; in-tree build backends.
+         (replace 'build
+           (lambda _
+             (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
+         (replace 'install
+           (lambda _
+             (apply invoke "pip" "--no-cache-dir" "--no-input"
+                    "install" "--no-deps" "--prefix" #$output
+                    (find-files "dist" "\\.whl$"))))
+         (add-after 'install 'install-metadata
+           (lambda _
+             (invoke "./pep517build/install_metadata.py" "dist/metadata"
+                     (string-append "--prefix=" #$output))))
          (replace 'check
            (lambda _
              ;; Tests require a running X server.
@@ -1162,27 +1176,24 @@ (define-public gajim
              (setenv "DISPLAY" ":1")
              ;; For missing '/etc/machine-id'.
              (setenv "DBUS_FATAL_WARNINGS" "0")
-             (invoke "dbus-launch" "python" "./setup.py" "test")))
-         ;; Loading gajim_remote require running session bus,
-         ;; which in-turn requires running elogind for XDG_RUNTIME_DIR;
-         ;; neither of which are possible inside build environment.
-         (delete 'sanity-check)
+             (invoke "dbus-launch" "python" "-m" "unittest" "discover" "-s" "test")))
          (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))
          (add-after 'install 'wrap-env
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
-               (for-each
-                (lambda (name)
-                  (let ((file (string-append out "/bin/" name))
-                        (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))
-                        (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
-                    (wrap-program file
-                      `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))
-                      `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))
-                '("gajim" "gajim-remote"))))))))
+           (lambda _
+             (for-each
+               (lambda (name)
+                 (let ((file (string-append #$output "/bin/" name))
+                       (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))
+                       (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
+                       (pixbuf-module-file (getenv "GDK_PIXBUF_MODULE_FILE")))
+                   (wrap-program file
+                     `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))
+                     `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
+                     `("GDK_PIXBUF_MODULE_FILE" = (,pixbuf-module-file)))))
+               '("gajim" "gajim-remote")))))))
     (native-search-paths
      (list
       (search-path-specification
@@ -1201,7 +1212,7 @@ (define-public gajim
           ;; FIXME: Cannot use this expression as it would
           ;; introduce a circular dependency at the top level.
           ;; (version-major+minor (package-version python))
-          "3.9"
+          "3.10"
           "/site-packages"))))))
     (native-inputs
      (list gettext-minimal
@@ -1209,6 +1220,7 @@ (define-public gajim
            gobject-introspection
            `(,gtk+ "bin")
            python-distutils-extra
+           python-pypa-build
            python-setuptools
            xorg-server-for-tests))
     (inputs
-- 
2.40.1





  reply	other threads:[~2023-07-04 16:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <d843f47ac84e5578ba9ed9f441c59ed83a448a4d.1686581089.git.poomklao.ref@yahoo.com>
2023-06-12 14:50 ` [bug#64021] [PATCH] gnu: gajim: Update to 1.7.3 Parnikkapore via Guix-patches via
2023-06-20 21:46   ` Ludovic Courtès
2023-07-04 16:31   ` [bug#64021] [PATCH v2 1/6] gnu: python-nbxmpp: Update to 4.2.2 Parnikkapore via Guix-patches via
2023-07-04 16:31     ` Parnikkapore via Guix-patches via [this message]
2023-07-04 16:31     ` [bug#64021] [PATCH v2 3/6] gnu: gajim-omemo: Update to 2.9.0 Parnikkapore via Guix-patches via
2023-07-04 16:31     ` [bug#64021] [PATCH v2 4/6] gnu: gajim-openpgp: Update to 1.5.0 Parnikkapore via Guix-patches via
2023-07-04 16:31     ` [bug#64021] [PATCH v2 5/6] gnu: python-nbxmpp: Clean up formatting Parnikkapore via Guix-patches via
2023-07-04 16:31     ` [bug#64021] [PATCH v2 6/6] gnu: gajim: " Parnikkapore via Guix-patches via
2023-09-27 11:14       ` Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd84fffcd04a4dcbe2f8556c19fd3ec51d969698.1688488273.git.poomklao@yahoo.com \
    --to=guix-patches@gnu.org \
    --cc=64021@debbugs.gnu.org \
    --cc=poomklao@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.