biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / games / vintagestory / default.nix
blob75df4dd045c2f7258dad8090f130343a18b9813a
1 { lib
2 , stdenv
3 , fetchurl
4 , makeWrapper
5 , makeDesktopItem
6 , copyDesktopItems
7 , xorg
8 , gtk2
9 , sqlite
10 , openal
11 , cairo
12 , libGLU
13 , SDL2
14 , freealut
15 , libglvnd
16 , pipewire
17 , libpulseaudio
18 , dotnet-runtime_7
21 stdenv.mkDerivation rec {
22   pname = "vintagestory";
23   version = "1.19.8";
25   src = fetchurl {
26     url = "https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux-x64_${version}.tar.gz";
27     hash = "sha256-R6J+ACYDQpOzJZFBizsQGOexR7lMyeoZqz9TnWxfwyM=";
28   };
31   nativeBuildInputs = [ makeWrapper copyDesktopItems ];
33   buildInputs = [ dotnet-runtime_7 ];
35   runtimeLibs = lib.makeLibraryPath ([
36     gtk2
37     sqlite
38     openal
39     cairo
40     libGLU
41     SDL2
42     freealut
43     libglvnd
44     pipewire
45     libpulseaudio
46   ] ++ (with xorg; [
47     libX11
48     libXi
49     libXcursor
50   ]));
52   desktopItems = [
53     (makeDesktopItem {
54       name = "vintagestory";
55       desktopName = "Vintage Story";
56       exec = "vintagestory";
57       icon = "vintagestory";
58       comment = "Innovate and explore in a sandbox world";
59       categories = [ "Game" ];
60     })
61   ];
63   installPhase = ''
64     runHook preInstall
66     mkdir -p $out/share/vintagestory $out/bin $out/share/pixmaps $out/share/fonts/truetype
67     cp -r * $out/share/vintagestory
68     cp $out/share/vintagestory/assets/gameicon.xpm $out/share/pixmaps/vintagestory.xpm
69     cp $out/share/vintagestory/assets/game/fonts/*.ttf $out/share/fonts/truetype
71     runHook postInstall
72   '';
74   preFixup = ''
75     makeWrapper ${dotnet-runtime_7}/bin/dotnet $out/bin/vintagestory \
76       --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
77       --add-flags $out/share/vintagestory/Vintagestory.dll
78     makeWrapper ${dotnet-runtime_7}/bin/dotnet $out/bin/vintagestory-server \
79       --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
80       --add-flags $out/share/vintagestory/VintagestoryServer.dll
81   '' + ''
82     find "$out/share/vintagestory/assets/" -not -path "*/fonts/*" -regex ".*/.*[A-Z].*" | while read -r file; do
83       local filename="$(basename -- "$file")"
84       ln -sf "$filename" "''${file%/*}"/"''${filename,,}"
85     done
86   '';
88   meta = with lib; {
89     description = "In-development indie sandbox game about innovation and exploration";
90     homepage = "https://www.vintagestory.at/";
91     license = licenses.unfree;
92     maintainers = with maintainers; [ artturin gigglesquid ];
93   };