Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151757887
D12165.id32635.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12165.id32635.diff
View Options
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 <bsd.port.options.mk>
+
+# Patch in the iconv const qualifier before this
+.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100069
+EXTRA_PATCHES= ${PATCHDIR}/extra-patch-fbsd10
+.endif
+
+.include <bsd.port.mk></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
Details
Attached
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)
Attached To
Mode
D12165: Add a bit about EXTRA_PATCHES.
Attached
Detach File
Event Timeline
Log In to Comment