Slow patching:
- don't suggest to start with recursive diff - document REINPLACE_CMD
This commit is contained in:
parent
035368baaf
commit
bdfb4638d1
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=26875
1 changed files with 21 additions and 10 deletions
|
@ -629,15 +629,16 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
|
|||
<title>Patching</title>
|
||||
|
||||
<para>In the preparation of the port, files that have been added or
|
||||
changed can be picked up with a recursive &man.diff.1;
|
||||
for later feeding to &man.patch.1;. Each set of patches you
|
||||
wish to apply should be collected into a file named
|
||||
changed can be picked up with a &man.diff.1;
|
||||
for later feeding to &man.patch.1;. Each patch you
|
||||
wish to apply should be saved into a file named
|
||||
<filename>patch-<replaceable>*</replaceable></filename> where
|
||||
<replaceable>*</replaceable> indicates
|
||||
the pathnames of the files that are patched,
|
||||
the pathname of the file that is patched,
|
||||
such as <filename>patch-Imakefile</filename> or
|
||||
<filename>patch-src-config.h</filename>. These files should
|
||||
be stored in <makevar>PATCHDIR</makevar>, from where they will be
|
||||
be stored in <makevar>PATCHDIR</makevar>
|
||||
(usually <filename>files/</filename>, from where they will be
|
||||
automatically applied. All patches must be relative to
|
||||
<makevar>WRKSRC</makevar> (generally the directory your port's
|
||||
tarball unpacks itself into, that being where the build is done).
|
||||
|
@ -673,6 +674,21 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
|
|||
lines!); define <literal>USE_AUTOTOOLS=autoconf:253</literal> and take the
|
||||
diffs of <filename>configure.in</filename>.</para>
|
||||
|
||||
<para>If you had to delete a file, then you can do it in the
|
||||
<maketarget>post-extract</maketarget> target rather than as part of
|
||||
the patch.</para>
|
||||
|
||||
<para>Simple replacements can be performed directly from the port
|
||||
<filename>Makefile</filename> using the in-place mode of
|
||||
&man.sed.1;. This is very useful when you need to patch in
|
||||
a variable value. Example:</para>
|
||||
|
||||
<programlisting>USE_REINPLACE= yes
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e 's|for Linux|for FreeBSD|g' ${WRKSRC}/README
|
||||
@${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|' ${WRKSRC}/configure</programlisting>
|
||||
|
||||
<para>Quite often, there is a situation when the software being
|
||||
ported, especially if it is primarily developed on &windows;, uses
|
||||
the CR/LF convention for most of its source files. This may cause
|
||||
|
@ -691,11 +707,6 @@ post-extract:
|
|||
<option>-iregex</option> above can be omitted. Be aware that this
|
||||
piece of code will strip all trailing control characters from each
|
||||
line of processed file (except <literal>\n</literal>).</para>
|
||||
|
||||
<para>Also, if you had to delete a file, then you can do it in the
|
||||
<maketarget>post-extract</maketarget> target rather than as part of
|
||||
the patch. Once you are happy with the resulting diff, please split
|
||||
it up into one source file per patch file.</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="slow-configure">
|
||||
|
|
Loading…
Reference in a new issue