vintagestory: modernize (#420002)

This commit is contained in:
Artturin
2026-04-15 23:38:19 +00:00
committed by GitHub
+54 -50
View File
@@ -5,13 +5,9 @@
makeWrapper,
makeDesktopItem,
copyDesktopItems,
gtk2,
sqlite,
openal,
versionCheckHook,
cairo,
libGLU,
SDL2,
freealut,
libglvnd,
pipewire,
libpulseaudio,
@@ -39,34 +35,14 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-LkiL/8W9MKpmJxtK+s5JvqhOza0BLap1SsaDvbLYR0c=";
};
__structuredAttrs = true;
nativeBuildInputs = [
makeWrapper
copyDesktopItems
imagemagick
];
runtimeLibs = [
gtk2
sqlite
openal
cairo
libGLU
SDL2
freealut
libglvnd
pipewire
libpulseaudio
]
++ lib.optionals x11Support [
libx11
libxi
libxcursor
]
++ lib.optionals waylandSupport [
wayland
libxkbcommon
];
desktopItems = [
(makeDesktopItem {
name = "vintagestory";
@@ -96,41 +72,69 @@ stdenv.mkDerivation (finalAttrs: {
magick $out/share/vintagestory/assets/gameicon.xpm $out/share/icons/hicolor/512x512/apps/vintagestory.png
cp $out/share/vintagestory/assets/game/fonts/*.ttf $out/share/fonts/truetype
rm -rvf $out/share/vintagestory/{install,run,server}.sh
runHook postInstall
'';
preFixup =
let
runtimeLibs' = lib.strings.makeLibraryPath finalAttrs.runtimeLibs;
in
''
makeWrapper ${lib.meta.getExe dotnet-runtime_8} $out/bin/vintagestory \
--prefix LD_LIBRARY_PATH : "${runtimeLibs'}" \
--set-default mesa_glthread true \
${lib.strings.optionalString waylandSupport ''
--set-default OPENTK_4_USE_WAYLAND 1 \
''} \
--add-flags $out/share/vintagestory/Vintagestory.dll
makeWrapperArgs = [
"--set-default"
"mesa_glthread"
"true"
]
++ lib.optionals waylandSupport [
"--set-default"
"OPENTK_4_USE_WAYLAND"
"1"
];
makeWrapper ${lib.meta.getExe dotnet-runtime_8} $out/bin/vintagestory-server \
--prefix LD_LIBRARY_PATH : "${runtimeLibs'}" \
--set-default mesa_glthread true \
--add-flags $out/share/vintagestory/VintagestoryServer.dll
runtimeLibraryPath = lib.makeLibraryPath finalAttrs.passthru.runtimeLibs;
preFixup = ''
makeWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$runtimeLibraryPath")
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
'';
makeWrapper ${lib.meta.getExe dotnet-runtime_8} $out/bin/vintagestory \
"''${makeWrapperArgs[@]}" \
--add-flags $out/share/vintagestory/Vintagestory.dll
passthru.updateScript = ./update.sh;
makeWrapper ${lib.getExe dotnet-runtime_8} $out/bin/vintagestory-server \
"''${makeWrapperArgs[@]}" \
--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
'';
doInstallCheck = true;
installCheckInputs = [ versionCheckHook ];
passthru = {
updateScript = ./update.sh;
runtimeLibs = [
cairo
libGLU
libglvnd
pipewire
libpulseaudio
]
++ lib.optionals x11Support [
libx11
libxi
libxcursor
]
++ lib.optionals waylandSupport [
wayland
libxkbcommon
];
};
meta = {
description = "In-development indie sandbox game about innovation and exploration";
homepage = "https://www.vintagestory.at/";
license = lib.licenses.unfree;
sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
platforms = lib.platforms.linux;
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [
artturin
gigglesquid