Page MenuHomeFreeBSD

D12165.id32635.diff
No OneTemporary

D12165.id32635.diff

Index: head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml
===================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml
+++ head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml
@@ -450,6 +450,50 @@
<programlisting>USES= dos2unix
DOS2UNIX_WRKSRC= ${WRKDIR}</programlisting>
</sect2>
+
+ <sect2 xml:id="slow-patch-extra">
+ <title>Patching Conditionally</title>
+
+ <para>Some ports need patches that are only applied for specific
+ &os; versions or when a particular option is enabled or
+ disabled. Conditional patches are specified by placing the
+ full paths to the patch files in
+ <varname>EXTRA_PATCHES</varname>.</para>
+
+ <example xml:id="slow-patch-extra-ex1">
+ <title>Applying a Patch for a Specific &os; Version</title>
+
+ <programlisting>.include &lt;bsd.port.options.mk&gt;
+
+# Patch in the iconv const qualifier before this
+.if ${OPSYS} == FreeBSD &amp;&amp; ${OSVERSION} &lt; 1100069
+EXTRA_PATCHES= ${PATCHDIR}/extra-patch-fbsd10
+.endif
+
+.include &lt;bsd.port.mk&gt;</programlisting>
+
+ </example>
+
+ <example xml:id="slow-patch-extra-ex2">
+ <title>Optionaly Applying a Patch</title>
+
+ <para>When an <link linkend="makefile-options">option</link>
+ requires a patch, use
+ <varname><replaceable>opt</replaceable>_EXTRA_PATCHES</varname>
+ and
+ <varname><replaceable>opt</replaceable>_EXTRA_PATCHES_OFF</varname>
+ to make the patch conditional on the
+ <literal><replaceable>opt</replaceable></literal> option.
+ See <xref linkend="options-variables"/> for more
+ information.</para>
+
+ <programlisting>OPTIONS_DEFINE= FOO BAR
+FOO_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-foo
+BAR_EXTRA_PATCHES_OFF= ${PATCHDIR}/extra-patch-bar.c \
+ ${PATCHDIR}/extra-patch-bar.h</programlisting>
+ </example>
+
+ </sect2>
</sect1>
<sect1 xml:id="slow-configure">

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 11, 11:33 AM (18 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31287868
Default Alt Text
D12165.id32635.diff (1 KB)

Event Timeline