1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
%:
dh $@
WASM_API_DIR = wasm-mappings/source-map-mappings-wasm-api
override_dh_auto_build:
# Setup vendored crates for offline build
cp -r debian/cargo-vendor $(WASM_API_DIR)/vendor
mkdir -p $(WASM_API_DIR)/.cargo
cp debian/cargo-vendor.config.toml $(WASM_API_DIR)/.cargo/config.toml
# Build WASM
cd $(WASM_API_DIR) && CARGO_NET_OFFLINE=true cargo build --release --target wasm32-unknown-unknown
wasm-strip $(WASM_API_DIR)/target/wasm32-unknown-unknown/release/source_map_mappings_wasm_api.wasm -o lib/mappings.wasm
wasm-opt -Os --enable-bulk-memory lib/mappings.wasm -o lib/mappings.wasm
override_dh_auto_clean:
rm -rf dist node_modules/.cache $(WASM_API_DIR)/vendor $(WASM_API_DIR)/.cargo $(WASM_API_DIR)/target
override_dh_installdocs:
dh_installdocs --link-doc=libjs-source-map
|