include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
# TODO: more correct to use `[build] rustflags = []` list syntax in Cargo.toml
-RUSTFLAGS = $(addprefix -C link-args=,$(LDFLAGS))
+RUSTFLAGS = $(addprefix -C link-args=,$(LDFLAGS)) \
+ -Zremap-path-prefix-from=$(CURDIR) -Zremap-path-prefix-to=/usr/src/rust
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS RUSTFLAGS
# Defines DEB_*_RUST_TYPE triples
debian/configure-upstream: debian/config.toml debian/rules
rm -f "$@"
echo '#!/bin/sh' >> "$@"
- echo '# This script can be used to configure a clean upstream checkout' >> "$@"
+ echo '# This script can be used to configure a mostly-clean upstream checkout' >> "$@"
echo '# in case you need to test any differences between it and Debian' >> "$@"
echo 'set -e' >> "$@"
echo 'test -f ./configure' >> "$@"
# work around #842634
if test $$(grep "127.0.0.1\s*localhost" /etc/hosts | wc -l) -gt 1; then \
debian/ensure-patch -N debian/patches/d-host-duplicates.patch; fi
+ # We patched mdbook so have to rm the checksums
+ debian/empty-cargo-checksum.py src/vendor/mdbook/.cargo-checksum.json
+ # Unfortunately upstream uses a duplicate copy of libbacktrace and wants to
+ # compile it again for rust-installer, see #43449
+ ln -rsf src/libbacktrace -t src/vendor/backtrace-sys/src/
+ debian/empty-cargo-checksum.py src/vendor/backtrace-sys/.cargo-checksum.json
+ # Link against system liblzma, see https://github.com/alexcrichton/xz2-rs/issues/16
+ echo 'fn main() { println!("cargo:rustc-link-lib=lzma"); }' > src/vendor/lzma-sys/build.rs
+ debian/empty-cargo-checksum.py src/vendor/lzma-sys/.cargo-checksum.json
+ # Do the actual configure
PATH="$$PWD/debian/bin:$$PATH" \
./configure $(DEB_CONFIGURE_FLAGS)
endif
override_dh_auto_install:
- DESTDIR=$(DEB_DESTDIR) $(RUSTBUILD) dist $(RUSTBUILD_FLAGS) --install
+ DESTDIR=$(DEB_DESTDIR) $(RUSTBUILD) install $(RUSTBUILD_FLAGS)
mkdir -p $(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/
mv $(DEB_DESTDIR)/usr/lib/lib*.so $(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/
\) -delete
cd debian/rust-src/usr/src/rust && chmod -x \
src/etc/gdb_rust_pretty_printing.py \
- src/etc/adb_run_wrapper.sh \
src/compiler-rt/test/builtins/Unit/ppc/test
override_dh_installchangelogs: