0005-meson.build-use-dependency-function-for-readline.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 3ef45c41105e61efe84c9be3a9a22988dfe10db8 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Fri, 22 Oct 2021 07:33:04 +0200
  4. Subject: [PATCH] meson.build: use dependency function for readline
  5. Use meson dependency function to find readline instead of
  6. cc.find_library. This function will retrieve readline pkg-config file
  7. which is available since version 7 (released 5 years ago) and
  8. https://git.savannah.gnu.org/cgit/readline.git/commit/readline.pc.in?id=d49a9082c0e15bba8cd3d8cc0a994409cf823cac.
  9. readline.pc sets tinfo in Requires.Private which will avoid the
  10. following static build failure:
  11. /home/buildroot/autobuild/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/i586-buildroot-linux-musl/9.3.0/../../../../i586-buildroot-linux-musl/bin/ld: /home/buildroot/autobuild/instance-1/output-1/host/i586-buildroot-linux-musl/sysroot/usr/lib/libreadline.a(display.o): in function `_rl_move_cursor_relative':
  12. display.c:(.text+0xbb5): undefined reference to `tputs'
  13. Fixes:
  14. - http://autobuild.buildroot.org/results/77c10947ddc749c54c7c233e3143f5cdf1edc73d
  15. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  16. [Upstream status: https://github.com/RidgeRun/gstd-1.x/pull/261]
  17. ---
  18. meson.build | 6 ++----
  19. 1 file changed, 2 insertions(+), 4 deletions(-)
  20. diff --git a/meson.build b/meson.build
  21. index 7a8690a..44ed5c2 100644
  22. --- a/meson.build
  23. +++ b/meson.build
  24. @@ -32,8 +32,8 @@ systemd_required = get_option('enable-systemd').enabled()
  25. systemd_dep = dependency('systemd', required : systemd_required, version : '>=232')
  26. cc = meson.get_compiler('c')
  27. -readline = cc.find_library('readline', required: true)
  28. -if readline.found()
  29. +readline_dep = dependency('readline')
  30. +if readline_dep.found()
  31. add_project_arguments('-DHAVE_LIBREADLINE', language: 'c')
  32. add_project_arguments('-DHAVE_READLINE_HISTORY', language: 'c')
  33. # Add arguments to the compiler command line.
  34. @@ -48,8 +48,6 @@ if readline.found()
  35. else
  36. add_project_arguments('-DHAVE_HISTORY_H', language: 'c')
  37. endif
  38. -
  39. - readline_dep = readline
  40. endif
  41. ## Dependencies
  42. --
  43. 2.37.1