Skip to content

Commit 9956d5f

Browse files
committed
ModemManager: Add port
1 parent e8ee652 commit 9956d5f

File tree

2 files changed

+147
-0
lines changed

2 files changed

+147
-0
lines changed

bootstrap.d/net-misc.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,115 @@ packages:
105105
- args: ['cp', '@THIS_BUILD_DIR@/services', '@THIS_COLLECT_DIR@/etc/']
106106
- args: ['cp', '@THIS_BUILD_DIR@/protocols', '@THIS_COLLECT_DIR@/etc/']
107107

108+
- name: modemmanager
109+
architecture: '@OPTION:arch@'
110+
metadata:
111+
summary: Modem and mobile broadband management libraries
112+
description: ModemManager provides a unified high level API for communicating with mobile broadband modems, regardless of the protocol used to communicate with the actual device.
113+
spdx: 'GPL-2.0-or-later'
114+
website: 'https://www.freedesktop.org/wiki/Software/ModemManager/'
115+
maintainer: "Dennis Bonke <[email protected]>"
116+
categories: ['net-misc']
117+
source:
118+
subdir: 'ports'
119+
git: 'https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git'
120+
tag: '1.22.0'
121+
version: '1.22.0'
122+
tools_required:
123+
- system-gcc
124+
- host-pkg-config
125+
- virtual: pkgconfig-for-target
126+
triple: "@OPTION:arch-triple@"
127+
- host-mlibc
128+
- host-gobject-introspection
129+
- host-python
130+
- host-glib
131+
- host-vala
132+
pkgs_required:
133+
- mlibc
134+
- glib
135+
- libgudev
136+
- libmbim
137+
- libqmi
138+
- gobject-introspection
139+
revision: 1
140+
configure:
141+
- args:
142+
- 'meson'
143+
- 'setup'
144+
- '--cross-file'
145+
- '@SOURCE_ROOT@/scripts/meson-@OPTION:[email protected]'
146+
- '--prefix=/usr'
147+
- '--buildtype=debugoptimized'
148+
- '-Dintrospection=true'
149+
- '-Dbash_completion=false'
150+
- '-Dudev=true'
151+
- '-Dqrtr=false'
152+
- '-Dman=false'
153+
- '-Dsystemd_journal=false'
154+
- '-Dpolkit=no'
155+
- '-Dvapi=true'
156+
- '-Dsystemd_suspend_resume=false'
157+
- '-Dsystemdsystemunitdir=no'
158+
- '@THIS_SOURCE_DIR@'
159+
environ:
160+
# Same as below
161+
RUN_WRAPPER_LD_LIBRARY_PATH: '@BUILD_ROOT@/tools/host-mlibc/lib:@SYSROOT_DIR@/usr/lib:@SYSROOT_DIR@/usr/lib64:@THIS_BUILD_DIR@/girepository'
162+
RUN_WRAPPER_INTERP: '@BUILD_ROOT@/tools/host-mlibc/lib/ld.so'
163+
# Wrapper to add our valadir
164+
VAPIGEN: 'cross-vapigen'
165+
# Wrapper to add our valadir
166+
VALAC: 'cross-valac'
167+
build:
168+
- args: ['ninja']
169+
environ:
170+
# Make python load host libraries instead of the ones in the rootfs
171+
LD_LIBRARY_PATH: '@BUILD_ROOT@/tools/host-glib/lib:@BUILD_ROOT@/tools/host-glib/lib/x86_64-linux-gnu:@BUILD_ROOT@/tools/host-gobject-introspection/lib/x86_64-linux-gnu'
172+
# Library path for our run-wrapper that allows it to load managarm libraries
173+
RUN_WRAPPER_LD_LIBRARY_PATH: '@BUILD_ROOT@/tools/host-mlibc/lib:@SYSROOT_DIR@/usr/lib:@SYSROOT_DIR@/usr/lib64:@THIS_BUILD_DIR@/girepository'
174+
# Similar to above, but using a nasty (but working) hack lets us use a Linux mlibc build to execute an
175+
# executable that was cross-compiled for managarm
176+
RUN_WRAPPER_INTERP: '@BUILD_ROOT@/tools/host-mlibc/lib/ld.so'
177+
# This is a custom environment variable which tells g-ir-scanner what to use instead of ldd
178+
# We point it at our native ldd-wrapper that's installed as part of host-gobject-introspection
179+
GI_LDD_WRAPPER: ldd-wrapper
180+
# This tells g-ir-scanner what program should be used for "cross-launching" the executables it builds
181+
GI_CROSS_LAUNCHER: run-wrapper
182+
# Path to the introspection data installed by other packages
183+
GI_GIR_PATH: '@SYSROOT_DIR@/usr/share/gir-1.0'
184+
VALADIR: '@SYSROOT_DIR@/usr/share/vala/vapi'
185+
# Wrapper to add our valadir
186+
VALAC: 'cross-valac'
187+
# Wrapper to add our valadir
188+
VAPIGEN: 'cross-vapigen'
189+
- args: ['ninja', 'install']
190+
environ:
191+
DESTDIR: '@THIS_COLLECT_DIR@'
192+
# Make python load host libraries instead of the ones in the rootfs
193+
LD_LIBRARY_PATH: '@BUILD_ROOT@/tools/host-glib/lib:@BUILD_ROOT@/tools/host-glib/lib/x86_64-linux-gnu:@BUILD_ROOT@/tools/host-gobject-introspection/lib/x86_64-linux-gnu'
194+
# Library path for our run-wrapper that allows it to load managarm libraries
195+
RUN_WRAPPER_LD_LIBRARY_PATH: '@BUILD_ROOT@/tools/host-mlibc/lib:@SYSROOT_DIR@/usr/lib:@SYSROOT_DIR@/usr/lib64:@THIS_BUILD_DIR@/girepository'
196+
# Similar to above, but using a nasty (but working) hack lets us use a Linux mlibc build to execute an
197+
# executable that was cross-compiled for managarm
198+
RUN_WRAPPER_INTERP: '@BUILD_ROOT@/tools/host-mlibc/lib/ld.so'
199+
# This is a custom environment variable which tells g-ir-scanner what to use instead of ldd
200+
# We point it at our native ldd-wrapper that's installed as part of host-gobject-introspection
201+
GI_LDD_WRAPPER: ldd-wrapper
202+
# This tells g-ir-scanner what program should be used for "cross-launching" the executables it builds
203+
GI_CROSS_LAUNCHER: run-wrapper
204+
# Path to the introspection data installed by other packages
205+
GI_GIR_PATH: '@SYSROOT_DIR@/usr/share/gir-1.0'
206+
VALADIR: '@SYSROOT_DIR@/usr/share/vala/vapi'
207+
# Wrapper to add our valadir
208+
VALAC: 'cross-valac'
209+
# Wrapper to add our valadir
210+
VAPIGEN: 'cross-vapigen'
211+
- args: ['touch', '@THIS_COLLECT_DIR@/etc/ModemManager/.keep']
212+
- args: ['touch', '@THIS_COLLECT_DIR@/etc/ModemManager/connection.d/.keep']
213+
- args: ['touch', '@THIS_COLLECT_DIR@/etc/ModemManager/fcc-unlock.d/.keep']
214+
- args: ['touch', '@THIS_COLLECT_DIR@/usr/lib/ModemManager/connection.d/.keep']
215+
- args: ['touch', '@THIS_COLLECT_DIR@/usr/lib/ModemManager/fcc-unlock.d/.keep']
216+
108217
- name: rsync
109218
architecture: '@OPTION:arch@'
110219
source:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From b11885c2054f62a5db2d6122802deded561fe6e4 Mon Sep 17 00:00:00 2001
2+
From: Dennis Bonke <[email protected]>
3+
Date: Tue, 18 Jun 2024 21:27:13 +0200
4+
Subject: [PATCH] Add Managarm support
5+
6+
Signed-off-by: Dennis Bonke <[email protected]>
7+
---
8+
libqcdm/src/com.c | 1 +
9+
src/mm-port-serial-qcdm.c | 1 +
10+
2 files changed, 2 insertions(+)
11+
12+
diff --git a/libqcdm/src/com.c b/libqcdm/src/com.c
13+
index d6283e0..3b63c82 100644
14+
--- a/libqcdm/src/com.c
15+
+++ b/libqcdm/src/com.c
16+
@@ -15,6 +15,7 @@
17+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
+#define _GNU_SOURCE
21+
#include <errno.h>
22+
#include <termios.h>
23+
#include <fcntl.h>
24+
diff --git a/src/mm-port-serial-qcdm.c b/src/mm-port-serial-qcdm.c
25+
index 08f2430..91262bf 100644
26+
--- a/src/mm-port-serial-qcdm.c
27+
+++ b/src/mm-port-serial-qcdm.c
28+
@@ -18,6 +18,7 @@
29+
#include <stdlib.h>
30+
#include <unistd.h>
31+
#include <string.h>
32+
+#include <endian.h>
33+
34+
#include <ModemManager.h>
35+
#include <mm-errors-types.h>
36+
--
37+
2.45.2
38+

0 commit comments

Comments
 (0)