Commit f49ca5b9 authored by Torsten Zuehlsdorff's avatar Torsten Zuehlsdorff

Update to r455275

parent 12214552

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -10,6 +10,90 @@ in the release notes and/or placed into UPDATING.
All ports committers are allowed to commit to this file.
Ports using USE_PYTHON=distutils are now flavored. They will automatically
get flavors (py27, py34, py35, py36) depending on what versions they support.
There is also a USE_PYTHON=flavors for ports that do not use distutils but
need FLAVORS to be set. A USE_PYTHON=noflavors can be set if the port is
using distutils but flavors are not wanted.
A new USE_PYTHON=optsuffix that will adds PYTHON_PKGNAMESUFFIX has been added
to cope with Python ports that did not have the Python PKGNAMEPREFIX but are
USES=python now also exports a PY_FLAVOR variable that contains the current
python flavor. It can be used in dependency lines when the port itself is
not python flavored, for example, deskutils/calibre.
By default it will only generate flavors for the versions in PYTHON2_DEFAULT
and PYTHON3_DEFAULT. Define BUILD_ALL_PYTHON_FLAVORS in your make.conf to
generate all possible flavors. A port can set USE_PYTHON=allflavors to have
all the flavors and not simply the default ones.
In all the ports with Python dependencies, the *_DEPENDS entries MUST end
with the flavor so that the framework knows which to build/use. This is done
by appending '@${PY_FLAVOR}' after the origin (or @${FLAVOR} if in a Python
module with Python flavors, as the content will be the same). For example:
To help with flavored ports, helpers are available. In these, replace <*>
with the flavor name.
*_PKGNAMEPREFIX *_PKGNAMESUFFIX *_PLIST *_DESCR will overwrite the variable.
*_LIB_DEPENDS *_RUN_DEPENDS *_TEST_DEPENDS will append to the variable.
For example:
flavor2_PKGNAMESUFFIX= -foo
can replace:
.if ${FLAVOR:U} == flavor2
Flavors are a way to have multiple variations of a port. The port is built
multiple times, with the variations. To declare flavors, set the FLAVORS
variable to the flavors you want defined. The first flavor will be the
FLAVORS= flavor1 flavor2
The flavors MUST be lowercase, and can contain [[:lower:][:digit:]_].
Then, when building the port, pass the FLAVOR as an argument after make to
select the flavor.
$ make install FLAVOR=flavor2
In the port, you can then change the behavior depending on the value of the
FLAVOR variable. Note that the different flavors MUST have different
PKGNAMEs. Be sure to guard against an empty FLAVOR variable by using
.if ${FLAVOR:U} == flavor2
A tools guide is available at:
A port migration guide is available at:
......@@ -3381,4 +3465,4 @@ POSSIBILITY OF SUCH DAMAGE.
Contact if you have any questions about your use of
this document.
$FreeBSD: head/CHANGES 452546 2017-10-20 17:23:47Z ak $
$FreeBSD: head/CHANGES 455217 2017-11-30 18:03:35Z bdrewery $
This diff is collapsed.
# $FreeBSD: head/Mk/Scripts/ 451250 2017-10-04 21:01:09Z adridg $
# $FreeBSD: head/Mk/Scripts/ 455205 2017-11-30 15:33:29Z mat $
if [ -z "${STAGEDIR}" -o -z "${PREFIX}" -o -z "${LOCALBASE}" ]; then
echo "STAGEDIR, PREFIX, LOCALBASE required in environment." >&2
......@@ -841,9 +841,26 @@ gemdeps()
return $rc
local rc pkgnames uniques
if [ -n "${FLAVOR}" ]; then
pkgnames=$(make -C "${CURDIR}" flavors-package-names|sort)
uniques=$(echo "${pkgnames}"|uniq)
if [ "$pkgnames" != "${uniques}" ]; then
err "Package names are not uniques with flavors:"
make -C "${CURDIR}" pretty-flavors-package-names >&2
err "maybe use <flavor>_PKGNAMEPREFIX/SUFFIX".
return ${rc}
checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo"
checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo"
checks="$checks proxydeps sonames perlcore no_arch gemdeps"
checks="$checks proxydeps sonames perlcore no_arch gemdeps flavors"
# $FreeBSD: head/Mk/Uses/ 452147 2017-10-15 14:05:04Z madpilot $
# $FreeBSD: head/Mk/Uses/ 455101 2017-11-29 11:06:11Z tobik $
# This file contains logic to ease porting of Rust packages or
# binaries using the `cargo` command.
......@@ -72,6 +72,13 @@ CARGO_ENV+= \
RUSTDOC=${LOCALBASE}/bin/rustdoc \
# Adjust -C target-cpu if -march/-mcpu is set by
.if ${ARCH} == amd64 || ${ARCH} == i386
RUSTFLAGS+= ${CFLAGS:M-march=*:S/-march=/-C target-cpu=/}
RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/}
# Helper to shorten cargo calls.
#-*- tab-width: 4; -*-
# ex:ts=4
# $FreeBSD: head/Mk/Uses/ 451901 2017-10-12 15:57:51Z mat $
# $FreeBSD: head/Mk/Uses/ 455210 2017-11-30 15:50:30Z mat $
# $NetBSD: $
# Please view me with 4 column tabs!
......@@ -388,14 +388,15 @@ pygobject_BUILD_DEPENDS= pygobject-codegen-2.0:devel/py-gobject
pygobject_RUN_DEPENDS= pygobject-codegen-2.0:devel/py-gobject
pygobject_USE_GNOME_IMPL= glib20
# Have to keep two components because the _DETECT file is not the same.
py3gobject3_DETECT= ${LOCALBASE}/share/py3gobject3/.keep
py3gobject3_BUILD_DEPENDS= py3?-gobject3>=0:devel/py3-gobject3
py3gobject3_RUN_DEPENDS= py3?-gobject3>=0:devel/py3-gobject3
py3gobject3_BUILD_DEPENDS= py3?-gobject3>=0:devel/py-gobject3@${PY_FLAVOR}
py3gobject3_RUN_DEPENDS= py3?-gobject3>=0:devel/py-gobject3@${PY_FLAVOR}
py3gobject3_USE_GNOME_IMPL= glib20
pygobject3_DETECT= ${LOCALBASE}/share/pygobject3/.keep
pygobject3_BUILD_DEPENDS= py2?-gobject3>=0:devel/py-gobject3
pygobject3_RUN_DEPENDS= py2?-gobject3>=0:devel/py-gobject3
pygobject3_BUILD_DEPENDS= py2?-gobject3>=0:devel/py-gobject3@${PY_FLAVOR}
pygobject3_RUN_DEPENDS= py2?-gobject3>=0:devel/py-gobject3@${PY_FLAVOR}
pygobject3_USE_GNOME_IMPL= glib20
pygtk2_DETECT= ${LOCALBASE}/libdata/pkgconfig/pygtk-2.0.pc
# $FreeBSD: head/Mk/Uses/ 453263 2017-11-01 07:32:34Z antoine $
# $FreeBSD: head/Mk/Uses/ 455210 2017-11-30 15:50:30Z mat $
# Handle PyQt related ports
......@@ -241,8 +241,8 @@ do-configure:
.for comp in ${_USE_PYQT_ALL:O:u}
_USE_PYQT_ALL_SUFFIXED+= py-${comp} py-${comp}_build py-${comp}_run
py-${comp}_BUILD_DEPENDS?= ${py-${comp}_PATH}:${py-${comp}_PORT}
py-${comp}_RUN_DEPENDS?= ${py-${comp}_PATH}:${py-${comp}_PORT}
py-${comp}_BUILD_DEPENDS?= ${py-${comp}_PATH}:${py-${comp}_PORT}@${PY_FLAVOR}
py-${comp}_RUN_DEPENDS?= ${py-${comp}_PATH}:${py-${comp}_PORT}@${PY_FLAVOR}
py-${comp}_build_BUILD_DEPENDS?= ${py-${comp}_BUILD_DEPENDS}
py-${comp}_run_RUN_DEPENDS?= ${py-${comp}_RUN_DEPENDS}
# $FreeBSD: head/Mk/Uses/ 449198 2017-09-03 10:36:15Z rene $
# $FreeBSD: head/Mk/Uses/ 455210 2017-11-30 15:50:30Z mat $
# Provide support for Python related ports. This includes detecting Python
# interpreters, ports providing package and modules for python as well as
......@@ -71,8 +71,24 @@
# prefix-less original name, e.g.
# bin/foo-2.7 --> bin/foo.
# cython - Depend on lang/cython at build-time.
# cython_run - Depend on lang/cython at run-time.
# flavors - Force creation of flavors for Python 2 and 3 default
# versions, where applicable.
# noflavors - Disable automatic creation of flavors if they would
# otherwise be created and they are not wanted.
# allflavors - Generate flavors for all possible versions and not
# simply the default ones.
# optsuffix - Set PKGNAMESUFFIX to PYTHON_PKGNAMESUFFIX if not the
# default python version.
# distutils - Use distutils as do-configure, do-build and
# do-install targets.
# do-install targets. implies flavors.
# autoplist - Automatically generates the packaging list for a
# port that uses distutils when defined.
......@@ -235,9 +251,19 @@ _PYTHON_RELPORTDIR= lang/python
# Make each individual feature available as _PYTHON_FEATURE_<FEATURENAME>
.for var in ${USE_PYTHON}
_PYTHON_FEATURE_${var:tu}= yes
_PYTHON_FEATURE_${var:C/=.*$//:tu}= ${var:C/.*=//:S/,/ /g}
# distutils automatically generates flavors depending on the supported
# versions.
# Make sure that no dependency or some other environment variable
# pollutes the build/run dependency detection
......@@ -307,6 +333,7 @@ PYTHON3_DEFAULT_VERSION?= python${PYTHON3_DEFAULT}
# Keep this before the FLAVOR selection to get the meta port dependency.
.if ${_PYTHON_ARGS} == "2"
......@@ -372,6 +399,60 @@ IGNORE= needs an unsupported version of Python
# Automatically generates FLAVORS if empty
.if empty(FLAVORS) && defined(_PYTHON_FEATURE_FLAVORS)
__VER= ${ver}