about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2021-08-23 21:33:34 +0300
committerArtturin <Artturin@artturin.com>2021-08-27 23:13:13 +0300
commit176705c2953c17d6f7c703745d926c053e59e9f1 (patch)
tree879501fe06041a4a279bc68532f083657e9d78f2 /pkgs/games
parentbcbb07c01b491ab0affa9c5c08e652cb55d397af (diff)
downloadnixlib-176705c2953c17d6f7c703745d926c053e59e9f1.tar
nixlib-176705c2953c17d6f7c703745d926c053e59e9f1.tar.gz
nixlib-176705c2953c17d6f7c703745d926c053e59e9f1.tar.bz2
nixlib-176705c2953c17d6f7c703745d926c053e59e9f1.tar.lz
nixlib-176705c2953c17d6f7c703745d926c053e59e9f1.tar.xz
nixlib-176705c2953c17d6f7c703745d926c053e59e9f1.tar.zst
nixlib-176705c2953c17d6f7c703745d926c053e59e9f1.zip
vintagestory: init at 1.15.5
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/vintagestory/default.nix85
1 files changed, 85 insertions, 0 deletions
diff --git a/pkgs/games/vintagestory/default.nix b/pkgs/games/vintagestory/default.nix
new file mode 100644
index 000000000000..721b8c921d24
--- /dev/null
+++ b/pkgs/games/vintagestory/default.nix
@@ -0,0 +1,85 @@
+{ lib
+, stdenv
+, fetchurl
+, makeWrapper
+, makeDesktopItem
+, copyDesktopItems
+, mono
+, xorg
+, gtk2
+, sqlite
+, openal
+, cairo
+, libGLU
+, SDL2
+, freealut
+}:
+
+stdenv.mkDerivation rec {
+  pname = "vintagestory";
+  version = "1.15.5";
+
+  src = fetchurl {
+    url = "https://cdn.vintagestory.at/gamefiles/stable/vs_archive_${version}.tar.gz";
+    sha256 = "sha256-38vLkH8B1yYC1I8P8uCsbC8CK8Btpfm9tNxgiuswsa8=";
+  };
+
+  nativeBuildInputs = [ makeWrapper copyDesktopItems ];
+
+  buildInputs = [ mono ];
+
+  runtimeLibs = lib.makeLibraryPath ([
+    gtk2
+    sqlite
+    openal
+    cairo
+    libGLU
+    SDL2
+    freealut
+  ] ++ (with xorg; [
+    libX11
+    libXi
+  ]));
+
+  desktopItems = makeDesktopItem {
+    name = "vintagestory";
+    desktopName = "Vintage Story";
+    exec = "vintagestory";
+    icon = "vintagestory";
+    comment = "Innovate and explore in a sandbox world";
+    type = "Application";
+    categories = "Game;";
+  };
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/vintagestory $out/bin $out/share/pixmaps $out/share/fonts/truetype
+    cp -r * $out/share/vintagestory
+    cp $out/share/vintagestory/assets/gameicon.xpm $out/share/pixmaps/vintagestory.xpm
+    cp $out/share/vintagestory/assets/game/fonts/*.ttf $out/share/fonts/truetype
+
+    runHook postInstall
+  '';
+
+  preFixup = ''
+    makeWrapper ${mono}/bin/mono $out/bin/vintagestory \
+      --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
+      --add-flags $out/share/vintagestory/Vintagestory.exe
+    makeWrapper ${mono}/bin/mono $out/bin/vintagestory-server \
+      --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
+      --add-flags $out/share/vintagestory/VintagestoryServer.exe
+
+    find "$out/share/vintagestory/assets/" -not -path "*/fonts/*" -regex ".*/.*[A-Z].*" | while read -r file; do
+      local filename="$(basename -- "$file")"
+      ln -sf "$filename" "''${file%/*}"/"''${filename,,}"
+    done
+  '';
+
+  meta = with lib; {
+    description = "An in-development indie sandbox game about innovation and exploration";
+    homepage = "https://www.vintagestory.at/";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ artturin ];
+  };
+}