File: rules

package info (click to toggle)
loupe 48.1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,736 kB
  • sloc: python: 110; makefile: 36
file content (48 lines) | stat: -rwxr-xr-x 1,529 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/make -f

include /usr/share/dpkg/default.mk
include /usr/share/rustc/architecture.mk
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
export DEB_HOST_RUST_TYPE
export DEB_HOST_GNU_TYPE
export PATH := /usr/share/cargo/bin:$(PATH)
export CARGO=/usr/share/cargo/bin/cargo
export CARGO_HOME=$(CURDIR)/debian/cargo_home
export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)
export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow

%:
	dh $@

# Disable lto on 32-bit arches since it OOMs otherwise
execute_before_dh_auto_configure:
ifeq ($(DEB_HOST_ARCH_BITS),32)
export DEB_BUILD_OPTIONS += optimize=-lto
endif


override_dh_auto_clean:
	dh_auto_clean
	rm -rf debian/cargo_registry

override_dh_auto_configure:
	$(CARGO) prepare-debian debian/cargo_registry --link-from-system
	rm -f Cargo.lock
	dh_auto_configure -- \
	-Dhost_arch="$(DEB_HOST_RUST_TYPE)" \
	-Dx11=enabled

# Give the tests more time on slow arches
override_dh_auto_test:
	dh_auto_test --  --timeout-multiplier 5

override_dh_auto_install:
	$(if $(findstring armhf,$(DEB_HOST_ARCH)), DEB_BUILD_OPTIONS="parallel=4 $(filter-out parallel=%,$(DEB_BUILD_OPTIONS))") dh_auto_install

# Generate (Static-)Built-Using
# Symlink the meson target dir to target/$(DEB_HOST_RUST_TYPE)/release
# since dh-cargo-built-using expects it there
execute_after_dh_auto_install:
	mkdir -p $(CURDIR)/target/$(DEB_HOST_RUST_TYPE)/
	ln -s $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/src/$(DEB_HOST_RUST_TYPE)/release target/$(DEB_HOST_RUST_TYPE)/
	/usr/share/cargo/bin/dh-cargo-built-using loupe