1{ lib, stdenv, fetchurl, fetchpatch, SDL_mixer, SDL, autoreconfHook }:
2
3stdenv.mkDerivation rec {
4 pname = "ri_li";
5 version = "2.0.1";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/ri-li/Ri-li-${version}.tar.bz2";
9 sha256 = "f71ccc20c37c601358d963e087ac0d524de8c68e96df09c3aac1ae65edd38dbd";
10 };
11
12 patches = [
13 ./moderinze_cpp.patch
14
15 # Build fix for gcc-11 pending upstream inclusion:
16 # https://sourceforge.net/p/ri-li/bugs/2/
17 (fetchpatch {
18 name = "gcc-11.patch";
19 url = "https://sourceforge.net/p/ri-li/bugs/2/attachment/0001-Fix-build-on-gcc-11.patch";
20 sha256 = "01il9lm3amwp3b435ka9q63p0jwlzajwnbshyazx6n9vcnrr17yw";
21 })
22 ];
23
24 CPPFLAGS = "-I${lib.getDev SDL}/include -I${lib.getDev SDL}/include/SDL -I${SDL_mixer}/include";
25
26 nativeBuildInputs = [ autoreconfHook ];
27 buildInputs = [ SDL SDL_mixer ];
28
29 meta = {
30 homepage = "https://ri-li.sourceforge.net";
31 license = lib.licenses.gpl2Plus;
32 description = "A children's train game";
33 longDescription = ''
34 Ri-li is an arcade game licensed under the GPL (General Public License).
35You drive a toy wood engine in many levels and you must collect all the coaches
36to win.
37 '';
38 maintainers = with lib.maintainers; [ jcumming ];
39 platforms = with lib.platforms; linux;
40 };
41}