| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/default.mk |
| 4 |
include /usr/share/rustc/architecture.mk |
| 5 |
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS |
| 6 |
export DEB_HOST_RUST_TYPE |
| 7 |
export DEB_HOST_GNU_TYPE |
| 8 |
export PATH := /usr/share/cargo/bin:$(PATH) |
| 9 |
export CARGO=/usr/share/cargo/bin/cargo |
| 10 |
export CARGO_HOME=$(CURDIR)/debian/cargo_home |
| 11 |
export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM) |
| 12 |
export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow |
| 13 |
|
| 14 |
%: |
| 15 |
dh $@ |
| 16 |
|
| 17 |
# Disable lto on 32-bit arches since it OOMs otherwise |
| 18 |
execute_before_dh_auto_configure: |
| 19 |
ifeq ($(DEB_HOST_ARCH_BITS),32) |
| 20 |
export DEB_BUILD_OPTIONS += optimize=-lto |
| 21 |
endif |
| 22 |
|
| 23 |
|
| 24 |
override_dh_auto_configure: |
| 25 |
$(CARGO) prepare-debian debian/cargo_registry --link-from-system |
| 26 |
rm -f Cargo.lock |
| 27 |
dh_auto_configure -- \ |
| 28 |
-Dhost_arch="$(DEB_HOST_RUST_TYPE)" \ |
| 29 |
-Dx11=enabled |
| 30 |
|
| 31 |
# Give the tests more time on slow arches |
| 32 |
override_dh_auto_test: |
| 33 |
dh_auto_test -- --timeout-multiplier 5 |
| 34 |
|
| 35 |
override_dh_auto_install: |
| 36 |
$(if $(findstring armhf,$(DEB_HOST_ARCH)), DEB_BUILD_OPTIONS="parallel=4 $(filter-out parallel=%,$(DEB_BUILD_OPTIONS))") dh_auto_install |
| 37 |
|
| 38 |
# Generate (Static-)Built-Using |
| 39 |
# Symlink the meson target dir to target/$(DEB_HOST_RUST_TYPE)/release |
| 40 |
# since dh-cargo-built-using expects it there |
| 41 |
execute_after_dh_auto_install: |
| 42 |
mkdir -p $(CURDIR)/target/$(DEB_HOST_RUST_TYPE)/ |
| 43 |
ln -s $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/src/$(DEB_HOST_RUST_TYPE)/release target/$(DEB_HOST_RUST_TYPE)/ |
| 44 |
/usr/share/cargo/bin/dh-cargo-built-using loupe |
| 45 |
|
| 46 |
execute_after_dh_auto_clean: |
| 47 |
rm -rf debian/cargo_registry |
| 48 |
|
| 49 |
override_dh_gnome_clean: |