0001-Fix-build-without-Python.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From 71f329d997d949d3c12d62d2f1473a1c99ee49b0 Mon Sep 17 00:00:00 2001
  2. From: Baruch Siach <baruch@tkos.co.il>
  3. Date: Sun, 27 Aug 2017 21:30:37 +0300
  4. Subject: [PATCH] Fix build without Python
  5. Don't define HAVE_PYTHON35 when PYTHON_LIBS is empty.
  6. Also, don't build Python dependent code when HAVE_PYTHON35 is not
  7. defined.
  8. This fixes build failures like:
  9. Makefile:1616: recipe for target 'python-pkg/dist/lirc-0.10.0.tar.gz' failed
  10. make[3]: *** [python-pkg/dist/lirc-0.10.0.tar.gz] Error 1
  11. python-pkg/lirc/_client.c:1:20: fatal error: Python.h: No such file or directory
  12. #include <Python.h>
  13. ^
  14. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  15. ---
  16. Upstream status: commit 74a2bcab6b
  17. Makefile.am | 2 ++
  18. configure.ac | 3 ++-
  19. 2 files changed, 4 insertions(+), 1 deletion(-)
  20. diff --git a/Makefile.am b/Makefile.am
  21. index 9f3dd14340cc..d8164fcd44cf 100644
  22. --- a/Makefile.am
  23. +++ b/Makefile.am
  24. @@ -104,6 +104,7 @@ dist_py_pkg_doc_DATA = python-pkg/doc/Doxyfile \
  25. libpython = $(libdir)/python$(PYTHON_VERSION)
  26. pydir = $(libpython)/site-packages/lirc
  27. +if HAVE_PYTHON35
  28. py_LTLIBRARIES = python-pkg/lib/_client.la
  29. python_pkg_lib__client_la_SOURCES = \
  30. python-pkg/lirc/_client.c
  31. @@ -116,6 +117,7 @@ python_pkg_lib__client_la_LDFLAGS = \
  32. $(PYTHON_LIBS)
  33. python_pkg_lib__client_la_LIBADD = \
  34. lib/liblirc_client.la
  35. +endif
  36. pylint: .phony
  37. $(MAKE) -C tools pylint
  38. diff --git a/configure.ac b/configure.ac
  39. index 4108688433f8..07d901deafdf 100644
  40. --- a/configure.ac
  41. +++ b/configure.ac
  42. @@ -50,7 +50,8 @@ test -z "$PYTHON_LIBS" && \
  43. test -n "$PYTHON_LIBS" || \
  44. AC_MSG_WARN([No python package found (missing devel package?)])
  45. python_version_nodots=$(echo $PYTHON_VERSION | tr -d '.')
  46. -AM_CONDITIONAL(HAVE_PYTHON35, [test $python_version_nodots -ge 35])
  47. +AM_CONDITIONAL(HAVE_PYTHON35, [test -n "$PYTHON_LIBS" && \
  48. + test $python_version_nodots -ge 35])
  49. CFLAGS="$CFLAGS $PYTHON_CFLAGS"
  50. --
  51. 2.14.1