acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / games / space-station-14-launcher / space-station-14-launcher.nix
blob9ad8c3b335f60628238a0f324112d2b17c2c7707
1 { lib
2 , buildDotnetModule
3 , dotnetCorePackages
4 , fetchFromGitHub
5 , wrapGAppsHook3
6 , iconConvTools
7 , copyDesktopItems
8 , makeDesktopItem
9 , glew
10 , SDL2
11 , glfw
12 , glibc
13 , libGL
14 , freetype
15 , openal
16 , fluidsynth
17 , gtk3
18 , pango
19 , atk
20 , cairo
21 , zlib
22 , glib
23 , gdk-pixbuf
25 let
26   version = "0.29.1";
27   pname = "space-station-14-launcher";
29 buildDotnetModule rec {
30   inherit pname version;
32   # Workaround to prevent buildDotnetModule from overriding assembly versions.
33   name = "${pname}-${version}";
35   src = fetchFromGitHub {
36     owner = "space-wizards";
37     repo = "SS14.Launcher";
38     rev = "v${version}";
39     hash = "sha256-Gajs8zINWBJ3BvAPKYan0bCRbEVscz56pyE9WOLiOqU=";
40     fetchSubmodules = true;
41   };
43   buildType = "Release";
44   selfContainedBuild = false;
46   projectFile = [
47     "SS14.Loader/SS14.Loader.csproj"
48     "SS14.Launcher/SS14.Launcher.csproj"
49   ];
51   nugetDeps = ./deps.nix;
53   passthru = {
54     inherit version; # Workaround so update script works.
55     updateScript = ./update.sh;
56   };
58   # SDK 6.0 required for Robust.LoaderApi
59   dotnet-sdk = with dotnetCorePackages; combinePackages [ sdk_8_0 sdk_6_0 ];
60   dotnet-runtime = dotnetCorePackages.runtime_8_0;
62   dotnetFlags = [
63     "-p:FullRelease=true"
64     "-p:RobustILLink=true"
65     "-nologo"
66   ];
68   nativeBuildInputs = [ wrapGAppsHook3 iconConvTools copyDesktopItems ];
70   runtimeDeps = [
71     # Required by the game.
72     glfw
73     SDL2
74     glibc
75     libGL
76     openal
77     freetype
78     fluidsynth
80     # Needed for file dialogs.
81     gtk3
82     pango
83     cairo
84     atk
85     zlib
86     glib
87     gdk-pixbuf
89     # Avalonia UI dependencies.
90     glew
91   ];
93   executables = [ "SS14.Launcher" ];
95   desktopItems = [
96     (makeDesktopItem {
97       name = pname;
98       exec = meta.mainProgram;
99       icon = pname;
100       desktopName = "Space Station 14 Launcher";
101       comment = meta.description;
102       categories = [ "Game" ];
103       startupWMClass = meta.mainProgram;
104     })
105   ];
107   postInstall = ''
108     mkdir -p $out/lib/space-station-14-launcher/loader
109     cp -r SS14.Loader/bin/${buildType}/*/*/* $out/lib/space-station-14-launcher/loader/
111     icoFileToHiColorTheme SS14.Launcher/Assets/icon.ico space-station-14-launcher $out
112   '';
114   dontWrapGApps = true;
116   preFixup = ''
117     makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
118   '';
120   meta = with lib; {
121     description = "Launcher for Space Station 14, a multiplayer game about paranoia and disaster";
122     homepage = "https://spacestation14.io";
123     license = licenses.mit;
124     maintainers = [ ];
125     platforms = [ "x86_64-linux" ];
126     mainProgram = "SS14.Launcher";
127   };