Subject: Re: [PATCH v2 1/3] gnu: python-pygame: Update to 2.1.2.

From: Liliana Marie Prikler <[email-masked]>
Date: Sat, 24 Dec 2022 06:39:50 +0100

Am Samstag, dem 24.12.2022 um 07:20 +0800 schrieb Adam Faiz:
> On 12/18/22 23:51, Adam Faiz wrote:
> > +         (add-after 'unpack 'fix-build-config
> > +           (lambda _
> > +             (substitute* "buildconfig/config_unix.py"
> > +               (("origincdirs = \\[.*\\]")
> > +                "origincdirs =
> > os.environ['C_INCLUDE_PATH'].split(\":\")")
> > +               (("ORIGLIBDIRS") "LIBRARY_PATH")
> > +               (("incdirs = \\[\\]") "incdirs = origincdirs")
> > +               (("libdirs = \\[\\]") "libdirs = origlibdirs"))))
> > +         (add-after 'unpack 'fix-sdl2-headers
> > +           (lambda _
> > +             (substitute* "buildconfig/config_unix.py"
> > +               (("SDL_ttf.h") "SDL2/SDL_ttf.h")
> > +               (("SDL_image.h") "SDL2/SDL_image.h")
> > +               (("SDL_mixer.h") "SDL2/SDL_mixer.h"))
> > +             (substitute* "src_c/imageext.c"
> > +               (("SDL_image.h") "SDL2/SDL_image.h"))
> > +             (substitute* "src_c/font.h"
> > +               (("SDL_ttf.h") "SDL2/SDL_ttf.h"))
> > +             (substitute* "src_c/mixer.h"
> > +               (("SDL_mixer.h") "SDL2/SDL_mixer.h"))
> > +             (substitute* "src_c/_sdl2/mixer.c"
> > +               (("SDL_mixer.h") "SDL2/SDL_mixer.h")))))))
> I don't see why these should go in phases, when I think going in a 
> snippet would be better. From "Snippets and Phases" in the Guix
> manual:
> 
> > The source derived from an origin should produce a source that can
> > be used to build the package on any system that the upstream
> > package supports (i.e., act as the corresponding source).  In
> > particular, origin snippets must not embed store items in the
> > sources; such patching should rather be done using build phases.
> The 'fix-build-config is what I consider to be a serious bugfix, it 
> doesn't matter that it was originally fixed as part of guix
> packaging.
That part of the manual is sadly in need of a serious overhaul (see [1]
for a more extended discussion).  In any case, patching the source so
that it finds certain headers or libraries is typically a #:phases
thing, not a snippet one.  The move to #:phases reflects that.  

Cheers

[1] https://issues.guix.gnu.org/57598