]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/lirc-tools/0003-python-pkg-Fix-lirc-version-detection-when-cross-com.patch
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / package / lirc-tools / 0003-python-pkg-Fix-lirc-version-detection-when-cross-com.patch
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
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
8 value.
9
10 Instead of importing the target library, use exec() to read
11 lirc/config.py directly for its VERSION value.
12
13 Fixes build failure:
14
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
19
20 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
21 ---
22 Upstream status: commit 732fd31610a6
23
24  python-pkg/setup.py | 9 +++------
25  1 file changed, 3 insertions(+), 6 deletions(-)
26
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
32  import os.path
33  import os
34  
35 -try:
36 -    import lirc.config
37 -    VERSION = lirc.config.VERSION.replace('-devel','')
38 -except ImportError:
39 -    VERSION='0.0.0'
40 -
41  from setuptools import setup, Extension
42  
43 +exec(open("lirc/config.py").read())
44 +VERSION = VERSION.replace('-devel','')
45 +
46  if 'CFLAGS' in os.environ:
47      cflags = os.environ['CFLAGS'].split()
48      if 'LDFLAGS' in os.environ:
49 -- 
50 2.14.1
51