0001-add-configure-flag-to-disable-tests.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From baeb5aa827d956bd06492775dc5bd9f89d394149 Mon Sep 17 00:00:00 2001
  2. From: Mike Frysinger <vapier@gentoo.org>
  3. Date: Mon, 13 Jul 2015 23:38:41 -0400
  4. Subject: [PATCH] add configure flag to disable tests
  5. The tests require the check package to be installed. There is a configure
  6. test for this package (which is good), but it's unconditional (which is
  7. bad) as it means you can't even build & install kbd w/out the check
  8. package being installed.
  9. URL: https://bugs.gentoo.org/485116
  10. Reported-by: Arfrever Frehtes Taifersar Arahesis <arfrever.fta@gmail.com>
  11. ---
  12. Makefile.am | 5 ++++-
  13. configure.ac | 17 +++++++++++++++--
  14. 2 files changed, 19 insertions(+), 3 deletions(-)
  15. diff --git a/Makefile.am b/Makefile.am
  16. index 89c7e83..f855110 100644
  17. --- a/Makefile.am
  18. +++ b/Makefile.am
  19. @@ -8,7 +8,10 @@ EXTRA_DIST = \
  20. CREDITS \
  21. contrib docs rc
  22. -SUBDIRS = src data po tests docs
  23. +SUBDIRS = src data po docs
  24. +if BUILD_TESTS
  25. +SUBDIRS += tests
  26. +endif
  27. kbd-$(VERSION).tar.xz:
  28. make distcheck
  29. diff --git a/configure.ac b/configure.ac
  30. index d0b462b..f659758 100644
  31. --- a/configure.ac
  32. +++ b/configure.ac
  33. @@ -10,8 +10,21 @@ AC_CONFIG_MACRO_DIR([m4])
  34. AM_INIT_AUTOMAKE([1.9 -Wall color-tests dist-xz])
  35. AC_CONFIG_SRCDIR([src/loadkeys.c])
  36. AC_CONFIG_HEADERS(config.h)
  37. -
  38. -PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])
  39. +PKG_PROG_PKG_CONFIG
  40. +
  41. +AC_ARG_ENABLE(tests,
  42. + [AS_HELP_STRING([--disable-tests], [do not build tests])],
  43. + [build_tests=$enableval], [build_tests=auto])
  44. +if test "$build_tests" != "no"; then
  45. + PKG_CHECK_MODULES([CHECK], [check >= 0.9.4],
  46. + [build_tests="yes"], [
  47. + if test "$build_tests" = "yes"; then
  48. + AC_MSG_ERROR([tests requested, but check package is missing])
  49. + fi
  50. + build_tests="no"
  51. + ])
  52. +fi
  53. +AM_CONDITIONAL(BUILD_TESTS, test "$build_tests" != "no")
  54. m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
  55. AM_SILENT_RULES([yes])
  56. --
  57. 2.6.4