mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
build(nix): use correct linker in main derivation compile
This commit is contained in:
parent
960aac307d
commit
511922baa5
@ -115,10 +115,6 @@ systems = ["x86_64-linux"]
|
||||
name = "veloren-nix"
|
||||
key = "veloren-nix.cachix.org-1:zokfKJqVsNV6kI/oJdLF6TYBdNPYGSb+diMVQPn/5Rc="
|
||||
|
||||
[workspace.metadata.nix.crateOverride.veloren-network]
|
||||
buildInputs = ["openssl"]
|
||||
nativeBuildInputs = ["pkg-config"]
|
||||
|
||||
[patch.crates-io]
|
||||
vek = { git = "https://github.com/yoanlcq/vek.git", rev = "84d5cb65841d46599a986c5477341bea4456be26" }
|
||||
# patch wgpu so we can use wgpu-profiler crate
|
||||
|
12
flake.lock
12
flake.lock
@ -90,11 +90,11 @@
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1662234098,
|
||||
"narHash": "sha256-zl52sS2Jr2lOguuC4DpLYLU+JYFzjV0xaFycwllKFAE=",
|
||||
"lastModified": 1662298979,
|
||||
"narHash": "sha256-jHAqNmTGZb9xzUXlAjZcsOGgtsswRXw+eUUjk/wGFho=",
|
||||
"owner": "yusdacra",
|
||||
"repo": "nix-cargo-integration",
|
||||
"rev": "3066def381d38288a9ecdf9a620fbb756c588ec1",
|
||||
"rev": "a415e5728613de0fe596a4bebc04483074b1c1e0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -127,11 +127,11 @@
|
||||
"rust-overlay": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1662173844,
|
||||
"narHash": "sha256-+ZgW98Y8fZkgFSylE+Mzalumw+kw3SVivZznbJqQaj8=",
|
||||
"lastModified": 1662260299,
|
||||
"narHash": "sha256-FYJk/Pn+VuSyl5Q3KXwTmOD7hprlv3CZPIRMGGT61IM=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "8ac6d40380dc4ec86f1ff591d5c14c8ae1d77a18",
|
||||
"rev": "fe73170ff8b29c4230c26b85e82c25c73c35481d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
16
flake.nix
16
flake.nix
@ -27,6 +27,7 @@
|
||||
"CHANGELOG.md"
|
||||
"CODE_OF_CONDUCT.md"
|
||||
"clippy.toml"
|
||||
".cargo"
|
||||
];
|
||||
ignorePaths = path: type: let
|
||||
split = lib.splitString "/" path;
|
||||
@ -114,19 +115,16 @@
|
||||
veloren-server-cli.wrapper = wrapWithAssets;
|
||||
};
|
||||
overrides = {
|
||||
cCompiler = common: {
|
||||
cCompiler = common.pkgs.clang;
|
||||
useCCompilerBintools = true;
|
||||
};
|
||||
cCompiler = common: common.pkgs.clang;
|
||||
crates = common: prev: let
|
||||
pkgs = common.pkgs;
|
||||
lib = pkgs.lib;
|
||||
|
||||
configMoldLinker = ''
|
||||
touch $CARGO_HOME/config.toml
|
||||
cat >>$CARGO_HOME/config.toml <<EOF
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
linker = "clang"
|
||||
rustflags = ["-C", "link-arg=-fuse-ld=${lib.getExe pkgs.mold}"]
|
||||
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
|
||||
EOF
|
||||
'';
|
||||
in {
|
||||
@ -143,6 +141,10 @@
|
||||
veloren-voxygen-deps = oldAttrs: {
|
||||
doCheck = false;
|
||||
|
||||
nativeBuildInputs =
|
||||
(oldAttrs.nativeBuildInputs or [])
|
||||
++ [pkgs.mold];
|
||||
|
||||
postConfigure = ''
|
||||
${oldAttrs.postConfigure or ""}
|
||||
${configMoldLinker}
|
||||
@ -163,7 +165,7 @@
|
||||
);
|
||||
nativeBuildInputs =
|
||||
(oldAttrs.nativeBuildInputs or [])
|
||||
++ (with pkgs; [python3]);
|
||||
++ (with pkgs; [python3 pkg-config mold]);
|
||||
|
||||
VELOREN_USERDATA_STRATEGY = "system";
|
||||
SHADERC_LIB_DIR = "${pkgs.shaderc.lib}/lib";
|
||||
|
Loading…
Reference in New Issue
Block a user