build(nix): wrap veloren-voxygen in wrapper derivation

This commit is contained in:
Yusuf Bera Ertan 2022-09-03 07:12:18 +03:00
parent 8c4c0c2021
commit 7a2d647400
No known key found for this signature in database
GPG Key ID: 1D8F8FAF2294D6EA
2 changed files with 12 additions and 2 deletions

View File

@ -165,6 +165,15 @@
}; };
wrapWithAssets = system: old: let wrapWithAssets = system: old: let
pkgs = inputs.nci.inputs.nixpkgs.legacyPackages.${system}; pkgs = inputs.nci.inputs.nixpkgs.legacyPackages.${system};
runtimeLibs = with pkgs; [
xorg.libX11
xorg.libXcursor
xorg.libXrandr
xorg.libXi
vulkan-loader
vulkan-extension-layer
shaderc.lib
];
assets = pkgs.runCommand "veloren-assets" {} '' assets = pkgs.runCommand "veloren-assets" {} ''
mkdir $out mkdir $out
ln -sf ${./assets} $out/assets ln -sf ${./assets} $out/assets
@ -181,7 +190,9 @@
rm -rf $out/bin rm -rf $out/bin
mkdir $out/bin mkdir $out/bin
ln -sf ${old}/bin/* $out/bin/ ln -sf ${old}/bin/* $out/bin/
wrapProgram $out/bin/* --set VELOREN_ASSETS ${assets} wrapProgram $out/bin/* \
${lib.optionalString (old.pname == "veloren-voxygen") "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath runtimeLibs}"} \
--set VELOREN_ASSETS ${assets}
''; '';
in in
wrapped; wrapped;

View File

@ -18,7 +18,6 @@ It is inspired by games such as Cube World, Legend of Zelda: Breath of the Wild,
This package includes the official client, Voxygen. This package includes the official client, Voxygen.
""" """
runtimeLibs = ["libGL", "xorg.libX11", "xorg.libXcursor", "xorg.libXrandr", "xorg.libXi", "vulkan-loader", "vulkan-extension-layer", "shaderc.lib"]
[features] [features]
hot-anim = ["anim/use-dyn-lib"] hot-anim = ["anim/use-dyn-lib"]