Rerrange directories. Set up default.nix files. Try to build the wasm code.
This commit is contained in:
parent
d2836855e6
commit
cb28fcf8c4
11
flake.nix
11
flake.nix
|
@ -42,6 +42,7 @@
|
|||
pkgs.crate2nix
|
||||
pkgs.wasm-pack
|
||||
pkgs.node2nix
|
||||
pkgs.wasm-bindgen-cli
|
||||
pkgs-unstable.typeshare
|
||||
];
|
||||
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
|
||||
|
@ -96,11 +97,17 @@
|
|||
typeshare = typeshare.packages."x86_64-linux".default;
|
||||
};
|
||||
|
||||
kifu-wasm = import ./kifu/kifu-wasm {
|
||||
inherit pkgs;
|
||||
typeshare = typeshare.packages."x86_64-linux".default;
|
||||
wasm-pack = pkgs.wasm-pack;
|
||||
};
|
||||
|
||||
kifu-pwa = let
|
||||
deps = (import ./kifu/kifu-pwa/web { inherit pkgs; }).nodeDependencies;
|
||||
deps = (import ./kifu/kifu-pwa { inherit pkgs; }).nodeDependencies;
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
name = "kifu-pwa";
|
||||
src = ./kifu/kifu-pwa/web;
|
||||
src = ./kifu/kifu-pwa;
|
||||
|
||||
buildInputs = [ pkgs.nodejs pkgs.nodePackages.webpack-cli ];
|
||||
buildPhase = ''
|
||||
|
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
@ -497,7 +497,7 @@ rec {
|
|||
crateName = "kifu-core";
|
||||
version = "0.1.0";
|
||||
edition = "2021";
|
||||
src = lib.cleanSourceWith { filter = sourceFilter; src = ../../kifu-core; };
|
||||
src = lib.cleanSourceWith { filter = sourceFilter; src = ../kifu-core; };
|
||||
dependencies = [
|
||||
{
|
||||
name = "serde";
|
|
@ -9,7 +9,7 @@ edition = "2021"
|
|||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
kifu-core = { path = "../../kifu-core" }
|
||||
kifu-core = { path = "../kifu-core" }
|
||||
wasm-bindgen = "0.2"
|
||||
wasm-bindgen-futures = "*"
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{ pkgs, typeshare, wasm-pack }:
|
||||
let
|
||||
customBuildInfo = pkgs: pkgs.buildRustCrate.override {
|
||||
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
|
||||
kifu-wasm = attrs: {
|
||||
buildInputs = [
|
||||
typeshare
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
in (import ./Cargo.nix {
|
||||
inherit pkgs;
|
||||
buildRustCrateForPkgs = customBuildInfo;
|
||||
release = true;
|
||||
}).rootCrate.build
|
||||
|
Loading…
Reference in New Issue