mod: change package entirely
All checks were successful
Publish packages to Attic / publish (push) Successful in 10m15s
All checks were successful
Publish packages to Attic / publish (push) Successful in 10m15s
This commit is contained in:
@@ -1,100 +1,129 @@
|
|||||||
{ pkgs }:
|
{
|
||||||
let
|
lib,
|
||||||
x11Support = true;
|
stdenv,
|
||||||
waylandSupport = true;
|
fetchurl,
|
||||||
in pkgs.stdenv.mkDerivation (finalAttrs:
|
makeWrapper,
|
||||||
let
|
makeDesktopItem,
|
||||||
inherit (pkgs) lib;
|
copyDesktopItems,
|
||||||
in {
|
versionCheckHook,
|
||||||
pname = "vintagestory";
|
cairo,
|
||||||
version = "1.22.3";
|
libGLU,
|
||||||
|
libglvnd,
|
||||||
|
pipewire,
|
||||||
|
libpulseaudio,
|
||||||
|
dotnet-runtime_10,
|
||||||
|
x11Support ? true,
|
||||||
|
libxi,
|
||||||
|
libxcursor,
|
||||||
|
libx11,
|
||||||
|
waylandSupport ? false,
|
||||||
|
wayland ? null,
|
||||||
|
libxkbcommon ? null,
|
||||||
|
}:
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
assert x11Support || waylandSupport;
|
||||||
url = "https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux-x64_${finalAttrs.version}.tar.gz";
|
assert waylandSupport -> wayland != null;
|
||||||
hash = "sha256-sa4Pj1DwT6W6LJCAYznmbyqPtMUTaLSNTkXS1imQp04=";
|
assert waylandSupport -> libxkbcommon != null;
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
makeWrapper
|
pname = "vintagestory";
|
||||||
copyDesktopItems
|
version = "1.22.3";
|
||||||
];
|
|
||||||
|
|
||||||
runtimeLibs = with pkgs; [
|
src = fetchurl {
|
||||||
gtk2
|
url = "https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux-x64_${finalAttrs.version}.tar.gz";
|
||||||
sqlite
|
hash = "sha256-sa4Pj1DwT6W6LJCAYznmbyqPtMUTaLSNTkXS1imQp04=";
|
||||||
openal
|
};
|
||||||
|
|
||||||
|
__structuredAttrs = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
makeWrapper
|
||||||
|
copyDesktopItems
|
||||||
|
];
|
||||||
|
|
||||||
|
desktopItems = [
|
||||||
|
(makeDesktopItem {
|
||||||
|
name = "vintagestory";
|
||||||
|
desktopName = "Vintage Story";
|
||||||
|
exec = "vintagestory";
|
||||||
|
icon = "vintagestory";
|
||||||
|
comment = "Innovate and explore in a sandbox world";
|
||||||
|
categories = [ "Game" ];
|
||||||
|
})
|
||||||
|
|
||||||
|
(makeDesktopItem {
|
||||||
|
name = "vsmodinstall-handler";
|
||||||
|
desktopName = "Vintage Story 1-click Mod Install Handler";
|
||||||
|
comment = "Handler for vintagestorymodinstall:// URI scheme";
|
||||||
|
exec = "vintagestory -i %u";
|
||||||
|
mimeTypes = [ "x-scheme-handler/vintagestorymodinstall" ];
|
||||||
|
noDisplay = true;
|
||||||
|
terminal = false;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/share/vintagestory $out/bin $out/share/icons/hicolor/512x512/apps $out/share/fonts/truetype
|
||||||
|
cp -r * $out/share/vintagestory
|
||||||
|
install -Dm444 $out/share/vintagestory/assets/gameicon.png $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
|
||||||
|
'';
|
||||||
|
|
||||||
|
makeWrapperArgs = [
|
||||||
|
"--set-default"
|
||||||
|
"mesa_glthread"
|
||||||
|
"true"
|
||||||
|
]
|
||||||
|
++ lib.optionals waylandSupport [
|
||||||
|
"--set-default"
|
||||||
|
"OPENTK_4_USE_WAYLAND"
|
||||||
|
"1"
|
||||||
|
];
|
||||||
|
|
||||||
|
runtimeLibraryPath = lib.makeLibraryPath finalAttrs.passthru.runtimeLibs;
|
||||||
|
preFixup = ''
|
||||||
|
makeWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$runtimeLibraryPath")
|
||||||
|
|
||||||
|
makeWrapper ${lib.meta.getExe dotnet-runtime_10} $out/bin/vintagestory \
|
||||||
|
"''${makeWrapperArgs[@]}" \
|
||||||
|
--add-flags $out/share/vintagestory/Vintagestory.dll
|
||||||
|
|
||||||
|
makeWrapper ${lib.getExe dotnet-runtime_10} $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
|
cairo
|
||||||
libGLU
|
libGLU
|
||||||
SDL2
|
|
||||||
freealut
|
|
||||||
libglvnd
|
libglvnd
|
||||||
pipewire
|
pipewire
|
||||||
libpulseaudio
|
libpulseaudio
|
||||||
]
|
]
|
||||||
++ lib.optionals x11Support (with pkgs.xorg; [
|
++ lib.optionals x11Support [
|
||||||
libX11
|
libx11
|
||||||
libXi
|
libxi
|
||||||
libXcursor
|
libxcursor
|
||||||
])
|
]
|
||||||
++ lib.optionals waylandSupport (with pkgs; [
|
++ lib.optionals waylandSupport [
|
||||||
wayland
|
wayland
|
||||||
libxkbcommon
|
libxkbcommon
|
||||||
]);
|
|
||||||
|
|
||||||
desktopItems = [
|
|
||||||
(pkgs.makeDesktopItem {
|
|
||||||
name = "vintagestory";
|
|
||||||
desktopName = "Vintage Story";
|
|
||||||
exec = "vintagestory";
|
|
||||||
icon = "vintagestory";
|
|
||||||
comment = "Innovate and explore in a sandbox world";
|
|
||||||
categories = [ "Game" ];
|
|
||||||
})
|
|
||||||
|
|
||||||
(pkgs.makeDesktopItem {
|
|
||||||
name = "vsmodinstall-handler";
|
|
||||||
desktopName = "Vintage Story 1-click Mod Install Handler";
|
|
||||||
comment = "Handler for vintagestorymodinstall:// URI scheme";
|
|
||||||
exec = "vintagestory -i %u";
|
|
||||||
mimeTypes = [ "x-scheme-handler/vintagestorymodinstall" ];
|
|
||||||
noDisplay = true;
|
|
||||||
terminal = false;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
};
|
||||||
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 =
|
|
||||||
let
|
|
||||||
runtimeLibs' = lib.strings.makeLibraryPath finalAttrs.runtimeLibs;
|
|
||||||
in
|
|
||||||
''
|
|
||||||
makeWrapper ${lib.meta.getExe pkgs.dotnet-runtime_10} $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
|
|
||||||
|
|
||||||
makeWrapper ${lib.meta.getExe pkgs.dotnet-runtime_10} $out/bin/vintagestory-server \
|
|
||||||
--prefix LD_LIBRARY_PATH : "${runtimeLibs'}" \
|
|
||||||
--set-default mesa_glthread true \
|
|
||||||
--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
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user