openloco: 24.04 -> 25.02

This commit is contained in:
Stefan Frijters 2025-03-06 12:09:54 +01:00
parent dc21113474
commit 5aec1f3f7b
No known key found for this signature in database
GPG Key ID: 7619A6BC6E7DFA6F

View File

@ -2,6 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
fetchurl,
SDL2,
cmake,
libpng,
@ -11,22 +12,42 @@
yaml-cpp,
fmt,
}:
let
sfl-src = fetchFromGitHub {
owner = "slavenf";
repo = "sfl-library";
tag = "1.9.0";
hash = "sha256-Udry/Y753l274PU6RvpPgkIr85wSCnz3mLQ0xzerUAc=";
};
openloco-objects = fetchurl {
url = "https://github.com/OpenLoco/OpenGraphics/releases/download/v0.1.1/objects.zip";
sha256 = "e75ad13a8e8d58458e0c54e5ce62902a073d7bb025ef8fb97cb56108ff7c57c3";
};
in
stdenv.mkDerivation rec {
pname = "openloco";
version = "24.04";
version = "25.02";
src = fetchFromGitHub {
owner = "OpenLoco";
repo = "OpenLoco";
rev = "v${version}";
hash = "sha256-LyA1Wl2xto05DUp3kuWEQo7Hbk8PAy990PC7bLeBFto=";
tag = "v${version}";
hash = "sha256-RsiEYBNx+Lf7OyyyCShQmgtwBuxDrZkRCYCbMmZ8ZMM=";
};
# the upstream build process determines the version tag from git; since we
# are not using a git checkout, we patch it manually
postPatch = ''
# the upstream build process determines the version tag from git; since we
# are not using a git checkout, we patch it manually
sed -i '/#define NAME "OpenLoco"/a#define OPENLOCO_VERSION_TAG "${version}"' src/OpenLoco/src/Version.cpp
# prefetch sfl header sources
grep -q 'GIT_TAG \+${sfl-src.tag}' thirdparty/CMakeLists.txt
sed -i 's#GIT_REPOSITORY \+https://github.com/slavenf/sfl-library#SOURCE_DIR ${sfl-src}#' thirdparty/CMakeLists.txt
# prefetch openloco-objects
sed -i 's#URL \+${openloco-objects.url}#URL ${openloco-objects}#' CMakeLists.txt
'';
NIX_CFLAGS_COMPILE = "-Wno-error=null-dereference";
@ -39,6 +60,7 @@ stdenv.mkDerivation rec {
cmake
pkg-config
];
buildInputs = [
SDL2
libpng