void-packages/srcpkgs/NetworkManager/patches/fix-cross-gir.patch

53 lines
2.4 KiB
Diff

Reason: Fix crossbuilding GIR
Upstream: No, not upstreamable since this is very specific to the Void setup
diff --git clients/common/meson.build clients/common/meson.build
index afa257b..50b53e7 100644
--- clients/common/meson.build
+++ clients/common/meson.build
@@ -35,7 +35,7 @@ if enable_introspection
settings_docs,
input: nm_property_docs,
output: settings_docs,
- command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), 'settings-docs.xsl'), '@INPUT@'],
+ command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), 'settings-docs.xsl'), join_paths(meson.current_source_dir(), '..', '..', '@INPUT@')],
)
test(
diff --git libnm/meson.build libnm/meson.build
index 51ca46d..f14d861 100644
--- libnm/meson.build
+++ libnm/meson.build
@@ -236,7 +236,13 @@ if enable_introspection
)
endif
- generate_setting_docs = join_paths(meson.current_source_dir(), 'generate-setting-docs.py')
+ if meson.is_cross_build()
+ qemu = '/usr/bin/qemu-@XBPS_TARGET_QEMU_MACHINE@-static'
+ qemu_python3_cmd = qemu + ' -L @XBPS_CROSS_BASE@ @XBPS_CROSS_BASE@/bin/python3'
+ generate_setting_docs = ['sh', '-c', qemu_python3_cmd, join_paths(meson.current_source_dir(), 'generate-setting-docs.py')]
+ else
+ generate_setting_docs = [python.path(), join_paths(meson.current_source_dir(), 'generate-setting-docs.py')]
+ endif
gi_typelib_path = run_command('printenv', 'GI_TYPELIB_PATH').stdout()
if gi_typelib_path != ''
@@ -261,7 +267,7 @@ if enable_introspection
name,
input: libnm_gir[0],
output: name,
- command: [generate_setting_docs_env, python.path(), generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT@', '--output', '@OUTPUT@'],
+ command: [generate_setting_docs_env, generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT@', '--output', '@OUTPUT@'],
depends: libnm_gir,
)
@@ -270,7 +276,7 @@ if enable_introspection
name,
input: [libnm_gir[0], nm_settings_docs_overrides],
output: name,
- command: [generate_setting_docs_env, python.path(), generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT0@', '--overrides', '@INPUT1@', '--output', '@OUTPUT@'],
+ command: [generate_setting_docs_env, generate_setting_docs, '--lib-path', meson.current_build_dir(), '--gir', '@INPUT0@', '--overrides', '@INPUT1@', '--output', '@OUTPUT@'],
depends: libnm_gir,
)
endif