nixpkgs/pkgs/games/openloco/default.nix

58 lines
1.1 KiB
Nix
Raw Normal View History

2023-02-21 20:13:13 +00:00
{ lib
, stdenv
, fetchFromGitHub
, SDL2
, cmake
, libpng
, libzip
, openal
, pkg-config
, yaml-cpp
2024-02-10 14:56:16 +00:00
, fmt
2023-02-21 20:13:13 +00:00
}:
stdenv.mkDerivation rec {
pname = "openloco";
2024-04-12 06:28:45 +00:00
version = "24.04";
2023-02-21 20:13:13 +00:00
src = fetchFromGitHub {
owner = "OpenLoco";
repo = "OpenLoco";
rev = "v${version}";
2024-04-12 06:28:45 +00:00
hash = "sha256-LyA1Wl2xto05DUp3kuWEQo7Hbk8PAy990PC7bLeBFto=";
2023-02-21 20:13:13 +00:00
};
# the upstream build process determines the version tag from git; since we
# are not using a git checkout, we patch it manually
postPatch = ''
sed -i '/#define NAME "OpenLoco"/a#define OPENLOCO_VERSION_TAG "${version}"' src/OpenLoco/src/Version.cpp
'';
NIX_CFLAGS_COMPILE = "-Wno-error=null-dereference";
cmakeFlags = [
"-DOPENLOCO_BUILD_TESTS=NO"
];
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
SDL2
libpng
libzip
openal
yaml-cpp
2024-02-10 14:56:16 +00:00
fmt
2023-02-21 20:13:13 +00:00
];
meta = {
description = "Open source re-implementation of Chris Sawyer's Locomotion";
2023-02-21 20:13:13 +00:00
homepage = "https://github.com/OpenLoco/OpenLoco";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ icewind1991 ];
};
}