1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00
nixpkgs/pkgs/games/corsix-th/default.nix

79 lines
1.7 KiB
Nix
Raw Normal View History

2023-07-03 03:12:33 +01:00
{ stdenv
, lib
, fetchFromGitHub
, cmake
, doxygen
, ffmpeg
, freetype
, lua
, makeWrapper
, SDL2
, SDL2_mixer
, timidity
# Darwin dependencies
, libiconv
, Cocoa
, CoreVideo
# Update
, nix-update-script
2023-07-03 03:12:33 +01:00
}:
stdenv.mkDerivation(finalAttrs: {
2023-07-03 03:12:33 +01:00
pname = "corsix-th";
2023-08-22 06:30:56 +01:00
version = "0.67";
2023-07-03 03:12:33 +01:00
src = fetchFromGitHub {
owner = "CorsixTH";
repo = "CorsixTH";
rev = "v${finalAttrs.version}";
2023-08-22 06:30:56 +01:00
hash = "sha256-WA/VJqHXzBfVUBNtxCVsGBRzSRQ0pvDvAy03ntc0KZE=";
2023-07-03 03:12:33 +01:00
};
patches = [
./darwin-cmake-no-fixup-bundle.patch
];
2023-07-03 03:12:33 +01:00
nativeBuildInputs = [ cmake doxygen makeWrapper ];
buildInputs = let
luaEnv = lua.withPackages(p: with p; [ luafilesystem lpeg luasec luasocket ]);
in [
ffmpeg
freetype
lua
luaEnv
SDL2
SDL2_mixer
timidity
] ++ lib.optionals stdenv.isDarwin [
libiconv
Cocoa
CoreVideo
];
2023-07-03 03:12:33 +01:00
cmakeFlags = [ "-Wno-dev" ];
postInstall = lib.optionalString stdenv.isLinux ''
2023-07-03 03:12:33 +01:00
wrapProgram $out/bin/corsix-th \
--set LUA_PATH "$LUA_PATH" \
--set LUA_CPATH "$LUA_CPATH"
'' + lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications
mv $out/CorsixTH.app $out/Applications
wrapProgram $out/Applications/CorsixTH.app/Contents/MacOS/CorsixTH \
--set LUA_PATH "$LUA_PATH" \
--set LUA_CPATH "$LUA_CPATH"
2023-07-03 03:12:33 +01:00
'';
passthru.updateScript = nix-update-script { };
2023-07-03 03:12:33 +01:00
meta = with lib; {
description = "Reimplementation of the 1997 Bullfrog business sim Theme Hospital";
mainProgram = "corsix-th";
2023-07-03 03:12:33 +01:00
homepage = "https://corsixth.com/";
license = licenses.mit;
maintainers = with maintainers; [ hughobrien matteopacini ];
platforms = platforms.linux ++ platforms.darwin;
2023-07-03 03:12:33 +01:00
};
})