Mangle the rules file, trying to get WASM build
This commit is contained in:
37
debian/rules
vendored
37
debian/rules
vendored
@@ -1,18 +1,27 @@
|
|||||||
#!/usr/bin/make -f
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
DH_VERBOSE = 1
|
||||||
DPKG_EXPORT_BUILDFLAGS = 1
|
|
||||||
include /usr/share/dpkg/default.mk
|
# export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||||
include /usr/share/rustc/architecture.mk
|
# DPKG_EXPORT_BUILDFLAGS = 1
|
||||||
export DEB_HOST_RUST_TYPE
|
|
||||||
export PATH:=/usr/share/cargo/bin:$(PATH)
|
# Remove because they're for normal builds, not "cross" builds, or what ever
|
||||||
export CARGO=/usr/share/cargo/bin/cargo
|
# WASM is considered to be. Sort-of a cross-compile, but it isn't self hosting,
|
||||||
|
# so I'm not sure what to call it.
|
||||||
|
# include /usr/share/dpkg/default.mk
|
||||||
|
# include /usr/share/rustc/architecture.mk
|
||||||
|
|
||||||
|
# finds package info and puts it in vars like DEB_VERSION_UPSTREAM
|
||||||
|
include /usr/share/dpkg/pkg-info.mk
|
||||||
|
export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
|
||||||
|
CARGO=/usr/share/cargo/bin/cargo
|
||||||
export CARGO_HOME=$(CURDIR)/debian/cargo_home
|
export CARGO_HOME=$(CURDIR)/debian/cargo_home
|
||||||
export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
|
CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry
|
||||||
export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
|
export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
|
||||||
|
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
|
||||||
|
|
||||||
%:
|
%:
|
||||||
dh $@ --buildsystem=cargo
|
dh $@
|
||||||
|
|
||||||
execute_after_dh_auto_clean:
|
execute_after_dh_auto_clean:
|
||||||
$(CARGO) clean
|
$(CARGO) clean
|
||||||
@@ -20,8 +29,14 @@ execute_after_dh_auto_clean:
|
|||||||
rm -rf $(CARGO_REGISTRY)
|
rm -rf $(CARGO_REGISTRY)
|
||||||
rm -f debian/cargo-checksum.json
|
rm -f debian/cargo-checksum.json
|
||||||
|
|
||||||
execute_before_dh_auto_configure:
|
override_dh_auto_configure:
|
||||||
$(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system
|
$(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system
|
||||||
rm -f Cargo.lock
|
|
||||||
touch debian/cargo-checksum.json
|
touch debian/cargo-checksum.json
|
||||||
|
# patch cargo_home config to use lld with wasm, otherwise the build fails
|
||||||
|
echo "\n[target.wasm32-unknown-unknown]" >> debian/cargo_home/config.toml
|
||||||
|
cat debian/cargo_home/config.toml | sed "s/linker=[^']\+/linker=rust-lld/" | grep "^rustflags = " >> debian/cargo_home/config.toml
|
||||||
|
dh_auto_configure
|
||||||
|
|
||||||
|
override_dh_auto_test:
|
||||||
|
# No tests. Can't execute a WASM binary
|
||||||
|
echo "Skipping tests, can't run WASM files"
|
||||||
|
|||||||
Reference in New Issue
Block a user