1{ lib
2, stdenv
3, fetchFromGitLab
4, meson
5, ninja
6, pkg-config
7, glib
8, python3
9, help2man
10, bash-completion
11, bash
12, buildPackages
13, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
14, withDocs ? stdenv.hostPlatform == stdenv.buildPlatform
15, gobject-introspection
16}:
17
18stdenv.mkDerivation rec {
19 pname = "libmbim";
20 version = "1.30.0";
21
22 outputs = [ "out" "dev" ]
23 ++ lib.optionals withDocs [ "man" ];
24
25 src = fetchFromGitLab {
26 domain = "gitlab.freedesktop.org";
27 owner = "mobile-broadband";
28 repo = "libmbim";
29 rev = version;
30 hash = "sha256-sHTpu9WeMZroT+1I18ObEHWSzcyj/Relyz8UNe+WawI=";
31 };
32
33 mesonFlags = [
34 "-Dudevdir=${placeholder "out"}/lib/udev"
35 (lib.mesonBool "introspection" withIntrospection)
36 (lib.mesonBool "man" withDocs)
37 ];
38
39 strictDeps = true;
40
41 nativeBuildInputs = [
42 meson
43 ninja
44 pkg-config
45 python3
46 ] ++ lib.optionals withDocs [
47 help2man
48 ] ++ lib.optionals withIntrospection [
49 gobject-introspection
50 ];
51
52 buildInputs = [
53 glib
54 bash-completion
55 bash
56 ];
57
58 doCheck = true;
59
60 postPatch = ''
61 patchShebangs \
62 build-aux/mbim-codegen/mbim-codegen
63 '';
64
65 meta = with lib; {
66 homepage = "https://www.freedesktop.org/wiki/Software/libmbim/";
67 description = "Library for talking to WWAN modems and devices which speak the Mobile Interface Broadband Model (MBIM) protocol";
68 changelog = "https://gitlab.freedesktop.org/mobile-broadband/libmbim/-/raw/${version}/NEWS";
69 maintainers = teams.freedesktop.members;
70 platforms = platforms.linux;
71 license = licenses.gpl2Plus;
72 };
73}