Skip to content

Commit

Permalink
fix gltfpack not found for nix build
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Dec 26, 2023
1 parent 0249988 commit 1161fcf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
pname = "vbsp-server";
preConfigure = ''
cargo_build_options="--features server $cargo_build_options"
'';
buildInputs = with pkgs; [meshoptimizer];
'';
GLTFPACK = "${pkgs.meshoptimizer}/bin/gltfpack";
});
assets = pkgs.fetchSteam {
name = "tf2-vpks";
Expand Down
4 changes: 3 additions & 1 deletion src/server/pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ pub async fn pack(map: &str, data: &[u8]) -> Result<Vec<u8>> {

input.write_all(data).await?;

let out = Command::new("gltfpack")
let pack_cmd = option_env!("GLTFPACK").unwrap_or("gltfpack");

let out = Command::new(pack_cmd)
.arg("-kn")
.arg("-mm")
.arg("-tc")
Expand Down

0 comments on commit 1161fcf

Please sign in to comment.