View | Details | Raw Unified | Return to bug 197757 | Differences between
and this patch

Collapse All | Expand All

(-)lang/python27/Makefile (-1 / +1 lines)
Lines 2-8 Link Here
2
2
3
PORTNAME=	python27
3
PORTNAME=	python27
4
PORTVERSION=	2.7.9
4
PORTVERSION=	2.7.9
5
PORTREVISION=	1
5
PORTREVISION=	2
6
CATEGORIES=	lang python ipv6
6
CATEGORIES=	lang python ipv6
7
MASTER_SITES=	PYTHON
7
MASTER_SITES=	PYTHON
8
MASTER_SITE_SUBDIR=	ftp/python/${PORTVERSION}
8
MASTER_SITE_SUBDIR=	ftp/python/${PORTVERSION}
(-)lang/python27/files/patch-Misc_python-config.in (+29 lines)
Line 0 Link Here
1
# Description: add missing library directory to python-config --ldflags
2
# PR: 197757
3
# Upstream bug and patch obtained from: https://bugs.python.org/issue7352
4
5
--- Misc/python-config.in.orig	2014-12-10 15:59:51 UTC
6
+++ Misc/python-config.in
7
@@ -50,8 +50,21 @@ for opt in opt_flags:
8
         # add the prefix/lib/pythonX.Y/config dir, but only if there is no
9
         # shared library in prefix/lib/.
10
         if opt == '--ldflags':
11
+            # Provide the location where the Python library is installed.
12
+            # We always provide it, because Python may have been installed
13
+            # at a non-standard location.
14
             if not getvar('Py_ENABLE_SHARED'):
15
-                libs.insert(0, '-L' + getvar('LIBPL'))
16
+                # There is no shared library in prefix/lib.  The static
17
+                # library is in prefix/lib/pythonX.Y/config.
18
+                #
19
+                # Note that we cannot use getvar('LIBPL') like we used to,
20
+                # because it provides the location at build time, which might
21
+                # be different from the actual location at runtime.
22
+                libdir = sysconfig.get_python_lib(standard_lib=True) + '/config'
23
+            else:
24
+                # The Python shared library is installed in prefix/lib.
25
+                libdir = sysconfig.PREFIX + '/lib'
26
+            libs.insert(0, '-L' + libdir)
27
             if not getvar('PYTHONFRAMEWORK'):
28
                 libs.extend(getvar('LINKFORSHARED').split())
29
         print ' '.join(libs)

Return to bug 197757