mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
build(nix): fix recompilation issues and improve build overhead
This commit is contained in:
parent
511922baa5
commit
cdfb2ae040
18
flake.lock
18
flake.lock
@ -69,11 +69,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1662176993,
|
||||
"narHash": "sha256-Sy7DsGAveDUFBb6YDsUSYZd/AcXfP/MOMIwMt/NgY84=",
|
||||
"lastModified": 1662507674,
|
||||
"narHash": "sha256-vnXfje4pfTqDEqI837GCT+hNKqzfVwPen++gnLVO9F0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "dream2nix",
|
||||
"rev": "809bc5940214744eb29778a9a0b03f161979c1b2",
|
||||
"rev": "5ba9061857e3e265538c9785bb56bda2bb8f9bca",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -90,11 +90,11 @@
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1662298979,
|
||||
"narHash": "sha256-jHAqNmTGZb9xzUXlAjZcsOGgtsswRXw+eUUjk/wGFho=",
|
||||
"lastModified": 1662507702,
|
||||
"narHash": "sha256-Q8zfpLNCJublP7t4oHizr5tgsCS4BHFk7Fc7wzWbrzE=",
|
||||
"owner": "yusdacra",
|
||||
"repo": "nix-cargo-integration",
|
||||
"rev": "a415e5728613de0fe596a4bebc04483074b1c1e0",
|
||||
"rev": "97aa58c683ccf628175118052b3306f40ac21ca0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -127,11 +127,11 @@
|
||||
"rust-overlay": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1662260299,
|
||||
"narHash": "sha256-FYJk/Pn+VuSyl5Q3KXwTmOD7hprlv3CZPIRMGGT61IM=",
|
||||
"lastModified": 1662433378,
|
||||
"narHash": "sha256-DqMtTtIownl+UIPG1O917IH10UF0Hwql636p22vOJfw=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "fe73170ff8b29c4230c26b85e82c25c73c35481d",
|
||||
"rev": "12aa8ea4381b28b7a3118f96682dc3ffb13fb6b6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
66
flake.nix
66
flake.nix
@ -5,6 +5,7 @@
|
||||
|
||||
outputs = inputs: let
|
||||
lib = inputs.nci.inputs.nixpkgs.lib;
|
||||
ncl = inputs.nci.lib.nci-lib;
|
||||
|
||||
git = let
|
||||
sourceInfo = inputs.self.sourceInfo;
|
||||
@ -114,6 +115,7 @@
|
||||
};
|
||||
veloren-server-cli.wrapper = wrapWithAssets;
|
||||
};
|
||||
disableVendoredCrateOverrides = true;
|
||||
overrides = {
|
||||
cCompiler = common: common.pkgs.clang;
|
||||
crates = common: prev: let
|
||||
@ -127,7 +129,7 @@
|
||||
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
|
||||
EOF
|
||||
'';
|
||||
in {
|
||||
in rec {
|
||||
veloren-common = oldAttrs: {
|
||||
# Disable `git-lfs` check here since we check it ourselves
|
||||
# We have to include the command output here, otherwise Nix won't run it
|
||||
@ -139,23 +141,7 @@
|
||||
NIX_GIT_TAG = "";
|
||||
};
|
||||
veloren-voxygen-deps = oldAttrs: {
|
||||
doCheck = false;
|
||||
|
||||
nativeBuildInputs =
|
||||
(oldAttrs.nativeBuildInputs or [])
|
||||
++ [pkgs.mold];
|
||||
|
||||
postConfigure = ''
|
||||
${oldAttrs.postConfigure or ""}
|
||||
${configMoldLinker}
|
||||
'';
|
||||
};
|
||||
veloren-voxygen = oldAttrs: {
|
||||
src = filteredSource;
|
||||
|
||||
buildInputs =
|
||||
(oldAttrs.buildInputs or [])
|
||||
++ (
|
||||
buildInputs = ncl.addBuildInputs prev (
|
||||
with pkgs; [
|
||||
alsa-lib
|
||||
libxkbcommon
|
||||
@ -164,15 +150,27 @@
|
||||
]
|
||||
);
|
||||
nativeBuildInputs =
|
||||
(oldAttrs.nativeBuildInputs or [])
|
||||
++ (with pkgs; [python3 pkg-config mold]);
|
||||
ncl.addNativeBuildInputs prev (with pkgs; [python3 pkg-config mold]);
|
||||
|
||||
VELOREN_USERDATA_STRATEGY = "system";
|
||||
SHADERC_LIB_DIR = "${pkgs.shaderc.lib}/lib";
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
doCheck = false;
|
||||
|
||||
postConfigure = ''
|
||||
${oldAttrs.postConfigure or ""}
|
||||
${configMoldLinker}
|
||||
'';
|
||||
};
|
||||
veloren-voxygen = prev:
|
||||
ncl.computeOverridesResult prev [
|
||||
veloren-voxygen-deps
|
||||
(oldAttrs: {
|
||||
src = filteredSource;
|
||||
|
||||
VELOREN_USERDATA_STRATEGY = "system";
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
|
||||
preConfigure = ''
|
||||
${oldAttrs.preConfigure or ""}
|
||||
substituteInPlace voxygen/src/audio/soundcache.rs \
|
||||
@ -180,12 +178,11 @@
|
||||
"../../../assets/voxygen/audio/null.ogg" \
|
||||
"${./assets/voxygen/audio/null.ogg}"
|
||||
'';
|
||||
postConfigure = ''
|
||||
${oldAttrs.postConfigure or ""}
|
||||
${configMoldLinker}
|
||||
'';
|
||||
};
|
||||
})
|
||||
];
|
||||
veloren-server-cli-deps = oldAttrs: {
|
||||
nativeBuildInputs = ncl.addNativeBuildInputs prev [pkgs.mold];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
postConfigure = ''
|
||||
@ -193,18 +190,15 @@
|
||||
${configMoldLinker}
|
||||
'';
|
||||
};
|
||||
veloren-server-cli = oldAttrs: {
|
||||
veloren-server-cli = prev:
|
||||
ncl.computeOverridesResult prev [
|
||||
veloren-server-cli-deps
|
||||
(oldAttrs: {
|
||||
src = filteredSource;
|
||||
|
||||
VELOREN_USERDATA_STRATEGY = "system";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
postConfigure = ''
|
||||
${oldAttrs.postConfigure or ""}
|
||||
${configMoldLinker}
|
||||
'';
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user