Development/Patching External Libraries

Creating Patches for External Project
External libraries are being integrated in gbuild. In order to simplify the generation of patches for such libraries, gbuild has been fitted with few improvements.

For the purpose of this document, means a top-level module, means the name associated with the package unpacked. By convention you should have a file named external/ /UnpackedTarball_ .mk

First, one need to make sure to have a 'pristine reference' to be able to make the patch.

make .clean patches=t make

Be careful, if you do not generate the reference copy upfront, you won't be able to generate a patch. The safer way is simply to export patches=t in the beginning of the session, to be safe.

The files you can edit are in

you can build them by doing: cd external/ make -r

If a simple make does not detect the changes you've made, you can try instead of. This special target will try to force a rebuild.

Beware that you cannot do  to force a rebuild as it would delete the change you've made to the Unpacked sources and replace them with a new pristine copy.

Once you are satisfied with your changes, you can generate a patch using

cd external/ make .genpatch

This will create a patches named .new.patch.1

you can then move that file to the appropriate location in the module, and update UnpackedTarball_ .mk to add that new patch in the list of patches to apply.

Note: the .1 suffix indicate that this patch need to be applied with -p1. in general the convention is that a patch's filename, if it end with . -- where  is a digit -- indicate a patch that need to be applied with -p . Currently the default level is -p3 for historical reasons. This naming convention allow for an easy transition from the legacy situation.