build: improve justfile and debian/rules

This commit is contained in:
Michael Aaron Murphy 2025-12-18 13:53:53 +01:00 committed by Jeremy Soller
parent c29db5de5f
commit e64f35c62a
2 changed files with 59 additions and 60 deletions

24
debian/rules vendored
View file

@ -1,33 +1,15 @@
#!/usr/bin/make -f
DESTDIR = debian/cosmic-session
CLEAN ?= 1
VENDOR ?= 1
export DESTDIR = debian/cosmic-session
%:
dh $@
override_dh_installgsettings:
dh_installgsettings --priority=50
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
override_dh_auto_clean:
if test "${CLEAN}" = "1"; then \
cargo clean; \
fi
if ! ischroot && test "${VENDOR}" = "1"; then \
mkdir -p .cargo; \
cargo vendor --sync Cargo.toml | head -n -1 > .cargo/config.toml; \
echo 'directory = "vendor"' >> .cargo/config.toml; \
tar pcf vendor.tar vendor; \
rm -rf vendor; \
fi
ischroot || just vendor
override_dh_auto_build:
just rootdir=$(DESTDIR) debug=$(DEBUG) vendor=$(VENDOR)
test -e vendor.tar && just build-vendored || just
override_dh_auto_install:
just rootdir=$(DESTDIR) install