[csw-maintainers] mgar: how to maintain a patch?
skayser at opencsw.org
Thu May 14 20:51:19 CEST 2009
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 , or xterm , or ncdu  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).
More information about the maintainers