aboutsummaryrefslogtreecommitdiff
path: root/lang/python27
diff options
context:
space:
mode:
authorKubilay Kocak <koobs@FreeBSD.org>2018-03-01 13:47:10 +0000
committerKubilay Kocak <koobs@FreeBSD.org>2018-03-01 13:47:10 +0000
commit461fb52bc750d6ce44500c8e6d5117a52fed26ca (patch)
tree7901d36333c6341cc94229075004e09098b7499f /lang/python27
parentf6504d09fca06fef42e35924a9a9be15f710b1e3 (diff)
downloadports-461fb52bc750d6ce44500c8e6d5117a52fed26ca.tar.gz
ports-461fb52bc750d6ce44500c8e6d5117a52fed26ca.zip
lang/python27: Fix build regression
r462630 added OpenSSL include/library paths to CFLAGS/LIBS which caused the _elementtree and pyexpat modules to fail to build. Adding paths to CFLAGS is known to cause issues [1]. Accordingly: - Switch to using CPPFLAGS for OpenSSL include/library paths (like NLS). - Move the comment describing why this is necessary to the top of the port with reasonable warning about what can happen and why. [1] https://svnweb.freebsd.org/ports?view=revision&revision=326729 PR: 226135, 222795) Reported by: many Reviewed by: sunpoet (python) Approved by: koobs (python)
Notes
Notes: svn path=/head/; revision=463321
Diffstat (limited to 'lang/python27')
-rw-r--r--lang/python27/Makefile16
1 files changed, 11 insertions, 5 deletions
diff --git a/lang/python27/Makefile b/lang/python27/Makefile
index a97b9c6f3747..e238473c950b 100644
--- a/lang/python27/Makefile
+++ b/lang/python27/Makefile
@@ -14,12 +14,21 @@ COMMENT= Interpreted object-oriented programming language
LICENSE= PSFL
+# lang/python* ports use CPPFLAGS over CFLAGS due to multiple complex
+# *FLAGS and include ordering bugs/issues in the Python build, that cause
+# modules such as elementtree and pyexpat to fail to build, among other
+# difficult to isolate issues. Do not add to or modify global variables
+# unless the implications and pitfalls are completely understood.
+# See: https://bugs.python.org/issue6299#msg210189
+
USES= cpe ncurses pathfix pkgconfig readline:port shebangfix ssl tar:xz
PATHFIX_MAKEFILEIN= Makefile.pre.in
USE_LDCONFIG= yes
-CFLAGS+= -I${OPENSSLINC}
GNU_CONFIGURE= yes
-LIBS+= -L${OPENSSLLIB}
+
+CPPFLAGS+= -I${OPENSSLINC}
+LDFLAGS+= -L${OPENSSLLIB}
+
python_CMD= ${PREFIX}/bin/python${PYTHON_PORTVERSION:R}
SHEBANG_FILES= Lib/lib2to3/pgen2/*.py Lib/lib2to3/tests/*.py Lib/lib2to3/tests/data/*.py \
Lib/idlelib/*.py Lib/encodings/*.py Lib/test/*.py Lib/UserString.py \
@@ -60,9 +69,6 @@ IPV6_CONFIGURE_ENABLE= ipv6
LIBFFI_CONFIGURE_ON= --with-system-ffi
LIBFFI_LIB_DEPENDS= libffi.so:devel/libffi
-# Use CPPFLAGS over CFLAGS due to -I ordering, causing elementtree and pyexpat
-# to break in Python 2.7, or preprocessor complaints in Python >= 3.3
-# Upstream Issue: https://bugs.python.org/issue6299
NLS_USES= gettext
NLS_CPPFLAGS= -I${LOCALBASE}/include
NLS_LIBS= -L${LOCALBASE}/lib -lintl