depot/third_party/nixpkgs/pkgs/tools/games/scarab/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

89 lines
1.9 KiB
Nix

{
lib,
buildDotnetModule,
fetchFromGitHub,
glibc,
zlib,
gtk3,
copyDesktopItems,
icoutils,
wrapGAppsHook3,
makeDesktopItem,
}:
buildDotnetModule rec {
pname = "scarab";
version = "2.5.0.0";
src = fetchFromGitHub {
owner = "fifty-six";
repo = pname;
rev = "v${version}";
sha256 = "sha256-z1hmMrfeoYyjVEPPjWvUfKUKsOS7UsocSWMYrFY+/kI=";
};
nugetDeps = ./deps.nix;
projectFile = "Scarab/Scarab.csproj";
testProjectFile = "Scarab.Tests/Scarab.Tests.csproj";
executables = [ "Scarab" ];
preConfigureNuGet = ''
# This should really be in the upstream nuget.config
dotnet nuget add source https://api.nuget.org/v3/index.json \
-n nuget.org --configfile NuGet.Config
'';
runtimeDeps = [
glibc
zlib
gtk3
];
buildInputs = [
gtk3
];
nativeBuildInputs = [
copyDesktopItems
icoutils
wrapGAppsHook3
];
doCheck = true;
postFixup = ''
# Icons for the desktop file
icotool -x $src/Scarab/Assets/omegamaggotprime.ico
sizes=(256 128 64 48 32 16)
for i in ''${!sizes[@]}; do
size=''${sizes[$i]}x''${sizes[$i]}
install -D omegamaggotprime_''$((i+1))_''${size}x32.png $out/share/icons/hicolor/$size/apps/scarab.png
done
'';
desktopItems = [
(makeDesktopItem {
desktopName = "Scarab";
name = "scarab";
exec = "Scarab";
icon = "scarab";
comment = meta.description;
type = "Application";
categories = [ "Game" ];
})
];
passthru.updateScript = ./update.sh;
meta = {
description = "Hollow Knight mod installer and manager";
homepage = "https://github.com/fifty-six/Scarab";
downloadPage = "https://github.com/fifty-six/Scarab/releases";
changelog = "https://github.com/fifty-six/Scarab/releases/tag/v${version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ huantian ];
mainProgram = "Scarab";
platforms = lib.platforms.linux;
};
}