libqmi: widen cross support using emulation
With emulation, we can now do gobject-introspection for a wide range of cross targets (but not all), so we can enable the corresponding options in those cases. The man pages still can't be cross-compiled, because they use help2man and Meson doesn't know how to inject the emulator[1]. [1]: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/75
This commit is contained in:
parent
325e7839c8
commit
fda9058aff
|
@ -12,10 +12,14 @@
|
||||||
, help2man
|
, help2man
|
||||||
, glib
|
, glib
|
||||||
, python3
|
, python3
|
||||||
|
, mesonEmulatorHook
|
||||||
, libgudev
|
, libgudev
|
||||||
, bash-completion
|
, bash-completion
|
||||||
, libmbim
|
, libmbim
|
||||||
, libqrtr-glib
|
, libqrtr-glib
|
||||||
|
, buildPackages
|
||||||
|
, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages
|
||||||
|
, withMan ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
|
@ -23,7 +27,7 @@ stdenv.mkDerivation rec {
|
||||||
version = "1.32.2";
|
version = "1.32.2";
|
||||||
|
|
||||||
outputs = [ "out" "dev" ]
|
outputs = [ "out" "dev" ]
|
||||||
++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ];
|
++ lib.optional withIntrospection "devdoc";
|
||||||
|
|
||||||
src = fetchFromGitLab {
|
src = fetchFromGitLab {
|
||||||
domain = "gitlab.freedesktop.org";
|
domain = "gitlab.freedesktop.org";
|
||||||
|
@ -46,31 +50,38 @@ stdenv.mkDerivation rec {
|
||||||
meson
|
meson
|
||||||
ninja
|
ninja
|
||||||
pkg-config
|
pkg-config
|
||||||
gobject-introspection
|
|
||||||
python3
|
python3
|
||||||
] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
|
] ++ lib.optionals withMan [
|
||||||
|
help2man
|
||||||
|
] ++ lib.optionals withIntrospection [
|
||||||
|
gobject-introspection
|
||||||
gtk-doc
|
gtk-doc
|
||||||
docbook-xsl-nons
|
docbook-xsl-nons
|
||||||
docbook_xml_dtd_43
|
docbook_xml_dtd_43
|
||||||
help2man
|
] ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||||
|
mesonEmulatorHook
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
libgudev
|
|
||||||
bash-completion
|
bash-completion
|
||||||
libmbim
|
libmbim
|
||||||
|
] ++ lib.optionals withIntrospection [
|
||||||
|
libgudev
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
glib
|
glib
|
||||||
|
] ++ lib.optionals withIntrospection [
|
||||||
libqrtr-glib
|
libqrtr-glib
|
||||||
];
|
];
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
"-Dudevdir=${placeholder "out"}/lib/udev"
|
"-Dudevdir=${placeholder "out"}/lib/udev"
|
||||||
(lib.mesonBool "gtk_doc" (stdenv.buildPlatform == stdenv.hostPlatform))
|
(lib.mesonBool "gtk_doc" withIntrospection)
|
||||||
(lib.mesonBool "introspection" (stdenv.buildPlatform == stdenv.hostPlatform))
|
(lib.mesonBool "introspection" withIntrospection)
|
||||||
(lib.mesonBool "man" (stdenv.buildPlatform == stdenv.hostPlatform))
|
(lib.mesonBool "man" withMan)
|
||||||
|
(lib.mesonBool "qrtr" withIntrospection)
|
||||||
|
(lib.mesonBool "udev" withIntrospection)
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
Loading…
Reference in a new issue