python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / games / openrct2 / default.nix
blob04bf9d0c7f49593ae3b3d0c64487bbecedda44fd
1 { lib, stdenv, fetchFromGitHub
3 , SDL2
4 , cmake
5 , curl
6 , discord-rpc
7 , duktape
8 , flac
9 , fontconfig
10 , freetype
11 , gbenchmark
12 , icu
13 , jansson
14 , libGLU
15 , libiconv
16 , libogg
17 , libpng
18 , libpthreadstubs
19 , libvorbis
20 , libzip
21 , nlohmann_json
22 , openssl
23 , pkg-config
24 , speexdsp
25 , zlib
28 let
29   openrct2-version = "0.4.2";
31   # Those versions MUST match the pinned versions within the CMakeLists.txt
32   # file. The REPLAYS repository from the CMakeLists.txt is not necessary.
33   objects-version = "1.3.5";
34   title-sequences-version = "0.4.0";
36   openrct2-src = fetchFromGitHub {
37     owner = "OpenRCT2";
38     repo = "OpenRCT2";
39     rev = "v${openrct2-version}";
40     sha256 = "sha256-38syOFZm0eGCI1vbJxG8truX5vuafwSG0lp2o499zUs=";
41   };
43   objects-src = fetchFromGitHub {
44     owner = "OpenRCT2";
45     repo = "objects";
46     rev = "v${objects-version}";
47     sha256 = "sha256-S9fjgtb45vhRTWnYEgmIlKej5fGBtnhKOn35npmX70U=";
48   };
50   title-sequences-src = fetchFromGitHub {
51     owner = "OpenRCT2";
52     repo = "title-sequences";
53     rev = "v${title-sequences-version}";
54     sha256 = "sha256-anqCZkhYoaxPu3MYCYSsFFngOmPp2wnx2MGb0hj6W5U=";
55   };
57 stdenv.mkDerivation {
58   pname = "openrct2";
59   version = openrct2-version;
61   src = openrct2-src;
63   nativeBuildInputs = [
64     cmake
65     pkg-config
66   ];
68   buildInputs = [
69     SDL2
70     curl
71     discord-rpc
72     duktape
73     flac
74     fontconfig
75     freetype
76     gbenchmark
77     icu
78     jansson
79     libGLU
80     libiconv
81     libogg
82     libpng
83     libpthreadstubs
84     libvorbis
85     libzip
86     nlohmann_json
87     openssl
88     speexdsp
89     zlib
90   ];
92   cmakeFlags = [
93     "-DDOWNLOAD_OBJECTS=OFF"
94     "-DDOWNLOAD_TITLE_SEQUENCES=OFF"
95   ];
97   postUnpack = ''
98     cp -r ${objects-src}         $sourceRoot/data/object
99     cp -r ${title-sequences-src} $sourceRoot/data/sequence
100   '';
102   preConfigure = ''
103     # Verify that the correct version of each third party repository is used.
105     grep -q '^set(OBJECTS_VERSION "${objects-version}")$' CMakeLists.txt \
106       || (echo "OBJECTS_VERSION differs!"; exit 1)
107     grep -q '^set(TITLE_SEQUENCE_VERSION "${title-sequences-version}")$' CMakeLists.txt \
108       || (echo "TITLE_SEQUENCE_VERSION differs!"; exit 1)
109   '';
111   preFixup = "ln -s $out/share/openrct2 $out/bin/data";
113   meta = with lib; {
114     description = "Open source re-implementation of RollerCoaster Tycoon 2 (original game required)";
115     homepage = "https://openrct2.io/";
116     downloadPage = "https://github.com/OpenRCT2/OpenRCT2/releases";
117     license = licenses.gpl3Only;
118     platforms = platforms.linux;
119     maintainers = with maintainers; [ oxzi ];
120   };