Next: , Previous: , Up: Advanced configuration   [Contents]


3.3 Patching packages

If you have a patch that you would like to apply to a package, the process can be automated by GSRC. First, in the package’s directory, make a subdirectory called files and move the patch file(s) there. Next, create two variables in the package’s Makefile:

PATCHFILES = my-patch.diff my-patch2.diff
PATCHOPTS = -p0

PATCHFILES holds a list of all the patch files in the files subdirectory. PATCHOPTS contains the option switches to pass to the patch program.

Next, the patch file’s checksum is added to the checksums file for the package.

$ make makesum

Note that if the make makesums command fails due to GPG verification and you trust the source from which the package or patch was downloaded, you may instead use make makesums GPGV=true to skip this key verification step.

Finally, you may build the package as normal. The patch(es) will be applied automatically in the process.

$ make install

If the patching process fails and you are sure that the patch is for the version of the package contained in GSRC, then you may have to modify the -p option in the PATCHOPTS variable (see patch Options in patch).

If the package requires a patch to even build properly, then this is a bug in GSRC. Please report such build problems to bug-gsrc@gnu.org. You should also contact the maintainers of the software package to make them aware of the problem.