python312Packages.databricks-sdk: 0.41.0 -> 0.43.0 (#380426)
[NixPkgs.git] / pkgs / by-name / ha / hawkthorne-journey / package.nix
blob9d8ee57c9306b2db6f722f7577bccc1450c29b46
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   love,
6   lua,
7   zip,
8   makeWrapper,
9   makeDesktopItem,
10   copyDesktopItems,
11   tmx2lua,
14 stdenv.mkDerivation (finalAttrs: {
15   pname = "hawkthorne-journey";
16   version = "1.1.0";
18   src = fetchFromGitHub {
19     owner = "hawkthorne";
20     repo = "hawkthorne-journey";
21     tag = "v${finalAttrs.version}";
22     hash = "sha256-RhxI2ChkFCBu2FaW2/eHT1KTTjKP++aHDktT+qQ5ooQ=";
23   };
25   nativeBuildInputs = [
26     zip
27     makeWrapper
28     copyDesktopItems
29   ];
31   buildInputs = [
32     love
33     lua
34     tmx2lua
35   ];
37   buildPhase = ''
38     runHook preBuild
40     # Convert TMX maps to Lua
41     for tmxfile in src/maps/*.tmx; do
42       tmx2lua "$tmxfile"
43     done
45     # Create the .love file
46     cd src
47     zip -X -r ../hawkthorne.love . \
48       -x ".*" \
49       -x "*.DS_Store" \
50       -x "psds/*" \
51       -x "test/*" \
52       -x "*.tmx" \
53       -x "maps/test-level.lua" \
54       -x "*/full_soundtrack.ogg" \
55       -x "*.bak"
57       runHook postBuild
58   '';
60   installPhase = ''
61     runHook preInstall
63     cd ..
64     mkdir -p $out/share/games/hawkthorne
65     cp hawkthorne.love $out/share/games/hawkthorne/
67     mkdir -p $out/bin
68     makeWrapper ${love}/bin/love $out/bin/hawkthorne \
69       --add-flags "$out/share/games/hawkthorne/hawkthorne.love"
71     runHook postInstall
72   '';
74   desktopItems = [
75     (makeDesktopItem {
76       name = "hawkthorne";
77       exec = "hawkthorne";
78       icon = "hawkthorne";
79       desktopName = "Journey to the Center of Hawkthorne";
80       genericName = "Platform Game";
81       categories = [
82         "Game"
83         "ArcadeGame"
84       ];
85     })
86   ];
88   meta = {
89     description = "Journey to the Center of Hawkthorne - Community Fan Game";
90     homepage = "https://projecthawkthorne.com";
91     changelog = "https://github.com/hawkthorne/hawkthorne-journey/releases/tag/v${finalAttrs.version}";
92     license = lib.licenses.mit;
93     maintainers = with lib.maintainers; [ liberodark ];
94     mainProgram = "hawkthorne";
95   };