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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From 21f787cb9bf0c1440981262f03bc881c5b77c0d8 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. [aduskett@gmail.com: Update for python 3.6.4]
  20. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  21. ---
  22. Misc/python-config.sh.in | 4 ++--
  23. 1 file changed, 2 insertions(+), 2 deletions(-)
  24. diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in
  25. index 9e259c0..8b249d9 100644
  26. --- a/Misc/python-config.sh.in
  27. +++ b/Misc/python-config.sh.in
  28. @@ -31,7 +31,7 @@ prefix_real=$(installed_prefix "$0")
  29. # locations. Keep prefix & exec_prefix using their original values in case
  30. # they are referenced in other configure variables, to prevent double
  31. # substitution, issue #22140.
  32. -prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#")
  33. +prefix=$prefix_build
  34. exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#")
  35. exec_prefix_real=${prefix_real}
  36. includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#")
  37. @@ -49,7 +49,7 @@ LINKFORSHARED="@LINKFORSHARED@"
  38. OPT="@OPT@"
  39. PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
  40. LDVERSION="@LDVERSION@"
  41. -LIBDEST=${prefix_real}/lib/python${VERSION}
  42. +LIBDEST=$( echo "${prefix}/lib/python${VERSION}" | sed "s#^$prefix_build#$prefix_real#")
  43. LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#")
  44. SO="@EXT_SUFFIX@"
  45. PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
  46. --
  47. 2.14.3