Conversation
|
|
|
Also failing on latest unstable commit keenanweaver@2e1338b. Wonder what changed. |
|
Seems to be the bump to 3.12 of {
lib,
stdenv,
fetchFromGitHub,
fetchurl,
unzip,
SDL2,
cmake,
curl,
discord-rpc,
duktape,
expat,
flac,
fontconfig,
freetype,
gbenchmark,
icu,
innoextract,
jansson,
libGLU,
libiconv,
libogg,
libpng,
libpthreadstubs,
libvorbis,
libzip,
nlohmann_json,
openssl,
pkg-config,
speexdsp,
zlib,
withDiscordRpc ? false,
}:
let
openrct2-version = "0.4.27";
# Those versions MUST match the pinned versions within the CMakeLists.txt
# file. The REPLAYS repository from the CMakeLists.txt is not necessary.
objects-version = "1.7.3";
openmsx-version = "1.6.1";
opensfx-version = "1.0.6";
title-sequences-version = "0.4.26";
objects = fetchurl {
url = "https://github.com/OpenRCT2/objects/releases/download/v${objects-version}/objects.zip";
hash = "sha256-yBApJkV4cG7R24hmXhKnClg+cdxNPrTbJiU10vBYnqs=";
};
openmsx = fetchurl {
url = "https://github.com/OpenRCT2/OpenMusic/releases/download/v${openmsx-version}/openmusic.zip";
hash = "sha256-mUs1DTsYDuHLlhn+J/frrjoaUjKEDEvUeonzP6id4aE=";
};
opensfx = fetchurl {
url = "https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v${opensfx-version}/opensound.zip";
hash = "sha256-BrkPPhnCFnUt9EHVUbJqnj4bp3Vb3SECUEtzv5k2CL4=";
};
title-sequences = fetchurl {
url = "https://github.com/OpenRCT2/title-sequences/releases/download/v${title-sequences-version}/title-sequences.zip";
hash = "sha256-2ruXh7FXY0L8pN2fZLP4z6BKfmzpwruWEPR7dikFyFg=";
};
# Pin to a specific version of nlohmann_json
nlohmann_json_old = nlohmann_json.overrideAttrs (old: {
version = "3.11.3";
src = fetchFromGitHub {
owner = "nlohmann";
repo = "json";
rev = "v3.11.3";
hash = "sha256-7F0Jon+1oWL7uqet5i1IgHX0fUw/+z0QwEcA3zs5xHg=";
};
});
in
stdenv.mkDerivation (finalAttrs: {
pname = "openrct2";
version = openrct2-version;
src = fetchFromGitHub {
owner = "OpenRCT2";
repo = "OpenRCT2";
tag = "v${openrct2-version}";
hash = "sha256-q/urQEbiPkwktLG3hOf6qOhbjJP4SuKOcsPQNx5dsAw=";
};
nativeBuildInputs = [
cmake
pkg-config
unzip
];
buildInputs = [
SDL2
curl
duktape
expat
flac
fontconfig
freetype
gbenchmark
icu
innoextract
jansson
libGLU
libiconv
libogg
libpng
libpthreadstubs
libvorbis
libzip
nlohmann_json_old
openssl
speexdsp
zlib
]
++ lib.optional withDiscordRpc discord-rpc;
cmakeFlags = [
(lib.cmakeBool "DOWNLOAD_OBJECTS" false)
(lib.cmakeBool "DOWNLOAD_OPENMSX" false)
(lib.cmakeBool "DOWNLOAD_OPENSFX" false)
(lib.cmakeBool "DOWNLOAD_TITLE_SEQUENCES" false)
(lib.cmakeBool "DISABLE_DISCORD_RPC" (!withDiscordRpc))
];
postUnpack = ''
mkdir -p $sourceRoot/data/{object,sequence}
unzip -o ${objects} -d $sourceRoot/data/object
unzip -o ${openmsx} -d $sourceRoot/data
unzip -o ${opensfx} -d $sourceRoot/data
unzip -o ${title-sequences} -d $sourceRoot/data/sequence
'';
# Fix blank changelog & contributors screen. See https://github.com/OpenRCT2/OpenRCT2/issues/16988
postPatch = ''
substituteInPlace src/openrct2/platform/Platform.Linux.cpp \
--replace-fail "/usr/share/doc/openrct2" "$out/share/doc/openrct2"
'';
preConfigure =
# Verify that the correct version of each third party repository is used.
(
let
versionCheck = cmakeKey: version: ''
grep -q '^set(${cmakeKey}_VERSION "${version}")$' CMakeLists.txt \
|| (echo "${cmakeKey} differs from expected version!"; exit 1)
'';
in
(versionCheck "OBJECTS" objects-version)
+ (versionCheck "OPENMSX" openmsx-version)
+ (versionCheck "OPENSFX" opensfx-version)
+ (versionCheck "TITLE_SEQUENCE" title-sequences-version)
);
meta = {
description = "Open source re-implementation of RollerCoaster Tycoon 2 (original game required)";
homepage = "https://openrct2.io/";
downloadPage = "https://github.com/OpenRCT2/OpenRCT2/releases";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [
oxzi
keenanweaver
kylerisse
];
};
}) |
|
That's a bug in nlohmann_json and should be fixed in it by applying a patch to it and not locking a specific version in packages. The fix needed is also already merged Upstream nlohmann/json#4736. |
|
Thanks for pointing that out--I wouldn't have found that patch. Created an MR: #450853 |
cfc477a to
8ebf4ca
Compare
|
@ofborg build openrct2 |
|
Ofborg can't seem to build this, can we have a fix? https://logs.ofborg.org/?key=nixos/nixpkgs.448537&attempt_id=c8292590-df66-4a32-a3e1-a4a1077e9feb |
|
Missing a rebase on newer nixpkgs. |
8ebf4ca to
dbe1148
Compare
Looks like the nlohmann fix is still in staging-next. |
|
Please retarget this to staging then. |
dbe1148 to
8d81cd8
Compare
|
Sorry I meant staging-next. |
|
Superseding this PR with the new one. |
Changelog: https://github.com/OpenRCT2/OpenRCT2/releases/tag/v0.4.28
Compare: OpenRCT2/OpenRCT2@v0.4.26...v0.4.28
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.