···
9
+
godot_4-export-templates,
26
+
stdenv.mkDerivation (finalAttrs: {
27
+
pname = "opengamepadui";
30
+
buildType = if withDebug then "debug" else "release";
32
+
src = fetchFromGitHub {
33
+
owner = "ShadowBlip";
34
+
repo = "OpenGamepadUI";
35
+
tag = "v${finalAttrs.version}";
36
+
hash = "sha256-yOFxtDDYdxCtN8L8RtXgxebjRwK1Blsp/RG1E+UfUEI=";
39
+
cargoDeps = rustPlatform.fetchCargoVendor {
40
+
inherit (finalAttrs) src;
41
+
sourceRoot = "source/${finalAttrs.cargoRoot}";
42
+
hash = "sha256-sTzMewIfKHbmVhSPZgUIzFFz1ahK+PMoQ5oB4GEt8nY=";
44
+
cargoRoot = "extensions";
46
+
nativeBuildInputs = [
50
+
godot_4-export-templates
52
+
rustPlatform.cargoSetupHook
55
+
runtimeDependencies = [
75
+
dontStrip = withDebug;
79
+
versionAndRelease = lib.splitString "-" godot_4.version;
82
+
GODOT = lib.getExe godot_4;
83
+
GODOT_VERSION = lib.elemAt versionAndRelease 0;
84
+
GODOT_RELEASE = lib.elemAt versionAndRelease 1;
85
+
EXPORT_TEMPLATE = "${godot_4-export-templates}";
86
+
BUILD_TYPE = "${finalAttrs.buildType}";
89
+
makeFlags = [ "PREFIX=$(out)" ];
91
+
buildFlags = [ "build" ];
94
+
# Godot looks for export templates in HOME
95
+
export HOME=$(mktemp -d)
96
+
mkdir -p $HOME/.local/share/godot/export_templates
97
+
ln -s "${godot_4-export-templates}" "$HOME/.local/share/godot/export_templates/$GODOT_VERSION.$GODOT_RELEASE"
101
+
# The Godot binary looks in "../lib" for gdextensions
102
+
mkdir -p $out/share/lib
103
+
mv $out/share/opengamepadui/*.so $out/share/lib
106
+
passthru.updateScript = nix-update-script { };
109
+
description = "Open source gamepad-native game launcher and overlay";
110
+
homepage = "https://github.com/ShadowBlip/OpenGamepadUI";
111
+
license = lib.licenses.gpl3Only;
112
+
platforms = [ "x86_64-linux" ];
113
+
changelog = "https://github.com/ShadowBlip/OpenGamepadUI/releases/tag/v${finalAttrs.version}";
114
+
maintainers = with lib.maintainers; [ shadowapex ];
115
+
mainProgram = "opengamepadui";