代码拉取完成,页面将自动刷新
let
rpath = with pkgs; pkgs.lib.makeLibraryPath [ vulkan-loader ];
# Tell Nix to ignore in-tree build artifact directory 'target' when
# determining the unique source fingerprint of the repo.
src = builtins.filterSource
(path: type: type != "directory" || builtins.baseNameOf path != "target")
./.;
pkgs = import <nixpkgs> {};
sources = import ./nix/sources.nix;
naersk = pkgs.callPackage sources.naersk {};
version = "0.1.0";
basename = "magog";
in naersk.buildPackage {
inherit src;
name = "${basename}-${version}";
buildInputs = with pkgs; [
# Needed by cargo dependencies.
cmake gcc zlib pkgconfig openssl
# wgpu graphics dependencies
vulkan-loader xorg.libXcursor xorg.libXi xorg.libXrandr
makeWrapper
];
# Optimize binary size.
prePatch = ''
cat >> Cargo.toml << EOF
[profile.release]
lto = true
codegen-units = 1
panic = 'abort'
EOF
'';
# Wrap with necessary runtime libraries
postInstall = ''
if [[ -f $out/bin/${basename} ]]; then
wrapProgram $out/bin/${basename} --prefix LD_LIBRARY_PATH : "${rpath}"
fi
'';
meta = with pkgs.lib; {
description = "A fantasy roguelike game";
homepage = https://github.com/rsaarelm/magog;
license = licenses.agpl3;
platforms = platforms.all;
};
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。