2
1

0029-python-config.sh-don-t-reassign-prefix.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From e3221e3b714374e1e53dc11c9556733bd2807c2c Mon Sep 17 00:00:00 2001
  2. From: Matt Weber <matthew.weber@rockwellcollins.com>
  3. Date: Fri, 6 Oct 2017 09:54:15 -0500
  4. Subject: [PATCH] python-config.sh: don't reassign ${prefix}
  5. When prefix is set to a path like /usr during crossbuild
  6. the sed operations end up executing twice, once for the prefix
  7. reassignment and another for includedir if it is set as a string
  8. including the ${prefix} variable. This results in an issue
  9. when the build directory is under /usr.
  10. This patch updates the remaining location which uses the prefix
  11. variable to also sed and update to use the real path.
  12. Upstream bug report:
  13. https://bugs.python.org/issue31713
  14. Buildroot bug:
  15. https://bugs.busybox.net/show_bug.cgi?id=10361
  16. Fixes failures like the following:
  17. dbus-python-1.2.4 | NOK | http://autobuild.buildroot.net/results/758858efa97b6273c1b470513f5492258a6d8853
  18. Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
  19. ---
  20. Misc/python-config.sh.in | 4 ++--
  21. 1 file changed, 2 insertions(+), 2 deletions(-)
  22. diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in
  23. index a1bc3cd5f7..164d2d3603 100644
  24. --- a/Misc/python-config.sh.in
  25. +++ b/Misc/python-config.sh.in
  26. @@ -31,7 +31,7 @@ prefix_real=$(installed_prefix "$0")
  27. # locations. Keep prefix & exec_prefix using their original values in case
  28. # they are referenced in other configure variables, to prevent double
  29. # substitution, issue #22140.
  30. -prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#")
  31. +prefix=$prefix_build
  32. exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#")
  33. exec_prefix_real=${prefix_real}
  34. includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#")
  35. @@ -49,7 +49,7 @@ LDLIBRARY="@LDLIBRARY@"
  36. OPT="@OPT@"
  37. PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
  38. LDVERSION="@LDVERSION@"
  39. -LIBDEST=${prefix_real}/lib/python${VERSION}
  40. +LIBDEST=$( echo "${prefix}/lib/python${VERSION}" | sed "s#^$prefix_build#$prefix_real#")
  41. LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#")
  42. SO="@EXT_SUFFIX@"
  43. PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
  44. --
  45. 2.20.1