]> git.proxmox.com Git - cargo.git/blobdiff - debian/rules
Refresh patches and remove upstream applied CVE patches
[cargo.git] / debian / rules
index 3f59e40c86301157d6abf51fb98f841acd994ab6..df75a982d2453fb7aae99abb5fbd583c230b9f74 100755 (executable)
@@ -5,21 +5,33 @@ include /usr/share/dpkg/architecture.mk
 include /usr/share/dpkg/buildflags.mk
 include /usr/share/rustc/architecture.mk
 
+export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
 export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
-export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS RUSTFLAGS
 
-export CARGO_HOME = $(CURDIR)/debian/cargo_home
 CARGO = $(CURDIR)/debian/bin/cargo
-export DEB_CARGO_PACKAGE=cargo
+
+export CARGO_HOME = $(CURDIR)/debian/cargo_home
 export DEB_CARGO_CRATE=cargo_$(DEB_VERSION_UPSTREAM)
+RUSTFLAGS := --remap-path-prefix=$(CURDIR)=/usr/src/cargo-$(DEB_VERSION_UPSTREAM)
 
-# Disable tests on powerpc and powerpcspe for now.
-# cbmuser requested this and will fix the errors later
-# TODO: once powerpc powerpcspe test failures are fixed drop this
-ifneq (,filter($(DEB_HOST_ARCH), powerpc powerpcspe))
-       POST_TEST = || true
+# https://github.com/rust-lang/rust/issues/52108
+ifneq (,$(filter $(DEB_HOST_ARCH), mips64el))
+  RUSTFLAGS += -Ctarget-feature=+xgot
 endif
 
+export RUSTFLAGS
+
+# don't shrink, this can take ages
+# see https://github.com/rust-lang/cargo/issues/6490 for details
+export PROPTEST_MAX_SHRINK_ITERS = 0
+export CARGO_TEST_SLOW_CPU_MULTIPLIER = 4
+
+# To run a specific test, run something like:
+#   $ debian/rules override_dh_auto_test-arch \
+#     CARGO_TEST_FLAGS="package::include -- <args ...>"
+# See `cargo test --help` for more options.
+CARGO_TEST_FLAGS =
+
 %:
        dh $@ --with bash-completion
 
@@ -32,11 +44,14 @@ override_dh_auto_build-arch:
 override_dh_auto_build-indep:
        $(CARGO) doc
 
-override_dh_auto_test:
-       CFG_DISABLE_CROSS_TESTS=1 $(CARGO) test $(POST_TEST)
+override_dh_auto_test-arch:
+       CFG_DISABLE_CROSS_TESTS=1 $(CARGO) test $(CARGO_TEST_FLAGS)
+
+override_dh_auto_test-indep:
+       # no arch-indep tests
 
 override_dh_auto_install:
-       $(CARGO) install
+       DESTDIR=$(CURDIR)/debian/cargo $(CARGO) install
 
 override_dh_auto_clean:
        $(CARGO) clean
@@ -44,3 +59,4 @@ override_dh_auto_clean:
 override_dh_clean:
        # Upstream contains a lot of these
        dh_clean -XCargo.toml.orig
+       rm -f Cargo.lock