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,48 +1,48 @@
|
|||||||
{ pkgs }:
|
{
|
||||||
let
|
lib,
|
||||||
x11Support = true;
|
stdenv,
|
||||||
waylandSupport = true;
|
fetchurl,
|
||||||
in pkgs.stdenv.mkDerivation (finalAttrs:
|
makeWrapper,
|
||||||
let
|
makeDesktopItem,
|
||||||
inherit (pkgs) lib;
|
copyDesktopItems,
|
||||||
in {
|
versionCheckHook,
|
||||||
|
cairo,
|
||||||
|
libGLU,
|
||||||
|
libglvnd,
|
||||||
|
pipewire,
|
||||||
|
libpulseaudio,
|
||||||
|
dotnet-runtime_10,
|
||||||
|
x11Support ? true,
|
||||||
|
libxi,
|
||||||
|
libxcursor,
|
||||||
|
libx11,
|
||||||
|
waylandSupport ? false,
|
||||||
|
wayland ? null,
|
||||||
|
libxkbcommon ? null,
|
||||||
|
}:
|
||||||
|
|
||||||
|
assert x11Support || waylandSupport;
|
||||||
|
assert waylandSupport -> wayland != null;
|
||||||
|
assert waylandSupport -> libxkbcommon != null;
|
||||||
|
|
||||||
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "vintagestory";
|
pname = "vintagestory";
|
||||||
version = "1.22.3";
|
version = "1.22.3";
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
src = fetchurl {
|
||||||
url = "https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux-x64_${finalAttrs.version}.tar.gz";
|
url = "https://cdn.vintagestory.at/gamefiles/stable/vs_client_linux-x64_${finalAttrs.version}.tar.gz";
|
||||||
hash = "sha256-sa4Pj1DwT6W6LJCAYznmbyqPtMUTaLSNTkXS1imQp04=";
|
hash = "sha256-sa4Pj1DwT6W6LJCAYznmbyqPtMUTaLSNTkXS1imQp04=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
__structuredAttrs = true;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
makeWrapper
|
makeWrapper
|
||||||
copyDesktopItems
|
copyDesktopItems
|
||||||
];
|
];
|
||||||
|
|
||||||
runtimeLibs = with pkgs; [
|
|
||||||
gtk2
|
|
||||||
sqlite
|
|
||||||
openal
|
|
||||||
cairo
|
|
||||||
libGLU
|
|
||||||
SDL2
|
|
||||||
freealut
|
|
||||||
libglvnd
|
|
||||||
pipewire
|
|
||||||
libpulseaudio
|
|
||||||
]
|
|
||||||
++ lib.optionals x11Support (with pkgs.xorg; [
|
|
||||||
libX11
|
|
||||||
libXi
|
|
||||||
libXcursor
|
|
||||||
])
|
|
||||||
++ lib.optionals waylandSupport (with pkgs; [
|
|
||||||
wayland
|
|
||||||
libxkbcommon
|
|
||||||
]);
|
|
||||||
|
|
||||||
desktopItems = [
|
desktopItems = [
|
||||||
(pkgs.makeDesktopItem {
|
(makeDesktopItem {
|
||||||
name = "vintagestory";
|
name = "vintagestory";
|
||||||
desktopName = "Vintage Story";
|
desktopName = "Vintage Story";
|
||||||
exec = "vintagestory";
|
exec = "vintagestory";
|
||||||
@@ -51,7 +51,7 @@ in pkgs.stdenv.mkDerivation (finalAttrs:
|
|||||||
categories = [ "Game" ];
|
categories = [ "Game" ];
|
||||||
})
|
})
|
||||||
|
|
||||||
(pkgs.makeDesktopItem {
|
(makeDesktopItem {
|
||||||
name = "vsmodinstall-handler";
|
name = "vsmodinstall-handler";
|
||||||
desktopName = "Vintage Story 1-click Mod Install Handler";
|
desktopName = "Vintage Story 1-click Mod Install Handler";
|
||||||
comment = "Handler for vintagestorymodinstall:// URI scheme";
|
comment = "Handler for vintagestorymodinstall:// URI scheme";
|
||||||
@@ -65,30 +65,37 @@ in pkgs.stdenv.mkDerivation (finalAttrs:
|
|||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p $out/share/vintagestory $out/bin $out/share/pixmaps $out/share/fonts/truetype
|
mkdir -p $out/share/vintagestory $out/bin $out/share/icons/hicolor/512x512/apps $out/share/fonts/truetype
|
||||||
cp -r * $out/share/vintagestory
|
cp -r * $out/share/vintagestory
|
||||||
cp $out/share/vintagestory/assets/gameicon.xpm $out/share/pixmaps/vintagestory.xpm
|
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
|
cp $out/share/vintagestory/assets/game/fonts/*.ttf $out/share/fonts/truetype
|
||||||
|
|
||||||
|
rm -rvf $out/share/vintagestory/{install,run,server}.sh
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preFixup =
|
makeWrapperArgs = [
|
||||||
let
|
"--set-default"
|
||||||
runtimeLibs' = lib.strings.makeLibraryPath finalAttrs.runtimeLibs;
|
"mesa_glthread"
|
||||||
in
|
"true"
|
||||||
''
|
]
|
||||||
makeWrapper ${lib.meta.getExe pkgs.dotnet-runtime_10} $out/bin/vintagestory \
|
++ lib.optionals waylandSupport [
|
||||||
--prefix LD_LIBRARY_PATH : "${runtimeLibs'}" \
|
"--set-default"
|
||||||
--set-default mesa_glthread true \
|
"OPENTK_4_USE_WAYLAND"
|
||||||
${lib.strings.optionalString waylandSupport ''
|
"1"
|
||||||
--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
|
--add-flags $out/share/vintagestory/Vintagestory.dll
|
||||||
|
|
||||||
makeWrapper ${lib.meta.getExe pkgs.dotnet-runtime_10} $out/bin/vintagestory-server \
|
makeWrapper ${lib.getExe dotnet-runtime_10} $out/bin/vintagestory-server \
|
||||||
--prefix LD_LIBRARY_PATH : "${runtimeLibs'}" \
|
"''${makeWrapperArgs[@]}" \
|
||||||
--set-default mesa_glthread true \
|
|
||||||
--add-flags $out/share/vintagestory/VintagestoryServer.dll
|
--add-flags $out/share/vintagestory/VintagestoryServer.dll
|
||||||
|
|
||||||
find "$out/share/vintagestory/assets/" -not -path "*/fonts/*" -regex ".*/.*[A-Z].*" | while read -r file; do
|
find "$out/share/vintagestory/assets/" -not -path "*/fonts/*" -regex ".*/.*[A-Z].*" | while read -r file; do
|
||||||
@@ -96,5 +103,27 @@ in pkgs.stdenv.mkDerivation (finalAttrs:
|
|||||||
ln -sf "$filename" "''${file%/*}"/"''${filename,,}"
|
ln -sf "$filename" "''${file%/*}"/"''${filename,,}"
|
||||||
done
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user