matrix-org / matrix-rust-sdk-crypto-nodejs

Apache License 2.0
3 stars 5 forks source link

allow building from source #35

Open selfisekai opened 4 months ago

selfisekai commented 4 months ago

the module currently cannot be built locally, without downloading prebuilt binaries off github.

this should be available at least as a fallback if prebuilds are not available, or with --build-from-source/npm_config_build_from_source (analogical to node-pre-gyp)

Hywan commented 4 months ago

Thanks for the suggestion. I don’t know how to do that though. Do you have an idea?

selfisekai commented 4 months ago

remove src, Cargo.toml, Cargo.lock, build.rs from .npmignore, change the npm postinstall script to something that either downloads the binary or builds it. node download-lib.js || napi build --release? (with an early exit in download-lib.js to always fail when source build wanted)