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

From: Marius Bakke <[email-masked]>
Date: Wed, 22 Jan 2020 19:57:45 +0100

[email-masked] writes:

> As far as I understood (I'm no C wizard) lodepng, glad and stb are 
> libraries which are designed to be dropped inside a source tree and 
> statically built in binaries. Right now I think those are secondary 
> problems and the main deal is how to effectively replace the included 
> utf8proc.
>
> I'm not sure if replacing every "#include ../../vendor/something.h" with 
> "#include <something.h>" ( by including a .patch file or with 
> substitute* ? Food for thought :D) and then placing something.h inside a 
> path known by the C linker is enough but it's the  I'm not really sure 
> where to go from here.

Something like

(substitute* (find-files "src/libtcod" "\\.(h|cpp)$")
  (("\\.\\./\\.\\./vendor/") ""))

Would make all the header paths relative, i.e. looked up in the compiler
search path.  In practice you might need to narrow down the substitution
so that e.g. vendor/utf8proc is preserved, if it turns out to be
difficult to unbundle.

There is currently no stb-truetype package, but it should be trivial to
add it (see gnu/packages/stb.scm).  Lodepng looks fairly easy too.  :-)

Good luck!