diff --git a/debian/rules b/debian/rules index 213cc876..4d425a75 100755 --- a/debian/rules +++ b/debian/rules @@ -1,18 +1,27 @@ #!/usr/bin/make -f -export DEB_BUILD_MAINT_OPTIONS = hardening=+all -DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/default.mk -include /usr/share/rustc/architecture.mk -export DEB_HOST_RUST_TYPE -export PATH:=/usr/share/cargo/bin:$(PATH) -export CARGO=/usr/share/cargo/bin/cargo +DH_VERBOSE = 1 + +# export DEB_BUILD_MAINT_OPTIONS = hardening=+all +# DPKG_EXPORT_BUILDFLAGS = 1 + +# Remove because they're for normal builds, not "cross" builds, or what ever +# 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_REGISTRY=$(CURDIR)/debian/cargo_registry +CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM) +export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS %: - dh $@ --buildsystem=cargo + dh $@ execute_after_dh_auto_clean: $(CARGO) clean @@ -20,8 +29,14 @@ execute_after_dh_auto_clean: rm -rf $(CARGO_REGISTRY) rm -f debian/cargo-checksum.json -execute_before_dh_auto_configure: +override_dh_auto_configure: $(CARGO) prepare-debian $(CARGO_REGISTRY) --link-from-system - rm -f Cargo.lock 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"