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)
This commit is contained in:
Kubilay Kocak 2018-03-01 13:47:10 +00:00
parent f6504d09fc
commit 461fb52bc7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=463321

View File

@ -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