lol
1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 fetchpatch,
6 SDL,
7 SDL_image,
8 SDL_mixer,
9 zlib,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "meritous";
14 version = "1.5";
15
16 src = fetchFromGitLab {
17 owner = "meritous";
18 repo = "meritous";
19 rev = "refs/tags/v${finalAttrs.version}";
20 hash = "sha256-6KK2anjX+fPsYf4HSOHQ0EQBINqZiVbxo1RmBR6pslg=";
21 };
22
23 patches = [
24 # Fix stack overflow on too long files:
25 # https://gitlab.com/meritous/meritous/-/merge_requests/5
26 (fetchpatch {
27 name = "fix-overflow.patch";
28 url = "https://gitlab.com/meritous/meritous/-/commit/68029f02ccaea86fb96d6dd01edb269ac3e6eff0.patch";
29 hash = "sha256-YRV0cEcn6nEJUdHF/cheezNbsgZmjy0rSUw0tuhUYf0=";
30 })
31 ];
32
33 prePatch = ''
34 substituteInPlace Makefile \
35 --replace "prefix=/usr/local" "prefix=$out" \
36 --replace sdl-config ${lib.getDev SDL}/bin/sdl-config
37 '';
38
39 buildInputs = [
40 SDL
41 SDL_image
42 SDL_mixer
43 zlib
44 ];
45
46 installPhase = ''
47 runHook preInstall
48
49 install -m 555 -D meritous $out/bin/meritous
50 mkdir -p $out/share/meritous
51 cp -r dat/* $out/share/meritous/
52
53 runHook postInstall
54 '';
55
56 meta = with lib; {
57 description = "Action-adventure dungeon crawl game";
58 homepage = "https://gitlab.com/meritous/meritous";
59 changelog = "https://gitlab.com/meritous/meritous/-/blob/master/NEWS";
60 license = licenses.gpl3Only;
61 mainProgram = "meritous";
62 maintainers = [ maintainers.alexvorobiev ];
63 platforms = platforms.linux;
64 };
65})