#! /usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow include /usr/share/dpkg/pkg-info.mk ifeq (${DEB_HOST_GNU_TYPE},) # Fast version of dpkg/architecture.mk defining all vars in one go $(foreach d, $(shell dpkg-architecture | sed 's/=/?=/'), $(eval export $d)) endif # CARGO_HOME *must* end with "/debian/cargo_home" export CARGO_HOME=${CURDIR}/b/debian/cargo_home export CARGO=/usr/share/cargo/bin/cargo V = $(if $(filter terse, ${DEB_BUILD_OPTIONS}),,-v) # libblkio build system wraps cargo in meson. build build-arch build-indep \ install install-arch install-indep \ binary binary-arch binary-indep \ : %: dh $@ # /usr/share/cargo/bin/cargo wrapper is stupid and broken in many ways, # and apparently needs huge work to fix. Instead of trying to fight all # its issues, use it only when absolutely necessary: just to set up # the system registry and build flags. # The rest is done using regular cargo directly. override_dh_auto_configure: DEB_CARGO_CRATE=${DEB_SOURCE}_${DEB_VERSION_UPSTREAM} \ DEB_HOST_RUST_TYPE=${DEB_HOST_GNU_TYPE} DEB_HOST_GNU_TYPE=${DEB_HOST_GNU_TYPE} \ ${CARGO} prepare-debian b/cargo-registry --link-from-system $V meson setup b/ --wrap-mode=nodownload --buildtype=plain \ --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ --libdir=/usr/lib/${DEB_HOST_MULTIARCH} override_dh_auto_build: meson compile -C b/ -v override_dh_auto_test: ifneq (,$(filter nocheck,${DEB_BUILD_OPTIONS})) meson test -C b/ \ --suite generic --suite io_uring+parallel --suite examples endif b := libblkio.so.1 f := libblkio.so.${DEB_VERSION_UPSTREAM} override_dh_auto_install: meson install -C b/ --destdir ${CURDIR}/debian/tmp # cd debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}; \ # patchelf --set-soname ${b} ${f}; \ # ln -sf ${f} ${b}; \ # ln -sf ${b} libblkio.so # dwz: Allocatable section in libblkio.so.1.4.0 after non-allocatable ones override_dh_dwz: clean: dh_clean b/ Cargo.lock