Trying to do a wasm-bindgen build

This commit is contained in:
Surma
2024-08-08 00:28:21 +01:00
parent 13cbf8ddb1
commit 9bbfac62e8
3 changed files with 18 additions and 14 deletions

View File

@@ -34,12 +34,26 @@
{
packages = rec {
default = resize-squoosh;
resize-squoosh = naersk'.buildPackage {
resize-squoosh = stdenv.mkDerivation {
name = "squoosh-resize";
src = ./.;
release = true;
copyLibs = true;
CARGO_BUILD_TARGET = target;
nativeBuildInputs = [
#naersk'
toolchain
# wasm-pack
wasm-bindgen-cli
];
dontConfigure = true;
buildPhase = ''
export CARGO_HOME=$TMPDIR/.cargo
cargo build --target wasm32-unknown-unknown -r
wasm-bindgen --target web --out-dir $out ./target/wasm32-unknown-unknown/release/*.wasm
'';
dontInstall = true;
# installPhase = ''
# mkdir -p $out
# cp -r pkg/* $out
# '';
};
installScript = writeShellScriptBin "install.sh" ''

View File

@@ -1,4 +0,0 @@
{
"name": "resize",
"lockfileVersion": 1
}

View File

@@ -1,6 +0,0 @@
{
"name": "resize",
"scripts": {
"build": "../build-rust.sh"
}
}