# Forked from Alpine to apply quick suspend/resume patches for the PinePhone EG25-G modem pkgname=modemmanager pkgver=9999_git20210528 _pkgver=1.16.6 pkgrel=0 pkgdesc="ModemManager library" url="http://www.freedesktop.org/wiki/Software/ModemManager" arch="all !mips !mips64 !s390x" # polkit license="GPL-2.0-or-later AND LGPL-2.1-or-later" depends_dev="libmm-glib" makedepends="$depends_dev gobject-introspection-dev gtk-doc vala libgudev-dev polkit-dev libmbim-dev libqmi-dev linux-headers libqrtr-glib-dev gettext-dev glib-dev" makedepends="$makedepends automake autoconf autoconf-archive libtool" checkdepends="glib-dev" options="!check" # https://bugs.freedesktop.org/show_bug.cgi?id=101197 subpackages=" $pkgname-lang $pkgname-doc libmm-glib:libmm $pkgname-dev $pkgname-openrc $pkgname-bash-completion " # https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/511/commits # patches are integrated in these patches already source="https://www.freedesktop.org/software/ModemManager/ModemManager-$_pkgver.tar.xz 0001-base-manager-add-quick-suspend-resume-base.patch 0002-base-manager-make-sure-g_autoptr-variables-are-initi.patch 0003-base-manager-don-t-assume-a-MMDevice-always-holds-a-.patch 0004-base-manager-avoid-using-the-mm_-prefix-for-static-p.patch 0005-base-modem-fix-modem_sync-operation-handling.patch 0006-base-modem-don-t-fail-if-sync-isn-t-implemented.patch 0007-base-modem-make-sync-available-only-if-suspend-resum.patch 0008-broadband-modem-ignore-cancellation-during-sync.patch 0009-broadband-modem-skip-synchronization-after-resume-if.patch 0010-iface-modem-time-synchronize-state-when-resuming.patch 0011-broadband-modem-skip-time-interface-sync-if-no-time-.patch 0012-iface-modem-time-ignore-cancellation-during-sync.patch 0013-iface-modem-3gpp-synchronize-state-when-resuming.patch 0014-iface-modem-3gpp-use-g_autoptr-for-the-MMBearerPrope.patch 0015-iface-modem-3gpp-fix-double-GError-free-on-registrat.patch 0016-iface-modem-3gpp-remove-redundant-log-message.patch 0017-iface-modem-3gpp-ignore-cancellation-during-sync.patch 0018-broadband-modem-fix-type-in-the-ready-for-iface_mode.patch 0019-broadband-modem-skip-3GPP-interface-sync-if-no-3GPP-.patch 0020-iface-modem-synchronize-state-when-resuming.patch 0021-broadband-modem-fail-synchronization-if-no-modem-exp.patch 0022-broadband-modem-fix-state-machine-logic-when-synchro.patch 0023-broadband-modem-abort-sync-if-locked-SIM-card-found.patch 0024-iface-modem-remove-the-signal-quality-enforced-refre.patch 0025-iface-modem-ignore-cancellation-during-sync.patch 0026-base-bearer-synchronize-state-when-resuming.patch 0027-base-bearer-improve-comments-of-the-load-reload_conn.patch 0028-base-bearer-fix-connection-reload-completion.patch 0029-base-bearer-propagate-the-new-connection-status-afte.patch 0030-iface-modem-bearer-list-sync-all-bearers-one-after-t.patch 0031-base-bearer-ignore-cancellation-during-sync.patch 0032-broadband-bearer-reuse-the-same-method-for-load-and-.patch 0033-novatel-lte-reuse-the-same-method-for-load-and-reloa.patch 0034-sierra-reuse-the-same-method-for-load-and-reload.patch 0035-cinterion-reuse-the-same-method-for-load-and-reload.patch 0036-plugins-ignore-reload_connection_status-where-not-su.patch 0037-bearer-qmi-implement-reload_connection_status-for-th.patch 0038-bearer-mbim-implement-reload_connection_status.patch 0039-ModemManager-backport-Quick-Suspend-Resume-patches-t.patch $pkgname.rules $pkgname.initd" builddir="$srcdir"/ModemManager-$_pkgver build() { ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --localstatedir=/var \ --with-polkit=permissive \ --enable-plugin-qcom-soc \ --enable-gtk-doc \ --disable-static \ --enable-vala=yes \ --with-systemd-suspend-resume=yes make } libmm() { cd "$builddir" mkdir -p "$subpkgdir" make DESTDIR="$subpkgdir" -C libmm-glib install # move dev files to modemmnager-dev mv -f "$subpkgdir/usr/include/libmm-glib" "$pkgdir/usr/include/" mv -f "$subpkgdir/usr/share/gir-1.0" "$pkgdir/usr/share/" rmdir "$subpkgdir/usr/include" "$subpkgdir/usr/share" } package() { make DESTDIR="$pkgdir" install make DESTDIR="$pkgdir" -C libmm-glib uninstall rmdir "$pkgdir"/usr/lib/girepository-1.0 # in libmm-glib rm -rf "$pkgdir"/usr/share/dbus-1/system-services #systemd-service mkdir -p "$pkgdir/usr/share/polkit-1/rules.d" install -m644 -D "$srcdir/$pkgname.rules" \ "$pkgdir/usr/share/polkit-1/rules.d/01-org.freedesktop.ModemManager.rules" install -m755 -D "$srcdir/$pkgname.initd" \ "$pkgdir/etc/init.d/$pkgname" # post-install message mkdir -p "$pkgdir/usr/share/doc/$pkgname" cat > $pkgdir/usr/share/doc/$pkgname/README.alpine <