Subject: [PATCH gnome-team 25/44] gnu: modem-manager: Update to 1.22.0.

From: Maxim Cournoyer <[email-masked]>
Date: Mon, 11 Nov 2024 15:17:08 +0900

* gnu/packages/freedesktop.scm (modem-manager): Update to 1.22.0.
[source]: Fetch via git.  Apply patch.
[build-system]: Switch to meson-build-system.
[arguments]: Adjust #:configure-flags for new build system.
[native-inputs]: Add libxslt.
[inputs]: Add bash-completion and elogind.
* gnu/packages/patches/modem-manager-typelib.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register it.

Change-Id: Ib73001bbf72044f6803a7e36b426832c153c28d7
---
 gnu/local.mk                                  |  1 +
 gnu/packages/freedesktop.scm                  | 40 ++++++++++++-------
 .../patches/modem-manager-typelib.patch       | 12 ++++++
 3 files changed, 38 insertions(+), 15 deletions(-)
 create mode 100644 gnu/packages/patches/modem-manager-typelib.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 2959c2a835..e03dfc9078 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1799,6 +1799,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/mpc123-initialize-ao.patch		\
   %D%/packages/patches/mpg321-CVE-2019-14247.patch		\
   %D%/packages/patches/mpg321-gcc-10.patch			\
+  %D%/packages/patches/modem-manager-typelib.patch		\
   %D%/packages/patches/module-init-tools-moduledir.patch	\
   %D%/packages/patches/monero-use-system-miniupnpc.patch			\
   %D%/packages/patches/mosaicatcher-unbundle-htslib.patch	\
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index aa41d3c329..1c001e8800 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -2060,20 +2060,24 @@ (define-public libqmi
 (define-public modem-manager
   (package
     (name "modem-manager")
-    (version "1.18.12")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://www.freedesktop.org/software/ModemManager/"
-                    "ModemManager-" version ".tar.xz"))
-              (sha256
-               (base32
-                "0c74n5jl1qvq2qlbwzfkgxny8smjcgkid1nhdnl6qnlmbn9f8r5l"))))
-    (build-system gnu-build-system)
+    (version "1.22.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://gitlab.freedesktop.org/mobile-broadband/ModemManager")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0fj4ibjfsxal3xfk3hrj4l9vg7zbj42k9lj7151illl2n3d5ngzw"))
+       (patches (search-patches "modem-manager-typelib.patch"))))
+    (build-system meson-build-system)
     (arguments
-     (list
-      #:configure-flags
-      #~(list (string-append "--with-udev-base-dir=" #$output "/lib/udev"))))
+     (list #:configure-flags
+           #~(list (string-append "-Dudevdir=" #$output "/lib/udev/rules.d")
+                   "-Dsystemdsystemunitdir=no"
+                   "-Dvapi=true")))
     (native-inputs
      (list dbus
            gettext-minimal
@@ -2083,11 +2087,17 @@ (define-public modem-manager
            python
            python-dbus
            python-pygobject
-           vala))
+           vala
+           libxslt))                    ;for xsltproc
     (propagated-inputs
      (list glib))                       ;required by mm-glib.pc
     (inputs
-     (list libgudev libmbim libqmi polkit))
+     (list bash-completion
+           elogind
+           libgudev
+           libmbim
+           libqmi
+           polkit))
     (synopsis "Mobile broadband modems manager")
     (home-page "https://www.freedesktop.org/wiki/Software/ModemManager/")
     (description
diff --git a/gnu/packages/patches/modem-manager-typelib.patch b/gnu/packages/patches/modem-manager-typelib.patch
new file mode 100644
index 0000000000..848b653d77
--- /dev/null
+++ b/gnu/packages/patches/modem-manager-typelib.patch
@@ -0,0 +1,12 @@
+Upstream-status: https://gitlab.com/linux-mobile-broadband/ModemManager/-/merge_requests/1
+
+diff --git a/tools/tests/test-wrapper.sh.in b/tools/tests/test-wrapper.sh.in
+index fb8cd5e8d..f1a8ae38c 100755
+--- a/tools/tests/test-wrapper.sh.in
++++ b/tools/tests/test-wrapper.sh.in
+@@ -2,4 +2,4 @@
+ 
+ # For debugging behavior of test-modemmanager-service.py, you can modify
+ # this line to add --log-file option
+-LD_LIBRARY_PATH=@abs_top_builddir@/libmm-glib GI_TYPELIB_PATH=@abs_top_builddir@/libmm-glib @abs_top_srcdir@/tools/test-modemmanager-service.py
++LD_LIBRARY_PATH=@abs_top_builddir@/libmm-glib GI_TYPELIB_PATH=@abs_top_builddir@/libmm-glib:$GI_TYPELIB_PATH @abs_top_srcdir@/tools/test-modemmanager-service.py
-- 
2.46.0