1{
2 lib,
3 mkDerivation,
4 fetchFromGitHub,
5 cmake,
6 qttools,
7 wrapQtAppsHook,
8 qtbase,
9 qtsvg,
10}:
11
12mkDerivation rec {
13 pname = "tbe";
14 version = "0.9.3.1";
15
16 src = fetchFromGitHub {
17 owner = "kaa-ching";
18 repo = pname;
19 tag = "v${version}";
20 sha256 = "1ag2cp346f9bz9qy6za6q54id44d2ypvkyhvnjha14qzzapwaysj";
21 };
22
23 postPatch = ''
24 sed '1i#include <vector>' -i src/model/World.h
25
26 # fix translations not building: https://gitlab.kitware.com/cmake/cmake/-/issues/21931
27 substituteInPlace i18n/CMakeLists.txt --replace qt5_create_translation qt_add_translation
28 '';
29
30 nativeBuildInputs = [
31 cmake
32 qttools
33 wrapQtAppsHook
34 ];
35 buildInputs = [
36 qtbase
37 qtsvg
38 ];
39 strictDeps = true;
40
41 installPhase = ''
42 make DESTDIR=.. install
43 mkdir -p $out/bin
44 cp ../usr/games/tbe $out/bin
45 cp -r ../usr/share $out/
46 '';
47
48 meta = with lib; {
49 description = "Physics-based game vaguely similar to Incredible Machine";
50 mainProgram = "tbe";
51 homepage = "http://the-butterfly-effect.org/";
52 maintainers = [ maintainers.raskin ];
53 platforms = platforms.linux;
54 license = licenses.gpl2Only;
55 };
56}