forked from external-repos/squoosh
Make cross compiling work with vendoring
This commit is contained in:
4
codecs/resize/flake.lock
generated
4
codecs/resize/flake.lock
generated
@@ -118,11 +118,11 @@
|
||||
"locked": {
|
||||
"lastModified": 1,
|
||||
"narHash": "sha256-ZBQyty6638OHI5UZBk79+VY3LOAO51OexUMn4AQWS3Y=",
|
||||
"path": "/nix/store/v77iy474167bmkvc9glwhkxhi728nn88-source/nix/wasm-bindgen",
|
||||
"path": "/nix/store/qmv8wrsh9s2i7z7b5a5iak6nark83267-source/nix/wasm-bindgen",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"path": "/nix/store/v77iy474167bmkvc9glwhkxhi728nn88-source/nix/wasm-bindgen",
|
||||
"path": "/nix/store/qmv8wrsh9s2i7z7b5a5iak6nark83267-source/nix/wasm-bindgen",
|
||||
"type": "path"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,19 @@
|
||||
];
|
||||
src = ./.;
|
||||
|
||||
rustPlatform = pkgs.makeRustPlatform {
|
||||
cargo = toolchain;
|
||||
rustc = toolchain;
|
||||
};
|
||||
|
||||
cargoLockFile = "${src}/Cargo.lock";
|
||||
|
||||
vendor = rustPlatform.importCargoLock {
|
||||
lockFile = cargoLockFile;
|
||||
};
|
||||
|
||||
wasm-bindgen-bin = wasm-bindgen.lib.buildFromCargoLock {
|
||||
inherit system;
|
||||
cargoLockFile = "${src}/Cargo.lock";
|
||||
inherit system cargoLockFile;
|
||||
sha256 = "sha256-HTElSB76gqCpDu8S0ZJlfd/S4ftMrbwxFgJM9OXBRz8=";
|
||||
};
|
||||
in
|
||||
@@ -52,7 +62,11 @@
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
export CARGO_HOME=$TMPDIR/.cargo
|
||||
cargo build --target wasm32-unknown-unknown -r
|
||||
cargo build \
|
||||
--config 'source.crates-io.replace-with="vendored-sources"' \
|
||||
--config 'source.vendored-sources.directory="${vendor}"' \
|
||||
--offline \
|
||||
--target ${target} -r
|
||||
wasm-bindgen --target web --out-dir $out ./target/wasm32-unknown-unknown/release/*.wasm
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user