From 28b3ce7b9261a45698d71cebb050a920bef5d49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Mon, 13 Jan 2025 12:18:56 +0100 Subject: [PATCH 1/3] Initial vintagestory --- flake.nix | 5 ++ pkgs/vintagestory/default.nix | 108 ++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 pkgs/vintagestory/default.nix diff --git a/flake.nix b/flake.nix index d51d7da..98dde30 100644 --- a/flake.nix +++ b/flake.nix @@ -20,6 +20,7 @@ default = final: prev: { awakened-poe-trade = self.packages.${prev.system}.awakened-poe-trade; path-of-building-beta = self.packages.${prev.system}.path-of-building-beta; + vintagestory-unstable = self.packages.${prev.system}.vintagestory-unstable; }; awakened-poe-trade = final: prev: { awakened-poe-trade = self.packages.${prev.system}.awakened-poe-trade; @@ -27,6 +28,9 @@ path-of-building-beta = final: prev: { awakened-poe-trade = self.packages.${prev.system}.path-of-building-beta; }; + vintagestory-unstable = final: prev: { + vintagestory-unstable = self.packages.${prev.system}.vintagestory-unstable; + }; }; packages = forAllSystems ( @@ -34,6 +38,7 @@ { awakened-poe-trade = pkgs.callPackage ./pkgs/awakened-poe-trade { }; path-of-building-beta = pkgs.qt6Packages.callPackage ./pkgs/path-of-building-beta { }; + vintagestory-unstable = pkgs.callPackage ./pkgs/vintagestory { }; } ); }; diff --git a/pkgs/vintagestory/default.nix b/pkgs/vintagestory/default.nix new file mode 100644 index 0000000..e5ea0e3 --- /dev/null +++ b/pkgs/vintagestory/default.nix @@ -0,0 +1,108 @@ +{ + lib, + stdenv, + fetchurl, + makeWrapper, + makeDesktopItem, + copyDesktopItems, + xorg, + gtk2, + sqlite, + openal, + cairo, + libGLU, + SDL2, + freealut, + libglvnd, + pipewire, + libpulseaudio, + dotnet-runtime_8, +}: + +stdenv.mkDerivation rec { + pname = "vintagestory"; + version = "1.20.0-rc.6"; + + src = fetchurl { + url = "https://cdn.vintagestory.at/gamefiles/unstable/vs_client_linux-x64_${version}.tar.gz"; + hash = "sha256-JxyQrZrAmMkUy28JUak0BHHpuGEb2fbxNrtOGVKGhOQ="; + }; + + nativeBuildInputs = [ + makeWrapper + copyDesktopItems + ]; + + buildInputs = [ dotnet-runtime_8 ]; + + runtimeLibs = lib.makeLibraryPath ( + [ + gtk2 + sqlite + openal + cairo + libGLU + SDL2 + freealut + libglvnd + pipewire + libpulseaudio + ] + ++ (with xorg; [ + libX11 + libXi + libXcursor + ]) + ); + + desktopItems = [ + (makeDesktopItem { + name = "vintagestory"; + desktopName = "Vintage Story"; + exec = "vintagestory"; + icon = "vintagestory"; + comment = "Innovate and explore in a sandbox world"; + 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 = + '' + sed -i 's/net7.0/net8.0/' $out/share/vintagestory/Vintagestory.runtimeconfig.json + sed -i 's/7.0.0/8.0.11/' $out/share/vintagestory/Vintagestory.runtimeconfig.json + + makeWrapper ${dotnet-runtime_8}/bin/dotnet $out/bin/vintagestory \ + --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ + --add-flags $out/share/vintagestory/Vintagestory.dll + makeWrapper ${dotnet-runtime_8}/bin/dotnet $out/bin/vintagestory-server \ + --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \ + --add-flags $out/share/vintagestory/VintagestoryServer.dll + '' + + '' + 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 = "In-development indie sandbox game about innovation and exploration"; + homepage = "https://www.vintagestory.at/"; + license = licenses.unfree; + maintainers = with maintainers; [ + artturin + gigglesquid + ]; + }; +} -- 2.45.2 From df32432586b56f23da42e766cb87aaa5d90adc88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Mon, 13 Jan 2025 12:24:43 +0100 Subject: [PATCH 2/3] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/cb9a96f23c491c081b38eab96d22fa958043c9fa?narHash=sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y%3D' (2024-08-04) → 'github:NixOS/nixpkgs/ed4a395ea001367c1f13d34b1e01aa10290f67d6?narHash=sha256-jG/%2BMvjVY7SlTakzZ2fJ5dC3V1PrKKrUEOEE30jrOKA%3D' (2025-01-12) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 04466fa..c5eb1b3 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1722813957, - "narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=", + "lastModified": 1736701207, + "narHash": "sha256-jG/+MvjVY7SlTakzZ2fJ5dC3V1PrKKrUEOEE30jrOKA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa", + "rev": "ed4a395ea001367c1f13d34b1e01aa10290f67d6", "type": "github" }, "original": { -- 2.45.2 From 0f585b3b60b69c91a1c91df768dbd65e4c724cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Mon, 13 Jan 2025 12:31:56 +0100 Subject: [PATCH 3/3] Bump vintagestory --- pkgs/vintagestory/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/vintagestory/default.nix b/pkgs/vintagestory/default.nix index e5ea0e3..c9c789c 100644 --- a/pkgs/vintagestory/default.nix +++ b/pkgs/vintagestory/default.nix @@ -21,11 +21,11 @@ stdenv.mkDerivation rec { pname = "vintagestory"; - version = "1.20.0-rc.6"; + version = "1.20.0-rc.8"; src = fetchurl { url = "https://cdn.vintagestory.at/gamefiles/unstable/vs_client_linux-x64_${version}.tar.gz"; - hash = "sha256-JxyQrZrAmMkUy28JUak0BHHpuGEb2fbxNrtOGVKGhOQ="; + hash = "sha256-/MPR6PAkZv93zT6YbJatg67aRYfzp9vFRY82gtVksAs="; }; nativeBuildInputs = [ -- 2.45.2