build: properly use cargo wrapper

to actually get debug symbols with rustc >= 1.77

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2024-06-20 10:27:13 +02:00
parent d4af462220
commit 32d813ce44
2 changed files with 8 additions and 3 deletions

View File

@ -54,7 +54,7 @@ cargo-build:
install: cargo-build install: cargo-build
install -dm755 $(DESTDIR)/usr/bin install -dm755 $(DESTDIR)/usr/bin
install -m4755 -o root -g root $(COMPILEDIR)/proxmox-mail-forward $(DESTDIR)/usr/bin/proxmox-mail-forward $(CARGO) install
.PHONY: upload .PHONY: upload
upload: $(DEBS) upload: $(DEBS)

9
debian/rules vendored
View File

@ -3,21 +3,26 @@
#DH_VERBOSE = 1 #DH_VERBOSE = 1
include /usr/share/dpkg/pkg-info.mk include /usr/share/dpkg/pkg-info.mk
include /usr/share/rustc/architecture.mk
export BUILD_MODE=release export BUILD_MODE=release
CARGO=/usr/share/cargo/bin/cargo
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE
export CARGO=/usr/share/cargo/bin/cargo
export CARGO_HOME = $(CURDIR)/debian/cargo_home export CARGO_HOME = $(CURDIR)/debian/cargo_home
export DEB_CARGO_CRATE=proxmox-mail-forward_$(DEB_VERSION_UPSTREAM)
export DEB_CARGO_PACKAGE=proxmox-mail-forward
%: %:
dh $@ dh $@
override_dh_auto_configure: override_dh_auto_configure:
@perl -ne 'if (/^version\s*=\s*"(\d+(?:\.\d+)+)"/) { my $$v_cargo = $$1; my $$v_deb = "$(DEB_VERSION_UPSTREAM)"; \ @perl -ne 'if (/^version\s*=\s*"(\d+(?:\.\d+)+)"/) { my $$v_cargo = $$1; my $$v_deb = "$(DEB_VERSION_UPSTREAM)"; \
die "ERROR: d/changelog <-> Cargo.toml version mismatch: $$v_cargo != $$v_deb\n" if $$v_cargo ne $$v_deb; exit(0); }' Cargo.toml die "ERROR: d/changelog <-> Cargo.toml version mismatch: $$v_cargo != $$v_deb\n" if $$v_cargo ne $$v_deb; exit(0); }' Cargo.toml
$(CARGO) prepare-debian $(CURDIR)/debian/cargo_registry --link-from-system
dh_auto_configure dh_auto_configure
override_dh_fixperms: override_dh_fixperms: