# Extra build-deps needed for x.py to download stuff in pkg.rustc.dlstage0.
curl <pkg.rustc.dlstage0>,
ca-certificates <pkg.rustc.dlstage0>,
-Build-Depends-Indep: wasi-libc
+Build-Depends-Indep: wasi-libc <!nowasm>
Build-Conflicts: gdb-minimal <!nocheck>
# ^ That version of rustc is broken
Standards-Version: 4.2.1
Depends: ${shlibs:Depends}, ${misc:Depends}, lld-9
# Embeds wasi-libc so doesn't need to depend on it
# None of its licenses require source redistribution, so no need for Built-Using
+Build-Profiles: <!nowasm>
Description: Rust standard libraries - development files
Rust is a curly-brace, block-structured expression language. It
visually resembles the C language family, but differs significantly
BUILD_DOCS := false
endif
+BUILD_WASM := true
+ifneq (,$(findstring nowasm,$(DEB_BUILD_PROFILES)))
+ BUILD_WASM := false
+endif
+
MAKE_OPTIMISATIONS := true
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
MAKE_OPTIMISATIONS := false
override_dh_auto_build-arch: debian/dh_auto_build.stamp
override_dh_auto_build-indep: debian/dh_auto_build.stamp
+ifeq (true,$(BUILD_WASM))
$(RUSTBUILD) build $(RUSTBUILD_FLAGS) \
--host $(DEB_BUILD_RUST_TYPE) --target wasm32-unknown-unknown src/libstd
$(RUSTBUILD) build $(RUSTBUILD_FLAGS) \
--host $(DEB_BUILD_RUST_TYPE) --target wasm32-wasi src/libstd
+endif
ifeq (true,$(BUILD_DOCS))
$(RUSTBUILD) doc $(RUSTBUILD_FLAGS)
endif
override_dh_auto_test-indep:
ifeq (, $(filter nocheck,$(DEB_BUILD_PROFILES)))
ifeq (, $(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ifeq (true,$(BUILD_WASM))
# Ignore failures in these tests, but run them so we see what it's like
-PATH=$(CURDIR)/debian/bin:$(PATH) $(RUSTBUILD_TEST) $(RUSTBUILD_FLAGS) $(RUSTBUILD_TEST_FLAGS) \
--host $(DEB_BUILD_RUST_TYPE) --target wasm32-unknown-unknown src/libstd
-PATH=$(CURDIR)/debian/bin:$(PATH) $(RUSTBUILD_TEST) $(RUSTBUILD_FLAGS) $(RUSTBUILD_TEST_FLAGS) \
--host $(DEB_BUILD_RUST_TYPE) --target wasm32-wasi src/libstd
+endif
ifeq (true,$(BUILD_DOCS))
# Run all rules that test the docs, i.e. that depend on default:doc
$(RUSTBUILD_TEST) $(RUSTBUILD_FLAGS) src/tools/linkchecker
override_dh_auto_install-arch: debian/dh_auto_install.stamp
override_dh_auto_install-indep: debian/dh_auto_install.stamp
+ifeq (true,$(BUILD_WASM))
DESTDIR=$(DEB_DESTDIR) $(RUSTBUILD) install $(RUSTBUILD_FLAGS) \
--host $(DEB_BUILD_RUST_TYPE) --target wasm32-unknown-unknown src/libstd
DESTDIR=$(DEB_DESTDIR) $(RUSTBUILD) install $(RUSTBUILD_FLAGS) \
--host $(DEB_BUILD_RUST_TYPE) --target wasm32-wasi src/libstd
+endif
ifeq (true,$(BUILD_DOCS))
# Brute force to remove privacy-breach-logo lintian warning.
# We could have updated the upstream sources but it would complexify
override_dh_install-indep: debian/rust-src.install debian/rust-src.links
dh_install
+ifeq (true,$(BUILD_WASM))
dh_install -plibstd-rust-dev-wasm32-cross usr/lib/rustlib/wasm32-*/lib/
+endif
chmod -x \
debian/rust-gdb/usr/share/rust-gdb/*.py \
debian/rust-lldb/usr/share/rust-lldb/*.py