From 461fb52bc750d6ce44500c8e6d5117a52fed26ca Mon Sep 17 00:00:00 2001 From: Kubilay Kocak Date: Thu, 1 Mar 2018 13:47:10 +0000 Subject: 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) --- lang/python27/Makefile | 16 +++++++++++----- 1 file 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 -- cgit v1.2.3