gnu: gajim: Update to 1.7.3.
* 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. Add metadata build and install phase. Switch to "python -m unittest" as test method, following upstream recommendation. Generate gdk-pixbuf cache and include result in wrapper. Allows Gajim to run in pure environments. [native-search-paths]: Update. Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
		
							parent
							
								
									9d7daaf10f
								
							
						
					
					
						commit
						e99e0e0816
					
				
					 1 changed files with 56 additions and 43 deletions
				
			
		| 
						 | 
					@ -1127,7 +1127,7 @@ of xmpppy.")
 | 
				
			||||||
(define-public gajim
 | 
					(define-public gajim
 | 
				
			||||||
  (package
 | 
					  (package
 | 
				
			||||||
    (name "gajim")
 | 
					    (name "gajim")
 | 
				
			||||||
    (version "1.4.7")
 | 
					    (version "1.7.3")
 | 
				
			||||||
    (source
 | 
					    (source
 | 
				
			||||||
     (origin
 | 
					     (origin
 | 
				
			||||||
       (method url-fetch)
 | 
					       (method url-fetch)
 | 
				
			||||||
| 
						 | 
					@ -1136,26 +1136,41 @@ of xmpppy.")
 | 
				
			||||||
                       (version-major+minor version)
 | 
					                       (version-major+minor version)
 | 
				
			||||||
                       "/gajim-" version ".tar.gz"))
 | 
					                       "/gajim-" version ".tar.gz"))
 | 
				
			||||||
       (sha256
 | 
					       (sha256
 | 
				
			||||||
        (base32 "1ww46qlxr14nq0ka8wsf8qpn5qfi5dvgyksfh9411crl7azhfj0s"))
 | 
					        (base32 "066kvkjw3qcdanr3nczy0wgcwihk9jc9zhzfr5bwlqvcyxcv7k5p"))
 | 
				
			||||||
       (patches (search-patches "gajim-honour-GAJIM_PLUGIN_PATH.patch"))))
 | 
					       (patches (search-patches "gajim-honour-GAJIM_PLUGIN_PATH.patch"))))
 | 
				
			||||||
    (build-system python-build-system)
 | 
					    (build-system python-build-system)
 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     `(#:imported-modules
 | 
					     (list
 | 
				
			||||||
       (,@%python-build-system-modules
 | 
					      #:imported-modules
 | 
				
			||||||
 | 
					      `(,@%python-build-system-modules
 | 
				
			||||||
        (guix build glib-or-gtk-build-system))
 | 
					        (guix build glib-or-gtk-build-system))
 | 
				
			||||||
      #:modules
 | 
					      #:modules
 | 
				
			||||||
       ((guix build python-build-system)
 | 
					      '((guix build python-build-system)
 | 
				
			||||||
        ((guix build glib-or-gtk-build-system)
 | 
					        ((guix build glib-or-gtk-build-system)
 | 
				
			||||||
         #:prefix glib-or-gtk:)
 | 
					         #:prefix glib-or-gtk:)
 | 
				
			||||||
        (guix build utils))
 | 
					        (guix build utils))
 | 
				
			||||||
      #:phases
 | 
					      #:phases
 | 
				
			||||||
       (modify-phases %standard-phases
 | 
					      #~(modify-phases %standard-phases
 | 
				
			||||||
         (add-after 'unpack 'disable-failing-tests
 | 
					          (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 _
 | 
					            (lambda _
 | 
				
			||||||
             ;; XXX Gajim builds fine on some (my) machines but fails elsewhere:
 | 
					              (invoke "./pep517build/build_metadata.py" "-o" "dist/metadata")))
 | 
				
			||||||
             ;; ModuleNotFoundError: No module named 'gajim.gui.emoji_data'
 | 
					          ;; TODO: Change to pyproject-build-system once it supports
 | 
				
			||||||
             ;; https://dev.gajim.org/gajim/gajim/-/issues/11041
 | 
					          ;; in-tree build backends.
 | 
				
			||||||
             (delete-file "test/no_gui/test_styling.py")))
 | 
					          (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
 | 
					          (replace 'check
 | 
				
			||||||
            (lambda _
 | 
					            (lambda _
 | 
				
			||||||
              ;; Tests require a running X server.
 | 
					              ;; Tests require a running X server.
 | 
				
			||||||
| 
						 | 
					@ -1163,27 +1178,24 @@ of xmpppy.")
 | 
				
			||||||
              (setenv "DISPLAY" ":1")
 | 
					              (setenv "DISPLAY" ":1")
 | 
				
			||||||
              ;; For missing '/etc/machine-id'.
 | 
					              ;; For missing '/etc/machine-id'.
 | 
				
			||||||
              (setenv "DBUS_FATAL_WARNINGS" "0")
 | 
					              (setenv "DBUS_FATAL_WARNINGS" "0")
 | 
				
			||||||
             (invoke "dbus-launch" "python" "./setup.py" "test")))
 | 
					              (invoke "dbus-launch" "python" "-m" "unittest" "discover" "-s" "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)
 | 
					 | 
				
			||||||
          (add-after 'install 'glib-or-gtk-compile-schemas
 | 
					          (add-after 'install 'glib-or-gtk-compile-schemas
 | 
				
			||||||
            (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
 | 
					            (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
 | 
				
			||||||
          (add-after 'install 'glib-or-gtk-wrap
 | 
					          (add-after 'install 'glib-or-gtk-wrap
 | 
				
			||||||
            (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
 | 
					            (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
 | 
				
			||||||
          (add-after 'install 'wrap-env
 | 
					          (add-after 'install 'wrap-env
 | 
				
			||||||
           (lambda* (#:key outputs #:allow-other-keys)
 | 
					            (lambda _
 | 
				
			||||||
             (let ((out (assoc-ref outputs "out")))
 | 
					 | 
				
			||||||
              (for-each
 | 
					              (for-each
 | 
				
			||||||
               (lambda (name)
 | 
					               (lambda (name)
 | 
				
			||||||
                  (let ((file (string-append out "/bin/" name))
 | 
					                 (let ((file (string-append #$output "/bin/" name))
 | 
				
			||||||
                       (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))
 | 
					                       (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))
 | 
				
			||||||
                        (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
 | 
					                       (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
 | 
				
			||||||
 | 
					                       (pixbuf-module-file (getenv "GDK_PIXBUF_MODULE_FILE")))
 | 
				
			||||||
                   (wrap-program file
 | 
					                   (wrap-program file
 | 
				
			||||||
                     `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))
 | 
					                     `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))
 | 
				
			||||||
                      `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))
 | 
					                     `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
 | 
				
			||||||
                '("gajim" "gajim-remote"))))))))
 | 
					                     `("GDK_PIXBUF_MODULE_FILE" = (,pixbuf-module-file)))))
 | 
				
			||||||
 | 
					               '("gajim" "gajim-remote")))))))
 | 
				
			||||||
    (native-search-paths
 | 
					    (native-search-paths
 | 
				
			||||||
     (list
 | 
					     (list
 | 
				
			||||||
      (search-path-specification
 | 
					      (search-path-specification
 | 
				
			||||||
| 
						 | 
					@ -1202,7 +1214,7 @@ of xmpppy.")
 | 
				
			||||||
          ;; FIXME: Cannot use this expression as it would
 | 
					          ;; FIXME: Cannot use this expression as it would
 | 
				
			||||||
          ;; introduce a circular dependency at the top level.
 | 
					          ;; introduce a circular dependency at the top level.
 | 
				
			||||||
          ;; (version-major+minor (package-version python))
 | 
					          ;; (version-major+minor (package-version python))
 | 
				
			||||||
          "3.9"
 | 
					          "3.10"
 | 
				
			||||||
          "/site-packages"))))))
 | 
					          "/site-packages"))))))
 | 
				
			||||||
    (native-inputs
 | 
					    (native-inputs
 | 
				
			||||||
     (list gettext-minimal
 | 
					     (list gettext-minimal
 | 
				
			||||||
| 
						 | 
					@ -1210,6 +1222,7 @@ of xmpppy.")
 | 
				
			||||||
           gobject-introspection
 | 
					           gobject-introspection
 | 
				
			||||||
           `(,gtk+ "bin")
 | 
					           `(,gtk+ "bin")
 | 
				
			||||||
           python-distutils-extra
 | 
					           python-distutils-extra
 | 
				
			||||||
 | 
					           python-pypa-build
 | 
				
			||||||
           python-setuptools
 | 
					           python-setuptools
 | 
				
			||||||
           xorg-server-for-tests))
 | 
					           xorg-server-for-tests))
 | 
				
			||||||
    (inputs
 | 
					    (inputs
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue