about summary refs log tree commit diff
path: root/nixpkgs/pkgs/games/tuxpaint/default.nix
blob: ea37ded6b6cd2b4d875cc42b7b2a5b62352e0626 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ stdenv, fetchurl, SDL, SDL_image, SDL_ttf, SDL_mixer, libpng,
  cairo, librsvg, gettext, libpaper, fribidi, pkgconfig, gperf, imagemagick }:

stdenv.mkDerivation rec {
  version = "0.9.24";
  pname = "tuxpaint";

  src = fetchurl {
    url = "mirror://sourceforge/tuxpaint/${version}/${pname}-${version}.tar.gz";
    sha256 = "06m1lg2pikfkmassfvvrbwqffwgixcmjh1li6akaldgkalpmfql7";
  };

  nativeBuildInputs = [ SDL SDL_image SDL_ttf SDL_mixer libpng cairo
    librsvg gettext libpaper fribidi pkgconfig gperf imagemagick ];
  hardeningDisable = [ "format" ];
  makeFlags = [ "GPERF=${gperf}/bin/gperf"
                "PREFIX=$$out"
                "COMPLETIONDIR=$$out/share/bash-completion/completions"
              ];

  patches = [ ./tuxpaint-completion.diff ];
  postPatch = ''
    grep -Zlr include.*SDL . | xargs -0 sed -i -e 's,"SDL,"SDL/SDL,'
  '';

  # stamps
  stamps = fetchurl {
    url = "mirror://sourceforge/project/tuxpaint/tuxpaint-stamps/2014-08-23/tuxpaint-stamps-2014.08.23.tar.gz";
    sha256 = "0rhlwrjz44wp269v3rid4p8pi0i615pzifm1ym6va64gn1bms06q";
  };

  postInstall = ''
    tar xzf $stamps
    cd tuxpaint-stamps-2014.08.23
    make install-all PREFIX=$out
    rm -rf $out/share/tuxpaint/stamps/military
  '';

  meta = {
    description = "Open Source Drawing Software for Children";
    homepage = "http://www.tuxpaint.org/";
    license = stdenv.lib.licenses.gpl3;
    maintainers = with stdenv.lib.maintainers; [ woffs ];
    platforms = stdenv.lib.platforms.linux;
  };
}