mini-calc: 3.3.3 -> 3.3.5 (#372274)
[NixPkgs.git] / pkgs / by-name / li / libqmi / package.nix
blob1bd3a50715efeea349bcd24d35d4ce5757d75397
2   lib,
3   stdenv,
4   fetchFromGitLab,
5   meson,
6   ninja,
7   pkg-config,
8   gobject-introspection,
9   gtk-doc,
10   docbook-xsl-nons,
11   docbook_xml_dtd_43,
12   help2man,
13   glib,
14   python3,
15   mesonEmulatorHook,
16   libgudev,
17   bash-completion,
18   libmbim,
19   libqrtr-glib,
20   buildPackages,
21   withIntrospection ?
22     lib.meta.availableOn stdenv.hostPlatform gobject-introspection
23     && stdenv.hostPlatform.emulatorAvailable buildPackages,
24   withMan ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
27 stdenv.mkDerivation rec {
28   pname = "libqmi";
29   version = "1.34.0";
31   outputs = [
32     "out"
33     "dev"
34   ] ++ lib.optional withIntrospection "devdoc";
36   src = fetchFromGitLab {
37     domain = "gitlab.freedesktop.org";
38     owner = "mobile-broadband";
39     repo = "libqmi";
40     rev = version;
41     hash = "sha256-l9ev9ZOWicVNZ/Wj//KNd3NHcefIrLVriqJhEpwWvtQ=";
42   };
44   nativeBuildInputs =
45     [
46       meson
47       ninja
48       pkg-config
49       python3
50     ]
51     ++ lib.optionals withMan [
52       help2man
53     ]
54     ++ lib.optionals withIntrospection [
55       gobject-introspection
56       gtk-doc
57       docbook-xsl-nons
58       docbook_xml_dtd_43
59     ]
60     ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
61       mesonEmulatorHook
62     ];
64   buildInputs =
65     [
66       bash-completion
67       libmbim
68     ]
69     ++ lib.optionals withIntrospection [
70       libgudev
71     ];
73   propagatedBuildInputs =
74     [
75       glib
76     ]
77     ++ lib.optionals withIntrospection [
78       libqrtr-glib
79     ];
81   mesonFlags = [
82     "-Dudevdir=${placeholder "out"}/lib/udev"
83     (lib.mesonBool "gtk_doc" withIntrospection)
84     (lib.mesonBool "introspection" withIntrospection)
85     (lib.mesonBool "man" withMan)
86     (lib.mesonBool "qrtr" withIntrospection)
87     (lib.mesonBool "udev" withIntrospection)
88   ];
90   doCheck = true;
92   postPatch = ''
93     patchShebangs \
94       build-aux/qmi-codegen/qmi-codegen
95   '';
97   meta = with lib; {
98     homepage = "https://www.freedesktop.org/wiki/Software/libqmi/";
99     description = "Modem protocol helper library";
100     maintainers = teams.freedesktop.members;
101     platforms = platforms.linux;
102     license = with licenses; [
103       # Library
104       lgpl2Plus
105       # Tools
106       gpl2Plus
107     ];
108     changelog = "https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/blob/${version}/NEWS";
109   };