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

From: Adam Faiz <[email-masked]>
Date: Sat, 24 Dec 2022 07:20:04 +0800

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.

The 'fix-sld2-headers phase might stay in a build phase, if most systems 
that pygame supports doesn't keep these headers where guix would locate 
them. But I would consider that a bug in other systems for not storing 
the headers in the file path upstream places them.

The 'fix-sdl2-headers doesn't embed store items, so there's no other 
justification other than the reason given above.