Files
nixpkgs/pkgs/development/tools/godot/export-templates-bin.nix
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

55 lines
1.3 KiB
Nix

{
fetchurl,
godot,
hash,
lib,
stdenvNoCC,
unzip,
version,
withMono ? false,
}:
# Export templates is necessary for setting up Godot engine, it's used when exporting projects.
# Godot applications/games packages needs to reference export templates.
# Export templates version should be kept in sync with Godot version.
# https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html#export-templates
let
self = stdenvNoCC.mkDerivation {
pname = "godot-export-templates${lib.optionalString withMono "-mono"}-bin";
version = version;
src = fetchurl {
url = "https://github.com/godotengine/godot/releases/download/${version}/Godot_v${version}${lib.optionalString withMono "_mono"}_export_templates.tpz";
inherit hash;
};
nativeBuildInputs = [
unzip
];
unpackPhase = ''
runHook preUnpack
unzip -q "$src"
runHook postUnpack
'';
installPhase = ''
templates="$out"/share/godot/export_templates
mkdir -p "$templates"
read version < templates/version.txt
mv templates "$templates/$version"
'';
meta = {
inherit (godot.meta)
changelog
description
homepage
license
maintainers
;
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
};
in
self