0002-meson-build-add-an-option-to-not-build-man-pages.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From 792af73ea90e9689703ab526dd444fdb1c2f8e40 Mon Sep 17 00:00:00 2001
  2. From: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
  3. Date: Thu, 14 Oct 2021 12:25:46 +0200
  4. Subject: [PATCH] meson.build: add an option to not build man pages.
  5. When cross-compiling, the compiled binaries cannot be run on the build
  6. machine, unless one defines a helper (e.g. qemu) in the meson
  7. configuration, which is most of the time undesirable.
  8. If help2man is installed on the build machine, then the build would fail
  9. because of this, so add an option to disable generating the man pages.
  10. With later versions of meson, it will be possible to automatically
  11. detect this condition.
  12. [Retrieved (and backported) from:
  13. https://gitlab.freedesktop.org/mobile-broadband/libmbim/-/commit/792af73ea90e9689703ab526dd444fdb1c2f8e40]
  14. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  15. ---
  16. meson.build | 8 +++++++-
  17. meson_options.txt | 1 +
  18. 2 files changed, 8 insertions(+), 1 deletion(-)
  19. diff --git a/meson.build b/meson.build
  20. index 1c5ee2d..59f1727 100644
  21. --- a/meson.build
  22. +++ b/meson.build
  23. @@ -184,8 +184,8 @@ if enable_gtk_doc
  24. subdir('docs/reference/libmbim-glib')
  25. endif
  26. -help2man = find_program('help2man', required: false)
  27. -if help2man.found()
  28. +enable_man = get_option('man')
  29. +if enable_man
  30. subdir('docs/man')
  31. endif
  32. @@ -198,6 +203,7 @@ summary({
  33. output += ' Documentation: ' + enable_gtk_doc.to_string() + '\n'
  34. output += ' bash completion: ' + enable_bash_completion.to_string() + '\n'
  35. output += ' gobject introspection: ' + enable_gir.to_string() + '\n\n'
  36. +output += ' man pages: ' + enable_man.to_string() + '\n\n'
  37. output += ' System paths\n'
  38. output += ' prefix: ' + mbim_prefix + '\n'
  39. output += ' udev base directory: ' + mbim_username + '\n\n'
  40. diff --git a/meson_options.txt b/meson_options.txt
  41. index 1305957..bfa33ab 100644
  42. --- a/meson_options.txt
  43. +++ b/meson_options.txt
  44. @@ -7,5 +7,6 @@ option('udevdir', type: 'string', value: '', description: 'where udev base direc
  45. option('introspection', type: 'boolean', value: 'true', description: 'build introspection support')
  46. option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation')
  47. +option('man', type: 'boolean', value: 'true', description: 'build man pages using help2man')
  48. option('bash_completion', type: 'boolean', value: true, description: 'install bash completion files')
  49. --
  50. GitLab