Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

97 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
love,
lua,
zip,
makeWrapper,
makeDesktopItem,
copyDesktopItems,
tmx2lua,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "hawkthorne-journey";
version = "1.1.0";
src = fetchFromGitHub {
owner = "hawkthorne";
repo = "hawkthorne-journey";
tag = "v${finalAttrs.version}";
hash = "sha256-RhxI2ChkFCBu2FaW2/eHT1KTTjKP++aHDktT+qQ5ooQ=";
};
nativeBuildInputs = [
zip
makeWrapper
copyDesktopItems
];
buildInputs = [
love
lua
tmx2lua
];
buildPhase = ''
runHook preBuild
# Convert TMX maps to Lua
for tmxfile in src/maps/*.tmx; do
tmx2lua "$tmxfile"
done
# Create the .love file
cd src
zip -X -r ../hawkthorne.love . \
-x ".*" \
-x "*.DS_Store" \
-x "psds/*" \
-x "test/*" \
-x "*.tmx" \
-x "maps/test-level.lua" \
-x "*/full_soundtrack.ogg" \
-x "*.bak"
runHook postBuild
'';
installPhase = ''
runHook preInstall
cd ..
mkdir -p $out/share/games/hawkthorne
cp hawkthorne.love $out/share/games/hawkthorne/
mkdir -p $out/bin
makeWrapper ${love}/bin/love $out/bin/hawkthorne \
--add-flags "$out/share/games/hawkthorne/hawkthorne.love"
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "hawkthorne";
exec = "hawkthorne";
icon = "hawkthorne";
desktopName = "Journey to the Center of Hawkthorne";
genericName = "Platform Game";
categories = [
"Game"
"ArcadeGame"
];
})
];
meta = {
description = "Journey to the Center of Hawkthorne - Community Fan Game";
homepage = "https://projecthawkthorne.com";
changelog = "https://github.com/hawkthorne/hawkthorne-journey/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ liberodark ];
mainProgram = "hawkthorne";
};
})