nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildDotnetModule,
4 desktop-file-utils,
5 dotnetCorePackages,
6 fetchFromGitHub,
7 makeDesktopItem,
8 makeWrapper,
9 avalonia,
10 # Runtime dependencies
11 libglvnd,
12 # passthru
13 nix-update-script,
14}:
15buildDotnetModule rec {
16 pname = "wheelwizard";
17 version = "2.3.3";
18
19 src = fetchFromGitHub {
20 owner = "TeamWheelWizard";
21 repo = "WheelWizard";
22 tag = version;
23 hash = "sha256-DuEI6bmvNP6wRuZX9Do0FGDsu80ldy0SCefBk6gqT9s=";
24 };
25 postPatch = ''
26 rm .config/dotnet-tools.json
27 '';
28
29 projectFile = "WheelWizard.sln";
30 buildType = "Release";
31 dotnet-sdk = dotnetCorePackages.sdk_8_0-bin;
32 dotnet-runtime = dotnetCorePackages.runtime_8_0-bin;
33 nugetDeps = ./deps.json;
34 mapNuGetDependencies = true;
35
36 nativeBuildInputs = [
37 makeWrapper
38 desktop-file-utils
39 ];
40
41 buildInputs = [
42 avalonia
43 ];
44
45 runtimeDeps = [
46 libglvnd
47 ];
48
49 installPhase = ''
50 runHook preInstall
51
52 mkdir -p $out/lib/wheelwizard $out/bin
53 cp -r WheelWizard/bin/Release/net8.0/* $out/lib/wheelwizard/
54
55 makeWrapper $out/lib/wheelwizard/WheelWizard $out/bin/WheelWizard \
56 --prefix PATH : ${lib.makeBinPath [ dotnet-runtime ]}
57
58 install -D $desktopItem/share/applications/* -t $out/share/applications
59
60 runHook postInstall
61 '';
62
63 postFixup = ''
64 rm $out/bin/*.{so,dylib}
65 '';
66
67 desktopItem = makeDesktopItem {
68 name = "wheelwizard";
69 exec = "WheelWizard";
70 comment = "WheelWizard, Retro Rewind Launcher";
71 desktopName = "Wheel Wizard";
72 categories = [ "Game" ];
73 };
74
75 passthru.updateScript = nix-update-script { };
76
77 meta = {
78 description = "WheelWizard, Retro Rewind Launcher";
79 homepage = "https://github.com/TeamWheelWizard/WheelWizard";
80 license = lib.licenses.gpl3;
81 platforms = lib.platforms.linux;
82 mainProgram = "WheelWizard";
83 maintainers = with lib.maintainers; [ DerHalbGrieche ];
84 };
85}