Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Mar 5, 2024
1 parent 75ff9ff commit 0803c6d
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions nix/zome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,34 @@ let
pname = crate;
doCheck = false;
};
optimizedWasm = stdenv.mkDerivation {
name = "${crate}-optimized";
buildInputs = [ wasm binaryen ];
phases = [ "buildPhase" ];
buildPhase = ''
wasm-opt --strip-debug -Oz -o $out ${wasm}/lib/${crate}.wasm
'';
};
in
if optimizeWasm then
stdenv.mkDerivation {
name = crate;
buildInputs = [ wasm binaryen ];
phases = [ "buildPhase" ];
buildPhase = ''
wasm-opt --strip-debug -Oz -o $out ${wasm}/lib/${crate}.wasm
'';
meta = {
holochainPackageType = "zome";
};
}
else
stdenv.mkDerivation {
name = crate;
buildInputs = [ wasm ];
phases = [ "buildPhase" ];
buildPhase = ''
cp ${wasm}/lib/${crate}.wasm $out
'';
meta = {
holochainPackageType = "zome";
stdenv.mkDerivation {
name = crate;
buildInputs = [ optimizedWasm ];
phases = [ "buildPhase" ];
buildPhase = ''
cp ${wasm}/lib/${crate}.wasm $out
'';
meta = {
holochainPackageType = "zome";
debug = stdenv.mkDerivation {
name = "${crate}-debug";
buildInputs = [ optimizedWasm ];
phases = [ "buildPhase" ];
buildPhase = ''
cp ${wasm}/lib/${crate}.wasm $out
'';
meta = {
holochainPackageType = "zome";
};
};
}
};
}

0 comments on commit 0803c6d

Please sign in to comment.