# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR The FreeBSD Project # This file is distributed under the same license as the FreeBSD Documentation package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: FreeBSD Documentation VERSION\n" "POT-Creation-Date: 2025-05-01 19:56-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: YAML Front Matter: description #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:1 #, no-wrap msgid "Flavors are a way to have multiple variations of a port" msgstr "" #. type: YAML Front Matter: title #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:1 #, no-wrap msgid "Chapter 7. Flavors" msgstr "" #. type: Title = #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:14 #, no-wrap msgid "Flavors" msgstr "" #. type: Title == #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:52 #, no-wrap msgid "An Introduction to Flavors" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:56 msgid "" "Flavors are a way to have multiple variations of a port. The port is built " "multiple times, with variations." msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:58 msgid "" "For example, a port can have a normal version with many features and quite a " "few dependencies, and a light \"lite\" version with only basic features and " "minimal dependencies." msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:60 msgid "" "Another example could be, a port can have a GTK flavor and a QT flavor, " "depending on which toolkit it uses." msgstr "" #. type: Title == #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:62 #, no-wrap msgid "Using FLAVORS" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:66 msgid "" "To declare a port having multiple flavors, add `FLAVORS` to its " "[.filename]#Makefile#. The first flavor in `FLAVORS` is the default flavor." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:70 msgid "" "It can help simplify the logic of the [.filename]#Makefile# to also define " "`FLAVOR` as:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:74 #, no-wrap msgid "FLAVOR?=\t${FLAVORS:[1]}\n" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:80 msgid "" "To distinguish flavors from options, which are always uppercase letters, " "flavor names can _only_ contain lowercase letters, numbers, and the " "underscore `_`." msgstr "" #. type: Block title #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:83 #, no-wrap msgid "Basic Flavors Usage" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:87 msgid "" "If a port has a \"lite\" slave port, the slave port can be removed, and the " "port can be converted to flavors with:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:96 #, no-wrap msgid "" "FLAVORS=\tdefault lite\n" "lite_PKGNAMESUFFIX=\t-lite\n" "[...]\n" ".if ${FLAVOR:U} != lite\n" "[enable non lite features]\n" ".endif\n" msgstr "" #. type: Block title #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:101 #, no-wrap msgid "Another Basic Flavors Usage" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:105 msgid "" "If a port has a `-nox11` slave port, the slave port can be removed, and the " "port can be converted to flavors with:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:115 #, no-wrap msgid "" "FLAVORS=\tx11 nox11\n" "FLAVOR?=\t${FLAVORS:[1]}\n" "nox11_PKGNAMESUFFIX=\t-nox11\n" "[...]\n" ".if ${FLAVOR} == x11\n" "[enable x11 features]\n" ".endif\n" msgstr "" #. type: Block title #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:120 #, no-wrap msgid "More Complex Flavors Usage" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:126 msgid "" "Here is a slightly edited excerpt of what is present in package:devel/" "libpeas[], a port that uses the crossref:flavors[flavors-auto-python,Python " "flavors]. With the default Python 2 and 3 versions being 2.7 and 3.6, it " "will automatically get `FLAVORS=py27 py36`" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:131 #, no-wrap msgid "" "USES=\t\tgnome python\n" "USE_PYTHON=\tflavors \n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:134 #, no-wrap msgid "" ".if ${FLAVOR:Upy27:Mpy2*} \n" "USE_GNOME=\tpygobject3 \n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:136 #, no-wrap msgid "CONFIGURE_ARGS+=\t--enable-python2 --disable-python3\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:141 #, no-wrap msgid "" "BUILD_WRKSRC=\t${WRKSRC}/loaders/python \n" "INSTALL_WRKSRC=\t${WRKSRC}/loaders/python \n" ".else # py3*\n" "USE_GNOME+=\tpy3gobject3 \n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:144 #, no-wrap msgid "" "CONFIGURE_ARGS+=\t--disable-python2 --enable-python3 \\\n" "\t\t\tac_cv_path_PYTHON3_CONFIG=${LOCALBASE}/bin/python${PYTHON_VER}-config \n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:148 #, no-wrap msgid "" "BUILD_WRKSRC=\t${WRKSRC}/loaders/python3 \n" "INSTALL_WRKSRC=\t${WRKSRC}/loaders/python3 \n" ".endif\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:152 #, no-wrap msgid "" "py34_PLIST=\t${.CURDIR}/pkg-plist-py3 \n" "py35_PLIST=\t${.CURDIR}/pkg-plist-py3 \n" "py36_PLIST=\t${.CURDIR}/pkg-plist-py3\n" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:162 msgid "" "This port does not use `USE_PYTHON=distutils` but needs Python flavors " "anyway. To guard against `FLAVOR` being empty, which would cause a " "man:make[1] error, use `${FLAVOR:U}` in string comparisons instead of `$" "{FLAVOR}`. The Gnome Python gobject3 bindings have two different names, one " "for Python 2, pygobject3 and one for Python 3, py3gobject3. The `configure` " "script has to run in [.filename]#${WRKSRC}#, but we are only interested in " "building and installing the Python 2 or Python 3 parts of the software, so " "set the build and install base directories appropriately. Hint about the " "correct Python 3 config script path name. The packing list is different " "when the built with Python 3. As there are three possible Python 3 versions, " "set `PLIST` for all three using the crossref:flavors[flavors-using-" "helpers,helper]." msgstr "" #. type: Title === #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:165 #, no-wrap msgid "Flavors Helpers" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:168 msgid "" "To make the [.filename]#Makefile# easier to write, a few flavors helpers " "exist." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:170 msgid "This list of helpers will set their variable:" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:172 msgid "`__flavor___PKGNAMEPREFIX`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:173 msgid "`__flavor___PKGNAMESUFFIX`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:174 msgid "`__flavor___PLIST`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:175 msgid "`__flavor___DESCR`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:177 msgid "This list of helpers will append to their variable:" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:179 msgid "`__flavor___CONFLICTS`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:180 msgid "`__flavor___CONFLICTS_BUILD`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:181 msgid "`__flavor___CONFLICTS_INSTALL`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:182 msgid "`__flavor___PKG_DEPENDS`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:183 msgid "`__flavor___EXTRACT_DEPENDS`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:184 msgid "`__flavor___PATCH_DEPENDS`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:185 msgid "`__flavor___FETCH_DEPENDS`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:186 msgid "`__flavor___BUILD_DEPENDS`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:187 msgid "`__flavor___LIB_DEPENDS`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:188 msgid "`__flavor___RUN_DEPENDS`" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:189 msgid "`__flavor___TEST_DEPENDS`" msgstr "" #. type: Block title #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:191 #, no-wrap msgid "Flavor Specific `PKGNAME`" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:195 msgid "" "As all packages must have a different package name, flavors must change " "theirs, using `__flavor___PKGNAMEPREFIX` and `__flavor___PKGNAMESUFFIX` " "makes this easy:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:200 #, no-wrap msgid "" "FLAVORS=\tnormal lite\n" "lite_PKGNAMESUFFIX=\t-lite\n" msgstr "" #. type: Title == #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:205 #, no-wrap msgid "`USES=php` and Flavors" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:209 msgid "" "When using crossref:uses[uses-php,`php`] with one of these arguments, " "`phpize`, `ext`, `zend`, or `pecl`, the port will automatically have " "`FLAVORS` filled in with the PHP versions it supports." msgstr "" #. type: Block title #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:211 #, no-wrap msgid "Simple `USES=php` Extension" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:215 msgid "This will generate package for all the supported versions:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:221 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:232 #, no-wrap msgid "" "PORTNAME=\tsome-ext\n" "PORTVERSION=\t0.0.1\n" "PKGNAMEPREFIX=\t${PHP_PKGNAMEPREFIX}\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:223 #, no-wrap msgid "USES=\t\tphp:ext\n" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:226 msgid "This will generate package for all the supported versions but 7.2:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:235 #, no-wrap msgid "" "USES=\t\tphp:ext\n" "IGNORE_WITH_PHP=\t72\n" msgstr "" #. type: Title === #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:240 #, no-wrap msgid "PHP Flavors with PHP Applications" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:243 msgid "PHP applications can also be flavorized." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:245 msgid "" "This allows generating packages for all PHP versions, so that users can use " "them with whatever version they need on their servers." msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:249 msgid "" "PHP applications that are flavorized _must_ append `PHP_PKGNAMESUFFIX` to " "their package names." msgstr "" #. type: Block title #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:252 #, no-wrap msgid "Flavorizing a PHP Application" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:256 msgid "Adding Flavors support to a PHP application is straightforward:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:260 #, no-wrap msgid "PKGNAMESUFFIX=\t${PHP_PKGNAMESUFFIX}\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:262 #, no-wrap msgid "USES=\tphp:flavors\n" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:270 msgid "" "When adding a dependency on a PHP flavored port, use `@${PHP_FLAVOR}`. " "_Never_ use `FLAVOR` directly." msgstr "" #. type: Title == #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:273 #, no-wrap msgid "`USES=python` and Flavors" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:277 msgid "" "When using crossref:uses[uses-python,`python`] and `USE_PYTHON=distutils`, " "the port will automatically have `FLAVORS` filled in with the Python " "versions it supports." msgstr "" #. type: Block title #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:279 #, no-wrap msgid "Simple `USES=python`" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:283 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:306 msgid "" "Supposing the current Python supported versions are 2.7, 3.4, 3.5, and 3.6, " "and the default Python 2 and 3 versions are 2.7 and 3.6, a port with:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:288 #, no-wrap msgid "" "USES=\tpython\n" "USE_PYTHON=\tdistutils\n" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:291 msgid "Will get these flavors: `py27`, and `py36`." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:296 #, no-wrap msgid "" "USES=\tpython\n" "USE_PYTHON=\tdistutils allflavors\n" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:299 msgid "Will get these flavors: `py27`, `py34`, `py35` and `py36`." msgstr "" #. type: Block title #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:302 #, no-wrap msgid "`USES=python` with Version Requirements" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:311 #, no-wrap msgid "" "USES=\tpython:-3.5\n" "USE_PYTHON=\tdistutils\n" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:314 msgid "Will get this flavor: `py27`." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:319 #, no-wrap msgid "" "USES=\tpython:-3.5\n" "USE_PYTHON=\tdistutils allflavors\n" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:322 msgid "Will get these flavors: `py27`, `py34`, and `py35`." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:327 #, no-wrap msgid "" "USES=\tpython:3.4+\n" "USE_PYTHON=\tdistutils\n" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:330 msgid "Will get this flavor: `py36`." msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:335 #, no-wrap msgid "" "USES=\tpython:3.4+\n" "USE_PYTHON=\tdistutils allflavors\n" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:338 msgid "Will get these flavors: `py34`, `py35`, and `py36`." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:342 msgid "" "`PY_FLAVOR` is available to depend on the correct version of Python " "modules. All dependencies on flavored Python ports should use `PY_FLAVOR`, " "and not `FLAVOR` directly.." msgstr "" #. type: Block title #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:344 #, no-wrap msgid "For a Port Not Using `distutils`" msgstr "" #. type: Plain text #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:348 msgid "" "If the default Python 3 version is 3.6, the following will set `PY_FLAVOR` " "to `py36`:" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:352 #, no-wrap msgid "RUN_DEPENDS=\t${PYTHON_PKGNAMEPREFIX}mutagen>0:audio/py-mutagen@${PY_FLAVOR}\n" msgstr "" #. type: delimited block . 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:354 #, no-wrap msgid "USES=\tpython:3.5+\n" msgstr "" #. type: Title == #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:359 #, no-wrap msgid "`USES=lua` and Flavors" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:365 msgid "" "When using crossref:uses[uses-lua,`lua:module`] or crossref:uses[uses-" "lua,`lua:flavors`], the port will automatically have `FLAVORS` filled in " "with the Lua versions it supports. However, it is not expected that " "ordinary applications (rather than Lua modules) should use this feature; " "most applications that embed or otherwise use Lua should simply use " "`USES=lua`." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:367 msgid "" "`LUA_FLAVOR` is available (and must be used) to depend on the correct " "version of dependencies regardless of whether the port used the `flavors` or " "`module` parameters." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:369 msgid "See crossref:special[using-lua,Using Lua] for further information." msgstr "" #. type: Title == #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:371 #, no-wrap msgid "`USES=guile` and Flavors" msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:378 msgid "" "When using crossref:uses[uses-guile,`guile:flavors`], the port will " "automatically have `FLAVORS` filled in with the Guile versions it supports. " "However, it is not expected that ordinary applications should use this " "feature; it is primarily intended for use by libraries and extensions, such " "as `guile-lib` or `guile-cairo`." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:380 msgid "" "`GUILE_FLAVOR` is available (and must be used) to depend on the correct " "version of flavored dependencies regardless of whether the port used the " "`flavors` parameter or not." msgstr "" #. type: delimited block = 4 #: documentation/content/en/books/porters-handbook/flavors/_index.adoc:381 msgid "See crossref:special[using-guile,Using Guile] for further information." msgstr ""