0003-python-pkg-Fix-lirc-version-detection-when-cross-com.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. From 732fd31610a6790a927ea9ed6d660796a1641254 Mon Sep 17 00:00:00 2001
  2. From: Baruch Siach <baruch@tkos.co.il>
  3. Date: Thu, 7 Sep 2017 08:12:01 +0200
  4. Subject: [PATCH] build: Fix lirc version detection when cross compiling.
  5. The setup.py script that runs on the host can't use the client library
  6. built for target. So setup.py falls back to a wrong hard-coded VERSION
  7. value.
  8. Instead of importing the target library, use exec() to read
  9. lirc/config.py directly for its VERSION value.
  10. Fixes build failure:
  11. /usr/bin/install -c -m 644 ./python-pkg/dist/lirc-0.10.0.tar.gz \
  12. '.../output/host/arm-buildroot-linux-musleabihf/sysroot/usr/share/lirc'
  13. /usr/bin/install: cannot stat './python-pkg/dist/lirc-0.10.0.tar.gz': \
  14. No such file or directory
  15. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  16. ---
  17. Upstream status: commit 732fd31610a6
  18. python-pkg/setup.py | 9 +++------
  19. 1 file changed, 3 insertions(+), 6 deletions(-)
  20. diff --git a/python-pkg/setup.py b/python-pkg/setup.py
  21. index e9b33690f828..a2d92e0432aa 100644
  22. --- a/python-pkg/setup.py
  23. +++ b/python-pkg/setup.py
  24. @@ -6,14 +6,11 @@ import subprocess
  25. import os.path
  26. import os
  27. -try:
  28. - import lirc.config
  29. - VERSION = lirc.config.VERSION.replace('-devel','')
  30. -except ImportError:
  31. - VERSION='0.0.0'
  32. -
  33. from setuptools import setup, Extension
  34. +exec(open("lirc/config.py").read())
  35. +VERSION = VERSION.replace('-devel','')
  36. +
  37. if 'CFLAGS' in os.environ:
  38. cflags = os.environ['CFLAGS'].split()
  39. if 'LDFLAGS' in os.environ:
  40. --
  41. 2.14.1