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.
6 The setup.py script that runs on the host can't use the client library
7 built for target. So setup.py falls back to a wrong hard-coded VERSION
10 Instead of importing the target library, use exec() to read
11 lirc/config.py directly for its VERSION value.
15 /usr/bin/install -c -m 644 ./python-pkg/dist/lirc-0.10.0.tar.gz \
16 '.../output/host/arm-buildroot-linux-musleabihf/sysroot/usr/share/lirc'
17 /usr/bin/install: cannot stat './python-pkg/dist/lirc-0.10.0.tar.gz': \
18 No such file or directory
20 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
22 Upstream status: commit 732fd31610a6
24 python-pkg/setup.py | 9 +++------
25 1 file changed, 3 insertions(+), 6 deletions(-)
27 diff --git a/python-pkg/setup.py b/python-pkg/setup.py
28 index e9b33690f828..a2d92e0432aa 100644
29 --- a/python-pkg/setup.py
30 +++ b/python-pkg/setup.py
31 @@ -6,14 +6,11 @@ import subprocess
37 - VERSION = lirc.config.VERSION.replace('-devel','')
41 from setuptools import setup, Extension
43 +exec(open("lirc/config.py").read())
44 +VERSION = VERSION.replace('-devel','')
46 if 'CFLAGS' in os.environ:
47 cflags = os.environ['CFLAGS'].split()
48 if 'LDFLAGS' in os.environ: