Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151289573
D13271.id35861.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
9 KB
Referenced Files
None
Subscribers
None
D13271.id35861.diff
View Options
Index: en_US.ISO8859-1/books/porters-handbook/Makefile
===================================================================
--- en_US.ISO8859-1/books/porters-handbook/Makefile
+++ en_US.ISO8859-1/books/porters-handbook/Makefile
@@ -25,6 +25,7 @@
SRCS+= quick-porting/chapter.xml
SRCS+= slow-porting/chapter.xml
SRCS+= makefiles/chapter.xml
+SRCS+= flavors/chapter.xml
SRCS+= special/chapter.xml
SRCS+= plist/chapter.xml
SRCS+= pkg-files/chapter.xml
Index: en_US.ISO8859-1/books/porters-handbook/book.xml
===================================================================
--- en_US.ISO8859-1/books/porters-handbook/book.xml
+++ en_US.ISO8859-1/books/porters-handbook/book.xml
@@ -70,6 +70,7 @@
&chap.slow-porting;
&chap.makefiles;
&chap.special;
+ &chap.flavors;
&chap.plist;
&chap.pkg-files;
&chap.testing;
Index: en_US.ISO8859-1/books/porters-handbook/chapters.ent
===================================================================
--- en_US.ISO8859-1/books/porters-handbook/chapters.ent
+++ en_US.ISO8859-1/books/porters-handbook/chapters.ent
@@ -16,6 +16,7 @@
<!ENTITY chap.slow-porting SYSTEM "slow-porting/chapter.xml">
<!ENTITY chap.makefiles SYSTEM "makefiles/chapter.xml">
<!ENTITY chap.special SYSTEM "special/chapter.xml">
+<!ENTITY chap.flavors SYSTEM "flavors/chapter.xml">
<!ENTITY chap.plist SYSTEM "plist/chapter.xml">
<!ENTITY chap.pkg-files SYSTEM "pkg-files/chapter.xml">
<!ENTITY chap.testing SYSTEM "testing/chapter.xml">
Index: en_US.ISO8859-1/books/porters-handbook/flavors/chapter.xml
===================================================================
--- /dev/null
+++ en_US.ISO8859-1/books/porters-handbook/flavors/chapter.xml
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+ The FreeBSD Documentation Project
+
+ $FreeBSD$
+
+-->
+
+<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink=
+ "http://www.w3.org/1999/xlink" version="5.0" xml:id="flavors">
+
+ <title>Flavors</title>
+
+ <sect1 xml:id="flavors-intro">
+ <title>An Introduction to Flavors</title>
+
+ <para>Flavors are a way to have multiple variants of a port. The
+ port is built multiple times, with variations.</para>
+
+ <para>For example, a port can have a normal version, and a lite
+ version.</para>
+ </sect1>
+
+ <sect1 xml:id="flavors-using">
+ <title>Using FLAVORS</title>
+
+ <para>To declare a port having multiple flavors, add
+ <varname>FLAVORS</varname> to its <filename>Makefile</filename>.
+ The first flavor in <varname>FLAVORS</varname> is the default
+ flavor.</para>
+
+ <important>
+ <para>Flavor names can contain lowercase letters, numbers, and
+ the underscore <literal>_</literal>.</para>
+ </important>
+
+ <example xml:id="flavors-using-ex1">
+ <title>Basic Flavors Usage</title>
+
+ <para>If a port has a <quote>lite</quote> slave port, the slave
+ port can be removed, and the port can be converted to flavors
+ with:</para>
+
+ <programlisting>FLAVORS= normal lite
+lite_PKGNAMESUFFIX= -lite
+[...]
+.if ${FLAVOR:U} != lite
+[enable non lite features]
+.endif</programlisting>
+ </example>
+
+ <sect2 xml:id="flavors-using-helpers">
+ <title>Flavors Helpers</title>
+
+ <para>To make <filename>Makefile</filename> easier to write, a
+ few flavors helpers exist.</para>
+
+ <para>This list of helpers will set their variable:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><replaceable>flavor</replaceable>_PKGNAMEPREFIX</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_PKGNAMESUFFIX</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_PLIST</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_DESCR</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>This list of helpers will append to their variable:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><replaceable>flavor</replaceable>_CONFLICTS</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_CONFLICTS_BUILD</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_CONFLICTS_INSTALL</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_PKG_DEPENDS</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_EXTRACT_DEPENDS</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_PATCH_DEPENDS</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_FETCH_DEPENDS</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_BUILD_DEPENDS</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_LIB_DEPENDS</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_RUN_DEPENDS</para>
+ </listitem>
+
+ <listitem>
+ <para><replaceable>flavor</replaceable>_TEST_DEPENDS</para>
+ </listitem>
+ </itemizedlist>
+
+ </sect2>
+ </sect1>
+
+ <sect1 xml:id="flavors-auto">
+ <title>Flavors Auto-Activation</title>
+
+ <sect2 xml:id="flavors-auto-python">
+ <title><literal>USES=python</literal> Flavors</title>
+
+ <para>When using <link
+ linkend="uses-python"><literal>USES=python</literal></link>
+ and <literal>USE_PYTHON=distutils</literal>, the port
+ will automatically have <varname>FLAVORS</varname> filled in
+ with the Python versions it supports.</para>
+
+ <example xml:id="flavors-auto-python-ex1">
+ <title>Simple <literal>USES=python</literal></title>
+
+ <para>Supposing the current Python supported versions are 2.7,
+ 3.4, 3.5, and 3.6, a port with:</para>
+
+ <programlisting>USES= python
+USE_PYTHON= distutils</programlisting>
+
+ <para>Will get these flavors: <literal>py27</literal>,
+ <literal>py34</literal>, <literal>py35</literal>, and
+ <literal>py36</literal>.</para>
+ </example>
+
+ <example xml:id="flavors-auto-python-ex2">
+ <title><literal>USES=python</literal> with version
+ requirements</title>
+
+ <para>Supposing the current Python supported versions are 2.7,
+ 3.4, 3.5, and 3.6, a port with:</para>
+
+ <programlisting>USES= python:-3.5
+USE_PYTHON= distutils</programlisting>
+
+ <para>Will get these flavors: <literal>py27</literal>,
+ <literal>py34</literal>, and <literal>py35</literal>.</para>
+
+ <programlisting>USES= python:3.4+
+USE_PYTHON= distutils</programlisting>
+
+ <para>Will get these flavors: <literal>py34</literal>,
+ <literal>py35</literal>, and <literal>py36</literal>.</para>
+ </example>
+
+ <para><varname>PY_FLAVOR</varname> will be available to depend
+ on the correct version of Python modules. This is most useful
+ for ports that are not Python modules and do not have python
+ flavors but do use Python for some part of their
+ operations.</para>
+
+ <example xml:id="flavors-auto-python-ex3"> <title>For a Port Not
+ Using <literal>distutils</literal></title>
+
+ <para>If the default Python 3 version is 3.6, the following
+ will set <varname>PY_FLAVOR</varname> to
+ <literal>py36</literal>:</para>
+
+ <programlisting>RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mutagen>0:audio/py-mutagen@${PY_FLAVOR}
+
+USES= python:3.5+</programlisting>
+ </example>
+ </sect2>
+ </sect1>
+</chapter>
Index: en_US.ISO8859-1/books/porters-handbook/order/chapter.xml
===================================================================
--- en_US.ISO8859-1/books/porters-handbook/order/chapter.xml
+++ en_US.ISO8859-1/books/porters-handbook/order/chapter.xml
@@ -373,6 +373,16 @@
</itemizedlist>
</sect1>
+ <sect1 xml:id="porting-order-flavors">
+ <title>Flavors</title>
+
+ <para>This block is optional.</para>
+
+ <para>Start this section with defining <varname>FLAVORS</varname>.
+ Continue with the possible Flavors helpers. See <xref
+ linkend="flavors-using"/> for more Information.</para>
+ </sect1>
+
<sect1 xml:id="porting-order-uses">
<title><varname>USES</varname> and
<varname>USE_<replaceable>x</replaceable></varname></title>
Index: en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
===================================================================
--- en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
+++ en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
@@ -3627,7 +3627,8 @@
<buildtarget>do-install</buildtarget> targets and may
also override <buildtarget>do-configure</buildtarget>
if <varname>GNU_CONFIGURE</varname> is not
- defined.</entry>
+ defined. Additionally, it implies
+ <literal>USE_PYTHON=flavors</literal>.</entry>
</row>
<row>
@@ -3650,6 +3651,22 @@
otherwise would install conflicting files.</entry>
</row>
+ <row>
+ <entry><literal>USE_PYTHON=flavors</literal></entry>
+ <entry>The port does not use distutils but still supports
+ multiple Python versions. <link
+ linkend="flavors-auto-python"><varname>FLAVORS</varname></link>
+ will be set to the supported Python versions.</entry>
+ </row>
+
+ <row>
+ <entry><literal>USE_PYTHON=optsuffix</literal></entry>
+ <entry>If the current Python version is not the default
+ one, the port will have gain
+ <literal>PKGNAMESUFFIX=${PYTHON_PKGNAMESUFFIX}</literal>.
+ Only useful with flavors.</entry>
+ </row>
+
<row>
<entry><varname>PYTHON_PKGNAMEPREFIX</varname></entry>
<entry>Used as a <varname>PKGNAMEPREFIX</varname> to
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 8:50 AM (1 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31089789
Default Alt Text
D13271.id35861.diff (9 KB)
Attached To
Mode
D13271: Add a Flavors chapter.
Attached
Detach File
Event Timeline
Log In to Comment