order of patches under ports/xxx/zzz/files
Anton Shterenlikht
mexas at bris.ac.uk
Thu Jul 11 07:45:38 UTC 2013
From swhetzel at gmail.com Wed Jul 10 17:58:47 2013
On Wed, Jul 10, 2013 at 4:03 AM, Anton Shterenlikht <mexas at bris.ac.uk> wrote:
> I'm trying to understand exactly how the patches
> located in files directory in a port apply.
> For example, port math/metis-edf has under files:
>
> # ls files/
> medis-patch-Lib_Makefile.txt patch-Lib::proto.h patch-Test::Makefile
> patch-CONFIG::configure patch-Lib_Makefile patch-onmetis
> patch-CONFIG_onmetis.in patch-Programs::Makefile
> #
>
> Patch medis-patch-Lib_Makefile.txt must be applied
> on top of patch-Lib_Makefile. This does seem to
> work, but what process makes sure that the order
> of patch application is exactly that.
>
Patch files are applied in alphabetical order.
ok, got it
What is medis-patch-Lib_Makefile.txt? Is it a private patch, an
update for the port, or applied when an Option is selected?
If it is a private patch, then try naming it
patch-Lib_Makefile-private, then see if it patches the files in the
correct order:
I guess that is my case. This is patch
suggested via a PR, but the author made
the patch to be applied on top, not instead of,
patch-Lib_Makefile.
So I renamed it as patch-Lib_Makefile.txt and
that put it after the original patch in alphabetic
order.
cd /usr/ports/match/metis-edf
make clean ; make patch
If it is an update for the port, then you should merge
patch-Lib_Makefile and medis-patch-Lib_Makefile.txt
cd /usr/ports/math/metis-edf
make clean ; make patch
cd ./work/metis-edf-4.1/
mv Lib/Makefile.orig Lib/Makefile.orig1
patch < ../../files/medis-patch-Lib_Makefile.txt
mv Lib/Makefile.orig1 Lib/Makefile.orig
diff -u Lib/Makefile.orig Lib/Makefile > ../../files/patch-Lib_Makefile
I think this is going to happen at a later stage
when the new patch has been confirmed to solve
the problem.
If the patch is to be applied when a certain option is selected, then
add the patch as a EXTRA_PATCHES
math/metis-edf/Makefile
OPTIONS_DEFINE= ZAX
ZAX_DESC= apply extra patch to Lib/Makefile
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MZAX}
EXTRA_PATCHES+= ${FILESDIR}/medis-patch-Lib_Makefile.txt
.endif
Note: ZAX and ZAX_DESC should tell us what the extra patch does.
Thanks
Anton
More information about the freebsd-ports
mailing list