Rerrange directories. Set up default.nix files. Try to build the wasm code.

This commit is contained in:
Savanni D'Gerinel 2023-05-03 16:20:47 -04:00
parent d2836855e6
commit cb28fcf8c4
20 changed files with 28 additions and 4 deletions

View File

@ -42,6 +42,7 @@
pkgs.crate2nix pkgs.crate2nix
pkgs.wasm-pack pkgs.wasm-pack
pkgs.node2nix pkgs.node2nix
pkgs.wasm-bindgen-cli
pkgs-unstable.typeshare pkgs-unstable.typeshare
]; ];
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib"; LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
@ -96,11 +97,17 @@
typeshare = typeshare.packages."x86_64-linux".default; 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 kifu-pwa = let
deps = (import ./kifu/kifu-pwa/web { inherit pkgs; }).nodeDependencies; deps = (import ./kifu/kifu-pwa { inherit pkgs; }).nodeDependencies;
in pkgs.stdenv.mkDerivation { in pkgs.stdenv.mkDerivation {
name = "kifu-pwa"; name = "kifu-pwa";
src = ./kifu/kifu-pwa/web; src = ./kifu/kifu-pwa;
buildInputs = [ pkgs.nodejs pkgs.nodePackages.webpack-cli ]; buildInputs = [ pkgs.nodejs pkgs.nodePackages.webpack-cli ];
buildPhase = '' buildPhase = ''

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -497,7 +497,7 @@ rec {
crateName = "kifu-core"; crateName = "kifu-core";
version = "0.1.0"; version = "0.1.0";
edition = "2021"; edition = "2021";
src = lib.cleanSourceWith { filter = sourceFilter; src = ../../kifu-core; }; src = lib.cleanSourceWith { filter = sourceFilter; src = ../kifu-core; };
dependencies = [ dependencies = [
{ {
name = "serde"; name = "serde";

View File

@ -9,7 +9,7 @@ edition = "2021"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[dependencies] [dependencies]
kifu-core = { path = "../../kifu-core" } kifu-core = { path = "../kifu-core" }
wasm-bindgen = "0.2" wasm-bindgen = "0.2"
wasm-bindgen-futures = "*" wasm-bindgen-futures = "*"

View File

@ -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