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
104 lines
2.4 KiB
Nix
104 lines
2.4 KiB
Nix
{
|
|
alsa-lib,
|
|
cargo,
|
|
dbus,
|
|
fetchFromGitHub,
|
|
gamescope,
|
|
godot_4_4,
|
|
hwdata,
|
|
lib,
|
|
libGL,
|
|
libpulseaudio,
|
|
mesa-demos,
|
|
nix-update-script,
|
|
pkg-config,
|
|
rustPlatform,
|
|
stdenv,
|
|
udev,
|
|
upower,
|
|
vulkan-loader,
|
|
xorg,
|
|
withDebug ? false,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "opengamepadui";
|
|
version = "0.42.0";
|
|
|
|
buildType = if withDebug then "debug" else "release";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ShadowBlip";
|
|
repo = "OpenGamepadUI";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-8+ZPvu4Gen7P8uKLrPXNaSqkdrUxz9K/naZxy/WoCik=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
|
inherit (finalAttrs) src cargoRoot;
|
|
hash = "sha256-xewyt1KuQ96FNYBKlC9VT7KEDDTUasavTsl+/5WXnU4=";
|
|
};
|
|
cargoRoot = "extensions";
|
|
|
|
nativeBuildInputs = [
|
|
cargo
|
|
godot_4_4
|
|
pkg-config
|
|
rustPlatform.cargoSetupHook
|
|
];
|
|
|
|
dontStrip = withDebug;
|
|
|
|
env =
|
|
let
|
|
versionAndRelease = lib.splitString "-" godot_4_4.version;
|
|
in
|
|
{
|
|
GODOT = lib.getExe godot_4_4;
|
|
GODOT_VERSION = lib.elemAt versionAndRelease 0;
|
|
GODOT_RELEASE = lib.elemAt versionAndRelease 1;
|
|
EXPORT_TEMPLATE = "${godot_4_4.export-template}/share/godot/export_templates";
|
|
BUILD_TYPE = "${finalAttrs.buildType}";
|
|
};
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
buildFlags = [ "build" ];
|
|
|
|
preBuild = ''
|
|
# Godot looks for export templates in HOME
|
|
export HOME=$(mktemp -d)
|
|
mkdir -p $HOME/.local/share/godot/
|
|
ln -s "$EXPORT_TEMPLATE" "$HOME"/.local/share/godot/
|
|
'';
|
|
|
|
postInstall =
|
|
let
|
|
runtimeDependencies = [
|
|
gamescope
|
|
hwdata
|
|
mesa-demos
|
|
udev
|
|
upower
|
|
];
|
|
in
|
|
''
|
|
# The Godot binary looks in "../lib" for gdextensions
|
|
mkdir -p $out/share/lib
|
|
mv $out/share/opengamepadui/*.so $out/share/lib
|
|
patchelf --add-rpath ${lib.makeLibraryPath runtimeDependencies} $out/share/lib/*.so
|
|
'';
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
meta = {
|
|
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";
|
|
};
|
|
})
|