···
+
godot_4-export-templates,
+
stdenv.mkDerivation (finalAttrs: {
+
pname = "opengamepadui";
+
buildType = if withDebug then "debug" else "release";
+
src = fetchFromGitHub {
+
repo = "OpenGamepadUI";
+
tag = "v${finalAttrs.version}";
+
hash = "sha256-yOFxtDDYdxCtN8L8RtXgxebjRwK1Blsp/RG1E+UfUEI=";
+
cargoDeps = rustPlatform.fetchCargoVendor {
+
inherit (finalAttrs) src;
+
sourceRoot = "source/${finalAttrs.cargoRoot}";
+
hash = "sha256-sTzMewIfKHbmVhSPZgUIzFFz1ahK+PMoQ5oB4GEt8nY=";
+
cargoRoot = "extensions";
+
godot_4-export-templates
+
rustPlatform.cargoSetupHook
+
runtimeDependencies = [
+
versionAndRelease = lib.splitString "-" godot_4.version;
+
GODOT = lib.getExe godot_4;
+
GODOT_VERSION = lib.elemAt versionAndRelease 0;
+
GODOT_RELEASE = lib.elemAt versionAndRelease 1;
+
EXPORT_TEMPLATE = "${godot_4-export-templates}";
+
BUILD_TYPE = "${finalAttrs.buildType}";
+
makeFlags = [ "PREFIX=$(out)" ];
+
buildFlags = [ "build" ];
+
# Godot looks for export templates in HOME
+
export HOME=$(mktemp -d)
+
mkdir -p $HOME/.local/share/godot/export_templates
+
ln -s "${godot_4-export-templates}" "$HOME/.local/share/godot/export_templates/$GODOT_VERSION.$GODOT_RELEASE"
+
# The Godot binary looks in "../lib" for gdextensions
+
mkdir -p $out/share/lib
+
mv $out/share/opengamepadui/*.so $out/share/lib
+
passthru.updateScript = nix-update-script { };
+
description = "Open source gamepad-native game launcher and overlay";
+
homepage = "https://github.com/ShadowBlip/OpenGamepadUI";
+
license = lib.licenses.gpl3Only;
+
platforms = [ "x86_64-linux" ];
+
changelog = "https://github.com/ShadowBlip/OpenGamepadUI/releases/tag/v${finalAttrs.version}";
+
maintainers = with lib.maintainers; [ shadowapex ];
+
mainProgram = "opengamepadui";