1{ lib, stdenv, fetchurl, SDL, SDL_mixer, SDL_image, SDL_ttf, SDL_gfx
2, pkg-config, intltool, fontconfig, libzip, zip, zlib }:
3
4let
5 version = "1.08.20121209";
6
7 freedink_data = stdenv.mkDerivation rec {
8 pname = "freedink-data";
9 inherit version;
10
11 src = fetchurl {
12 url = "mirror://gnu/freedink/${pname}-${version}.tar.gz";
13 sha256 = "1mhns09l1s898x18ahbcy9gabrmgsr8dv7pm0a2ivid8mhxahn1j";
14 };
15
16 prePatch = "substituteInPlace Makefile --replace /usr/local $out";
17 };
18
19in stdenv.mkDerivation rec {
20 pname = "freedink";
21 inherit version;
22
23 src = fetchurl {
24 url = "mirror://gnu/freedink/${pname}-${version}.tar.gz";
25 sha256 = "19xximbcm6506kvpf3s0q96697kmzca3yrjdr6dgphklp33zqsqr";
26 };
27
28 nativeBuildInputs = [ pkg-config intltool ];
29
30 buildInputs = [
31 SDL SDL_mixer SDL_image SDL_ttf SDL_gfx
32 fontconfig libzip zip zlib
33 ];
34
35 preConfigure = ''
36 # Build fails on Linux with windres.
37 export ac_cv_prog_ac_ct_WINDRES=
38 '';
39
40 postInstall = ''
41 mkdir -p "$out/share/"
42 ln -s ${freedink_data}/share/dink "$out/share/"
43 '';
44
45 enableParallelBuilding = true;
46
47 meta = {
48 description = "A free, portable and enhanced version of the Dink Smallwood game engine";
49
50 longDescription = ''
51 GNU FreeDink is a new and portable version of the Dink Smallwood
52 game engine, which runs the original game as well as its D-Mods,
53 with close compatibility, under multiple platforms.
54 '';
55
56 homepage = "https://www.gnu.org/software/freedink/"; # Formerly http://www.freedink.org
57 license = lib.licenses.gpl3Plus;
58
59 maintainers = [ ];
60 platforms = lib.platforms.all;
61 hydraPlatforms = lib.platforms.linux; # sdl-config times out on darwin
62 };
63}