Subject: [bug#38687] [PATCH 2/2] gnu: Add libtcod.

From: Marius Bakke <[email-masked]>
Date: Mon, 10 Feb 2020 22:19:41 +0100

Giacomo Leidi <[email-masked]> writes:

> * gnu/packages/game-development.scm (libtcod): New variable.

[...]

> +         (add-before 'bootstrap 'remove-hardcoded-vendor-paths
> +           (lambda _
> +             (substitute* "sources.am"
> +                 (("\\.\\./\\.\\./src/vendor/lodepng\\.cpp \\\\\n") "")
> +                 (("\\.\\./\\.\\./src/vendor/stb\\.c \\\\")
> +                  "../../src/vendor/stb.c")
> +                 (("\\.\\./\\.\\./src/vendor/utf8proc/utf8proc\\.c") ""))
> +
> +               (substitute* "../../src/libtcod/sys_sdl_img_png.cpp"
> +                 (("\\.\\./vendor/") ""))
> +
> +               (substitute* '("../../src/libtcod/color/canvas.cpp"
> +                              "../../src/libtcod/sys_sdl_img_png.cpp"
> +                              "../../src/libtcod/tileset/truetype.cpp"
> +                              "../../src/libtcod/tileset/tilesheet.cpp")
> +                 (("\\.\\./\\.\\./vendor/") ""))
> +
> +               (substitute* "../../src/libtcod/console/printing.cpp"
> +                 (("\\.\\./\\.\\./vendor/utf8proc/") ""))
> +               #t)))))

Can you move the contents of this phase to the 'snippet' instead?  Since
they are related to the unbundling, and makes 'guix build --source
libtcod' easier to work with.

> +    (native-inputs
> +     `(("autoconf" ,autoconf)
> +       ("automake" ,automake)
> +       ("libtool" ,libtool)
> +       ("lodepng" ,lodepng)
> +       ("python" ,python)
> +       ("pkg-config" ,pkg-config)
> +       ("sdl2" ,sdl2)

sdl2 and lodepng should probably be regular inputs.

> +       ("stb-sprintf" ,stb-sprintf)
> +       ("stb-truetype" ,stb-truetype)))
> +    (inputs
> +     `(("utf8proc" ,utf8proc)
> +       ("zlib" ,zlib)))
> +    (home-page "https://github.com/libtcod/libtcod")
> +    (synopsis "Library specifically designed for writing roguelikes")
> +    (description
> +     "libtcod is a free, fast, portable and uncomplicated API for roguelike

s/free//  (everything in Guix is free software)

Otherwise LGTM!