33 openrct2-version = "0.4.11";
35 # Those versions MUST match the pinned versions within the CMakeLists.txt
36 # file. The REPLAYS repository from the CMakeLists.txt is not necessary.
37 objects-version = "1.4.4";
38 openmsx-version = "1.5";
39 opensfx-version = "1.0.5";
40 title-sequences-version = "0.4.6";
42 openrct2-src = fetchFromGitHub {
45 rev = "v${openrct2-version}";
46 hash = "sha256-zaaVieU/hulc2G/F19diJug3xuj3ejn5ihnmKfkBDcQ=";
49 objects-src = fetchFromGitHub {
52 rev = "v${objects-version}";
53 hash = "sha256-wKxWp/DSKkxCEI0lp4X8F9LxQsUKZfLk2CgajQ+y84k=";
56 openmsx-src = fetchFromGitHub {
59 rev = "v${openmsx-version}";
60 hash = "sha256-p/wlvQFfu3R+jIuCcRbTMvxt0VKGGwJw0NDIsf6URWI=";
63 opensfx-src = fetchFromGitHub {
65 repo = "OpenSoundEffects";
66 rev = "v${opensfx-version}";
67 hash = "sha256-ucADnMLGm36eAo+NiioxEzeMqtu7YbGF9wsydK1mmoE=";
70 title-sequences-src = fetchFromGitHub {
72 repo = "title-sequences";
73 rev = "v${title-sequences-version}";
74 hash = "sha256-HWp2ecClNM/7O3oaydVipOnEsYNP/bZnZFS+SDidPi0=";
79 version = openrct2-version;
84 # https://github.com/OpenRCT2/OpenRCT2/pull/21043
86 # Basically <https://github.com/OpenRCT2/OpenRCT2/pull/19785> has broken
87 # OpenRCT2 - at least with older maps, as were used for testing - as stated
88 # in <https://github.com/NixOS/nixpkgs/issues/263025>.
90 name = "remove-openrct2-music.patch";
91 url = "https://github.com/OpenRCT2/OpenRCT2/commit/9ea13848be0b974336c34e6eb119c49ba42a907c.patch";
92 hash = "sha256-2PPRqUZf4+ys89mdzp5nvdtdv00V9Vzj3v/95rmlf1c=";
127 "-DDOWNLOAD_OBJECTS=OFF"
128 "-DDOWNLOAD_OPENMSX=OFF"
129 "-DDOWNLOAD_OPENSFX=OFF"
130 "-DDOWNLOAD_TITLE_SEQUENCES=OFF"
133 env.NIX_CFLAGS_COMPILE = toString [
135 "-Wno-error=maybe-uninitialized"
139 mkdir -p $sourceRoot/data/assetpack
141 cp -r ${objects-src} $sourceRoot/data/object
142 cp -r ${openmsx-src} $sourceRoot/data/assetpack/openrct2.music.alternative.parkap
143 cp -r ${opensfx-src} $sourceRoot/data/assetpack/openrct2.sound.parkap
144 cp -r ${title-sequences-src} $sourceRoot/data/sequence
148 # Verify that the correct version of each third party repository is used.
150 versionCheck = cmakeKey: version: ''
151 grep -q '^set(${cmakeKey}_VERSION "${version}")$' CMakeLists.txt \
152 || (echo "${cmakeKey} differs from expected version!"; exit 1)
155 (versionCheck "OBJECTS" objects-version) +
156 (versionCheck "OPENMSX" openmsx-version) +
157 (versionCheck "OPENSFX" opensfx-version) +
158 (versionCheck "TITLE_SEQUENCE" title-sequences-version));
160 preFixup = "ln -s $out/share/openrct2 $out/bin/data";
163 description = "Open source re-implementation of RollerCoaster Tycoon 2 (original game required)";
164 homepage = "https://openrct2.io/";
165 downloadPage = "https://github.com/OpenRCT2/OpenRCT2/releases";
166 license = licenses.gpl3Only;
167 platforms = platforms.linux;
168 maintainers = with maintainers; [ oxzi ];