void-packages/srcpkgs/NetworkManager/patches/fix-cross-gir.patch
2020-01-13 02:32:39 +01:00

59 lines
2.6 KiB
Diff

Reason: Fix crossbuilding GIR
Upstream: No, not upstreamable since this is very specific to the Void setup
--- clients/common/meson.build
+++ clients/common/meson.build
@@ -34,7 +34,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(
--- libnm/meson.build.orig Mon Jan 13 02:12:09 2020
+++ libnm/meson.build Mon Jan 13 02:17:17 2020
@@ -236,7 +236,24 @@
)
endif
- generate_setting_docs = join_paths(meson.current_source_dir(), 'generate-setting-docs.py')
+ if meson.is_cross_build()
+ arch = host_machine.cpu_family()
+ endian = host_machine.endian()
+ if arch == 'x86'
+ qemu_arch = 'i386'
+ elif arch == 'x86_64'
+ qemu_arch = 'x86_64'
+ elif arch == 'ppc64' and endian == 'little'
+ qemu_arch = 'ppc64le'
+ else
+ qemu_arch = host_machine.cpu_family()
+ endif
+ qemu = '/usr/bin/qemu-' + qemu_arch + '-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 +278,7 @@
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 +287,7 @@
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