mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-22 19:40:14 -04:00
Fix cargo dependencies issue with nix wasm-pack
This commit is contained in:
parent
6ea7762f37
commit
ba64e5a094
@ -8,6 +8,10 @@ with pkgs;
|
|||||||
let
|
let
|
||||||
pname = "kitchen-wasm";
|
pname = "kitchen-wasm";
|
||||||
src = ./../..;
|
src = ./../..;
|
||||||
|
lockFile = ./../../Cargo.lock;
|
||||||
|
# NOTE(jwall): Because we use wasm-pack directly below we need
|
||||||
|
# the cargo dependencies to already be installed.
|
||||||
|
cargoDeps = (pkgs.rustPlatform.importCargoLock { inherit lockFile; });
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
inherit src pname;
|
inherit src pname;
|
||||||
@ -17,7 +21,7 @@ stdenv.mkDerivation {
|
|||||||
propagatedBuildInputs = [ rust-wasm wasm-bindgen-cli wasm-pack binaryen];
|
propagatedBuildInputs = [ rust-wasm wasm-bindgen-cli wasm-pack binaryen];
|
||||||
phases = [ "postUnpackPhase" "buildPhase"];
|
phases = [ "postUnpackPhase" "buildPhase"];
|
||||||
postUnpackPhase = ''
|
postUnpackPhase = ''
|
||||||
ln -s ${cargoVendorDeps} ./cargo-vendor-dir
|
ln -s ${cargoDeps} ./cargo-vendor-dir
|
||||||
cp -r ./cargo-vendor-dir/.cargo ./
|
cp -r ./cargo-vendor-dir/.cargo ./
|
||||||
cp -r $src/* ./
|
cp -r $src/* ./
|
||||||
'';
|
'';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user