Dragging Gunroar into 2014

Iain Buclaw ibuclaw at gdcproject.org
Mon Mar 24 14:16:11 PDT 2014


On 24 March 2014 18:35, Ben Boeckel <mathstuf+dlang at gmail.com> wrote:
> [ Originally posted to Reddit:
> <https://pay.reddit.com/r/d_language/comments/217fas/dragging_gunroar_into_2014/>.
> ]
>
> I got an itch recently and started to port my favorite game from ABA
> Games[1] to 2014: gunroar[1]. Currently, it has been ported to using
> Derelict3 rather than Kenta Cho's manual wrapping of SDL and OpenGL. It now
> uses SDL2 and D2 rather than the (apparently) very ancient dialect of D it
> used back in 2005.
>
> When first starting out, the first problem was getting the code to build.
> I'm a CMake guy, and after looking around, I was...unsatisfied with the D
> support files I found (for various reasons). They all seemed to copy the C++
> support files too closely which seemed unnecessary since dmd, ldc, and gdc
> are much closer to each other than many of the C++ compilers. They also all
> seem to have come from the scream make era when commands were in all caps,
> copied things around without realizing what they're there for (e.g.,
> CMakeCompilerId.d.in is copied by most of them, but used by none and
> CMakeDCompilerABI.d is useless since what CMake looks for (compiled-in
> strings) isn't in the file), and were missing support for things like
> DEPFILE and such for proper dependency resolution. In this process, two
> patches were made that should help: one for Ninja[3] if LDC is used and one
> for CMake[4] so that you get proper recompilation when files change (other
> generators are not supported yet since I don't think anything else reads the
> -deps file format of LDC; GDC will work as-is since it's GCC-compatible
> here). Even without these patches, one-off builds will be correct, but
> incremental builds are not guaranteed.
>

GDC can also output dependencies in GNU/Make format, which is useful
for incremental builds.  :-)


> After that was the fun of getting LDC to actually accept the code. Luckily
> its errors are helpful even for initiates to D (the only other time I've
> done things with D is poking the source of various ABA Games years ago also
> trying to get them to compile on Linux with mixed results). Other than
> issues with replacing the deprecated glu* function usages, (most) things
> work on my machine (Fedora x86_64). I'd be interested to know how things
> work on other platforms and setups.
>

There are about a dozen D games in Debian that all use gdc to build
then, gunroar included in that list.  Originally they were packaged on
all supported platforms Debian provides repositories for (ARM, PPC,
SPARC, MIPS, Hurd, BSD/Debian, etc).  Switching to D2 meant loosing
support because the library lacked it  (needless to say, the game
maintainers were a bit grumpy, but mostly enjoyed the banter whilst I
helped them learn D and port the to D2 at the same time. :)

Compare the arch package list at the bottom of these pages:

D1:  https://packages.debian.org/wheezy/gunroar
D2:  https://packages.debian.org/jessie/gunroar

I would like to tell them that this is going to be fixed before the
next release.

Regards
Iain


More information about the Digitalmars-d-announce mailing list