24 stdenv.mkDerivation(finalAttrs: {
28 src = fetchFromGitHub {
31 rev = "v${finalAttrs.version}";
32 hash = "sha256-D8ks+fiFJxwClqW1aNtGGa5UxAFvuH2f2guwPxOEQwI=";
36 ./darwin-cmake-no-fixup-bundle.patch
39 nativeBuildInputs = [ cmake doxygen makeWrapper ];
42 luaEnv = lua.withPackages(p: with p; [ luafilesystem lpeg luasec luasocket ]);
52 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
60 cmakeFlags = [ "-Wno-dev" ];
62 postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
63 wrapProgram $out/bin/corsix-th \
64 --set LUA_PATH "$LUA_PATH" \
65 --set LUA_CPATH "$LUA_CPATH"
66 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
67 mkdir -p $out/Applications
68 mv $out/CorsixTH.app $out/Applications
69 wrapProgram $out/Applications/CorsixTH.app/Contents/MacOS/CorsixTH \
70 --set LUA_PATH "$LUA_PATH" \
71 --set LUA_CPATH "$LUA_CPATH"
74 passthru.updateScript = nix-update-script { };
77 description = "Reimplementation of the 1997 Bullfrog business sim Theme Hospital";
78 mainProgram = "corsix-th";
79 homepage = "https://corsixth.com/";
80 license = licenses.mit;
81 maintainers = with maintainers; [ hughobrien matteopacini ];
82 platforms = platforms.linux ++ platforms.darwin;