mirror of
https://github.com/zaphar/kitchen.git
synced 2025-07-23 19:49:58 -04:00
23 lines
670 B
Nix
23 lines
670 B
Nix
{pkgs ? (import <nixpkgs>) {},
|
|
# Because it's a workspace we need the other crates available as source
|
|
root,
|
|
kitchenWasm,
|
|
version,
|
|
naersk-lib,
|
|
rust-wasm,
|
|
}:
|
|
with pkgs;
|
|
(naersk-lib.buildPackage rec {
|
|
pname = "kitchen";
|
|
inherit version;
|
|
buildInputs = [ rust-wasm ];
|
|
# However the crate we are building has it's root in specific crate.
|
|
src = root;
|
|
nativeBuildInputs = (if stdenv.isDarwin then [ xcbuild pkgs.darwin.apple_sdk.frameworks.Security ] else [ ]) ++ [llvm clang];
|
|
cargoBuildOptions = opts: opts ++ ["-p" "${pname}" ];
|
|
postPatch = ''
|
|
mkdir -p web/dist
|
|
cp -r ${kitchenWasm}/* web/dist/
|
|
ls web/dist/
|
|
'';
|
|
}) |