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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. ---
  20. Misc/python-config.sh.in | 3 +--
  21. 1 file changed, 1 insertion(+), 2 deletions(-)
  22. diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in
  23. index f905a71..e06be0f 100644
  24. --- a/Misc/python-config.sh.in
  25. +++ b/Misc/python-config.sh.in
  26. @@ -29,7 +29,7 @@ prefix_real=$(installed_prefix "$0")
  27. # Use sed to fix paths from their built-to locations to their installed-to
  28. # locations.
  29. -prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#")
  30. +prefix=$prefix_build
  31. exec_prefix_build="@exec_prefix@"
  32. exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#")
  33. includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#")
  34. @@ -47,7 +46,7 @@ LINKFORSHARED="@LINKFORSHARED@"
  35. OPT="@OPT@"
  36. PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
  37. LDVERSION="@LDVERSION@"
  38. -LIBDEST=${prefix}/lib/python${VERSION}
  39. +LIBDEST=$( echo "${prefix}/lib/python${VERSION}" | sed "s#^$prefix_build#$prefix_real#")
  40. LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#")
  41. SO="@EXT_SUFFIX@"
  42. PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
  43. --
  44. 1.8.3.1