1{
2 lib,
3 stdenv,
4 fetchurl,
5 cmake,
6 qttools,
7 wrapQtAppsHook,
8 qtbase,
9 qtwayland,
10 qtsvg,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "cutemaze";
15 version = "1.3.5";
16
17 src = fetchurl {
18 url = "https://gottcode.org/cutemaze/cutemaze-${version}.tar.bz2";
19 hash = "sha256-a+QIOD0TB0AGnqIUgtkMBZuPUCQbXp4NtZ6b0vk/J0c=";
20 };
21
22 nativeBuildInputs = [
23 cmake
24 qttools
25 wrapQtAppsHook
26 ];
27
28 buildInputs = [
29 qtbase
30 qtsvg
31 ]
32 ++ lib.optionals stdenv.hostPlatform.isLinux [
33 qtwayland
34 ];
35
36 installPhase =
37 if stdenv.hostPlatform.isDarwin then
38 ''
39 runHook preInstall
40
41 mkdir -p $out/Applications
42 mv CuteMaze.app $out/Applications
43 makeWrapper $out/Applications/CuteMaze.app/Contents/MacOS/CuteMaze $out/bin/cutemaze
44
45 runHook postInstall
46 ''
47 else
48 null;
49
50 meta = with lib; {
51 changelog = "https://github.com/gottcode/cutemaze/blob/v${version}/ChangeLog";
52 description = "Simple, top-down game in which mazes are randomly generated";
53 mainProgram = "cutemaze";
54 homepage = "https://gottcode.org/cutemaze/";
55 license = licenses.gpl3Plus;
56 maintainers = with maintainers; [ dotlambda ];
57 platforms = platforms.unix;
58 };
59}