xref: /OK3568_Linux_fs/buildroot/package/python3/0027-python-config.sh-don-t-reassign-prefix.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunFrom 106d9378c61e7fa9cad0a63ba068668d54cd11b8 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Matt Weber <matthew.weber@rockwellcollins.com>
3*4882a593SmuzhiyunDate: Fri, 6 Oct 2017 09:54:15 -0500
4*4882a593SmuzhiyunSubject: [PATCH] python-config.sh: don't reassign ${prefix}
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunWhen prefix is set to a path like /usr during crossbuild
7*4882a593Smuzhiyunthe sed operations end up executing twice, once for the prefix
8*4882a593Smuzhiyunreassignment and another for includedir if it is set as a string
9*4882a593Smuzhiyunincluding the ${prefix} variable.  This results in an issue
10*4882a593Smuzhiyunwhen the build directory is under /usr.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunThis patch updates the remaining location which uses the prefix
13*4882a593Smuzhiyunvariable to also sed and update to use the real path.
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunUpstream bug report:
16*4882a593Smuzhiyunhttps://bugs.python.org/issue31713
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunBuildroot bug:
19*4882a593Smuzhiyunhttps://bugs.busybox.net/show_bug.cgi?id=10361
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunFixes failures like the following:
22*4882a593Smuzhiyundbus-python-1.2.4 | NOK | http://autobuild.buildroot.net/results/758858efa97b6273c1b470513f5492258a6d8853
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunSigned-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
25*4882a593Smuzhiyun---
26*4882a593Smuzhiyun Misc/python-config.sh.in | 4 ++--
27*4882a593Smuzhiyun 1 file changed, 2 insertions(+), 2 deletions(-)
28*4882a593Smuzhiyun
29*4882a593Smuzhiyundiff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in
30*4882a593Smuzhiyunindex a1bc3cd..164d2d3 100644
31*4882a593Smuzhiyun--- a/Misc/python-config.sh.in
32*4882a593Smuzhiyun+++ b/Misc/python-config.sh.in
33*4882a593Smuzhiyun@@ -31,7 +31,7 @@ prefix_real=$(installed_prefix "$0")
34*4882a593Smuzhiyun # locations. Keep prefix & exec_prefix using their original values in case
35*4882a593Smuzhiyun # they are referenced in other configure variables, to prevent double
36*4882a593Smuzhiyun # substitution, issue #22140.
37*4882a593Smuzhiyun-prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#")
38*4882a593Smuzhiyun+prefix=$prefix_build
39*4882a593Smuzhiyun exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#")
40*4882a593Smuzhiyun exec_prefix_real=${prefix_real}
41*4882a593Smuzhiyun includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#")
42*4882a593Smuzhiyun@@ -49,7 +49,7 @@ LDLIBRARY="@LDLIBRARY@"
43*4882a593Smuzhiyun OPT="@OPT@"
44*4882a593Smuzhiyun PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
45*4882a593Smuzhiyun LDVERSION="@LDVERSION@"
46*4882a593Smuzhiyun-LIBDEST=${prefix_real}/lib/python${VERSION}
47*4882a593Smuzhiyun+LIBDEST=$( echo "${prefix}/lib/python${VERSION}" | sed "s#^$prefix_build#$prefix_real#")
48*4882a593Smuzhiyun LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#")
49*4882a593Smuzhiyun SO="@EXT_SUFFIX@"
50*4882a593Smuzhiyun PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
51*4882a593Smuzhiyun--
52*4882a593Smuzhiyun2.30.2
53*4882a593Smuzhiyun
54