summary refs log tree commit diff
path: root/pkgs/games/tuxtype/default.nix
blob: 6b2fb8178eac46495bce56cb7e716d13f3d52432 (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
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, librsvg, libxml2, SDL, SDL_image, SDL_mixer, SDL_net, SDL_ttf, t4kcommon }:

stdenv.mkDerivation rec {
  version = "1.8.3";
  pname = "tuxtype";

  src = fetchFromGitHub {
    owner = "tux4kids";
    repo = "tuxtype";
    rev = "upstream/${version}";
    sha256 = "1i33rhi9gpzfml4hd73s18h6p2s8zcr26va2vwf2pqqd9fhdwpsg";
  };

  postPatch = ''
    patchShebangs data/scripts/sed-linux.sh
    patchShebangs data/themes/asturian/scripts/sed-linux.sh
    patchShebangs data/themes/greek/scripts/sed-linux.sh
    patchShebangs data/themes/hungarian/scripts/sed-linux.sh

    substituteInPlace Makefile.am \
      --replace "\$(MKDIR_P) -m 2755 " "\$(MKDIR_P) -m 755 " \
      --replace "chown root:games \$(DESTDIR)\$(pkglocalstatedir)/words" " "

    # required until the following has been merged:
    # https://salsa.debian.org/tux4kids-pkg-team/tuxtype/merge_requests/1
    substituteInPlace configure.ac \
      --replace 'CFLAGS="$CFLAGS $SDL_IMAGE"' 'CFLAGS="$CFLAGS $SDL_IMAGE_CFLAGS"' \
      --replace 'PKG_CHECK_MODULES([SDL_ttf],' 'PKG_CHECK_MODULES([SDL_TTF],'
  '';

  nativeBuildInputs = [ autoreconfHook pkgconfig ];
  buildInputs = [ librsvg libxml2 SDL SDL_image SDL_mixer SDL_net SDL_ttf t4kcommon ];

  configureFlags = [ "--without-sdlpango" ];

  meta = with stdenv.lib; {
    description = "An Educational Typing Tutor Game Starring Tux, the Linux Penguin";
    homepage = https://github.com/tux4kids/tuxtype;
    license = licenses.gpl3Plus;
    maintainers = [ maintainers.aanderse ];
    platforms = platforms.linux;
  };
}