Index: Mk/Uses/python.mk =================================================================== --- Mk/Uses/python.mk +++ Mk/Uses/python.mk @@ -1,5 +1,7 @@ # $FreeBSD$ # +# MAINTAINER: python@FreeBSD.org +# # Provide support for Python related ports. This includes detecting Python # interpreters, ports providing package and modules for python as well as # consumer ports requiring Python at build or run time. @@ -154,7 +156,7 @@ # PYTHON_VER - The major-minor release version of the chosen Python # interpreter, e.g. 2.7, 3.4, ... # -# PYTHON_ABIVER - Additional ABI flags set by the chosen Python +# PYTHON_ABIFLAGS - Additional ABI flags set by the chosen Python # interpreter, e.g. md # # PYTHON_INCLUDEDIR - Location of the Python include files. @@ -210,8 +212,6 @@ # # PYDISTUTILS_INSTALLNOSINGLE # - Deprecated without replacement -# -# MAINTAINER: python@FreeBSD.org .if !defined(_INCLUDE_USES_PYTHON_MK) _INCLUDE_USES_PYTHON_MK= yes @@ -253,13 +253,13 @@ .include "${PORTSDIR}/Mk/bsd.default-versions.mk" .if defined(PYTHON_DEFAULT_VERSION) -WARNING+= "PYTHON_DEFAULT_VERSION is defined, consider using DEFAULT_VERSIONS=python=${PYTHON_DEFAULT_VERSION:S/^python//} instead" +WARNING+= "[DEPRECATED] PYTHON_DEFAULT_VERSION is defined, use DEFAULT_VERSIONS=python=${PYTHON_DEFAULT_VERSION:S/^python//} instead" .endif .if defined(PYTHON2_DEFAULT_VERSION) -WARNING+= "PYTHON2_DEFAULT_VERSION is defined, consider using DEFAULT_VERSIONS=python2=${PYTHON2_DEFAULT_VERSION:S/^python//} instead" +WARNING+= "[DEPRECATED: PYTHON2_DEFAULT_VERSION is defined, use DEFAULT_VERSIONS=python2=${PYTHON2_DEFAULT_VERSION:S/^python//} instead" .endif .if defined(PYTHON3_DEFAULT_VERSION) -WARNING+= "PYTHON3_DEFAULT_VERSION is defined, consider using DEFAULT_VERSIONS=python3=${PYTHON3_DEFAULT_VERSION:S/^python//} instead" +WARNING+= "[DEPRECATED] PYTHON3_DEFAULT_VERSION is defined, use DEFAULT_VERSIONS=python3=${PYTHON3_DEFAULT_VERSION:S/^python//} instead" .endif .if exists(${LOCALBASE}/bin/python) @@ -267,7 +267,7 @@ 'import sys; print("%d.%d" % sys.version_info[:2])' 2> /dev/null \ || ${ECHO_CMD} ${_PYTHON_PORTBRANCH}) | ${TAIL} -1 .if defined(PYTHON_DEFAULT) && (${PYTHON_DEFAULT} != ${_PYTHON_DEFAULT_VERSION}) -WARNING+= "Your requested default python version ${PYTHON_DEFAULT} is different from the installed default python interpreter version ${_PYTHON_DEFAULT_VERSION}" +WARNING+= "The requested default python version ${PYTHON_DEFAULT} does not match the installed default python interpreter version ${_PYTHON_DEFAULT_VERSION}" .endif PYTHON_DEFAULT_VERSION= python${_PYTHON_DEFAULT_VERSION} .else @@ -380,21 +380,29 @@ PYTHON_SUFFIX= ${_PYTHON_VERSION:S/.//g} PYTHON_MAJOR_VER= ${PYTHON_VER:R} PYTHON_REL= # empty -PYTHON_ABIVER= # empty +PYTHON_ABIFLAGS= # empty PYTHON_PORTSDIR= ${_PYTHON_RELPORTDIR}${PYTHON_SUFFIX} PYTHON_PORTVERSION!= ${MAKE} -V PORTVERSION -C ${PYTHON_PORTSDIR} PYTHON_REL= ${PYTHON_PORTVERSION:C/\.([0-9]+)$/.0\1/:C/\.0?([0-9][0-9])$/.\1/:S/.//g} # Might be overridden by calling ports PYTHON_CMD?= ${_PYTHON_BASECMD}${_PYTHON_VERSION} -.if exists(${PYTHON_CMD}-config) && ${PYTHON_VER} != 2.7 -PYTHON_ABIVER!= ${PYTHON_CMD}-config --abiflags +PYTHON_CONFIG_CMD?= ${PYTHON_CMD}-config + +.if exists(${PYTHON_CONFIG_CMD}) +PYTHON_CFLAGS!= ${PYTHON_CONFIG_CMD} --cflags +PYTHON_INCLUDES!= ${PYTHON_CONFIG_CMD} --includes +PYTHON_LDFLAGS!= ${PYTHON_CONFIG_CMD} --ldflags +PYTHON_LIBS!= ${PYTHON_CONFIG_CMD} --libs +.if ${PYTHON_VER} != 2.7 # Added in 3.x + +PYTHON_ABIFLAGS!= ${PYTHON_CONFIG_CMD} --abiflags +.endif .endif PYTHONBASE!= (${PYTHON_CMD} -c 'import sys; print(sys.prefix)' \ 2> /dev/null || ${ECHO_CMD} ${LOCALBASE}) | ${TAIL} -1 -PYTHON_INCLUDEDIR= ${PYTHONBASE}/include/python${_PYTHON_VERSION}${PYTHON_ABIVER} +PYTHON_INCLUDEDIR= ${PYTHONBASE}/include/python${_PYTHON_VERSION}${PYTHON_ABIFLAGS} PYTHON_LIBDIR= ${PYTHONBASE}/lib/python${_PYTHON_VERSION} PYTHON_PLATFORM= ${OPSYS:tl}${OSREL:C/\.[0-9.]*//} PYTHON_SITELIBDIR= ${PYTHON_LIBDIR}/site-packages Index: editors/libreoffice/Makefile =================================================================== --- editors/libreoffice/Makefile +++ editors/libreoffice/Makefile @@ -105,8 +105,8 @@ OPENCOLLADA_LIBS="${COLLADA_LIBS}" \ OPENSSL_CFLAGS="-I/usr/include" \ OPENSSL_LIBS="-lcrypto -lssl" \ - PYTHON_CFLAGS="`${PYTHON_VERSION}-config --cflags`" \ - PYTHON_LIBS="`${PYTHON_VERSION}-config --libs`" + PYTHON_CFLAGS="${PYTHON_CFLAGS}" \ + PYTHON_LIBS="${PYTHON_LIBS}" CONFIGURE_ARGS+= --disable-dependency-tracking \ --disable-fetch-external \ Index: textproc/py-libxml2/Makefile =================================================================== --- textproc/py-libxml2/Makefile +++ textproc/py-libxml2/Makefile @@ -19,8 +19,8 @@ USES+= python:2 USE_PYTHON= autoplist distutils -CPPFLAGS+= `${PYTHON_VERSION}-config --cflags` -LDFLAGS+= -L${LOCALBASE}/lib `${PYTHON_VERSION}-config --libs` +CPPFLAGS+= ${PYTHON_CFLAGS} +LDFLAGS+= -L${LOCALBASE}/lib ${PYTHON_LIBS} CONFIGURE_ARGS= --with-iconv=${ICONV_PREFIX} \ --with-html-dir=${PREFIX}/share/doc \ --with-html-subdir=${PORTNAME} \ Index: textproc/py3-libxml2/Makefile =================================================================== --- textproc/py3-libxml2/Makefile +++ textproc/py3-libxml2/Makefile @@ -19,8 +19,8 @@ USES= python:3 USE_PYTHON= autoplist distutils -CPPFLAGS+= `${PYTHON_VERSION}-config --cflags` -LDFLAGS+= -L${LOCALBASE}/lib `${PYTHON_VERSION}-config --libs` +CPPFLAGS+= ${PYTHON_CFLAGS} +LDFLAGS+= -L${LOCALBASE}/lib ${PYTHON_LIBS} CONFIGURE_ARGS= --with-iconv=${ICONV_PREFIX} \ --with-html-dir=${PREFIX}/share/doc \ --with-html-subdir=${PORTNAME} \