[csw-maintainers] mgar: how to maintain a patch?

Sebastian Kayser skayser at opencsw.org
Thu May 14 20:51:19 CEST 2009


Hi John,

John Ellson wrote:
> I'm trying to package gts with mgar.  Its an optional dependency for
> graphviz and its a smaller
> package for me to learn about mgar.
>
> gts-0.7.6 doesn't build on Solaris (it uses fabsf() which isn't
> available).   The patch is easy, and I've reported the
> problem upstream and provided them with a patch.
>
> Meanwhile, how do I maintain and apply a patch in mgar?     A pointer to
> an example pkg with patches would be fine...

socat [1], or xterm [2], or ncdu [3] would be an example. You simply
create a patch file (or multiple patch files) for the extracted source
directory, store them in the files/ subdirectory of your GAR build
directory and list the patch files in $(PATCHFILES). They would then get
applied in the "patch" phase of the build.

So if you do a "gmake extract", the patches won't be in there yet, but
when you do a "gmake patch" they will be applied. Ah, and you need to do a
"gmake makesum" after referencing the patch files, so that the diffs are
covered by the checksums file.

To initially create the patch you can either create it manually or call
"gmake extract", patch the sources and then do a "gmake makepatch". You
will end up with one gar-base.diff in the files/ subdirectory, which you
can reference in PATCHFILES.

I have done so for ncdu. Maintaining a set of separate patch files can be
a bit of a hassle, but i have found it easier to keep track of which patch
is responsible for what (and updating the PATCHFILES list, once a patch
has been committed upstream).

Sebastian

[1] https://gar.svn.sf.net/svnroot/gar/csw/mgar/pkg/socat/trunk/Makefile
[2] https://gar.svn.sf.net/svnroot/gar/csw/mgar/pkg/xterm/trunk/Makefile
[3] https://gar.svn.sf.net/svnroot/gar/csw/mgar/pkg/ncdu/trunk/Makefile




More information about the maintainers mailing list