1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-27 10:03:20 +00:00
freebsd-ports/lang/python37/files/patch-Misc__python-config.sh.in
Tobias Kortkamp dcbb4afe98 lang/python3?: Fix python3.?-config behavior when symlinked
When python3.?-config is symlinked to another location it starts
outputting bogus paths.  For example

$ pwd
/home/tobias
$ python3.6-config --includes
-I/usr/local/include/python3.6m -I/usr/local/include/python3.6m
$ ln -s /usr/local/bin/python3.6-config python3-config
$ ./python3-config --includes
-I/home/include/python3.6m -I/home/include/python3.6m

This breaks ports trying to use BINARY_ALIAS together with
python3.?-config.  Apply a patch to resolve the symlink first before
trying to find the install prefix.

PR:		229749
Submitted by:	tobik
Reviewed by:	antoine, miwi
Approved by:	python (miwi)
2018-07-26 08:58:50 +00:00

12 lines
464 B
Bash

--- Misc/python-config.sh.in.orig 2018-07-13 21:07:16 UTC
+++ Misc/python-config.sh.in
@@ -15,7 +15,7 @@ fi
# Returns the actual prefix where this script was installed to.
installed_prefix ()
{
- RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
+ RESULT=$(dirname $(cd $(dirname $(realpath "$1")) && pwd -P))
if which readlink >/dev/null 2>&1 ; then
if readlink -f "$RESULT" >/dev/null 2>&1; then
RESULT=$(readlink -f "$RESULT")