From aafe0260921e72d98add278339c39e8569699d5e Mon Sep 17 00:00:00 2001 From: "Brian J. Tarricone" Date: Sat, 14 May 2022 00:15:03 -0700 Subject: [PATCH] Make debian package building work I gave up on getting it to build on bullseye, as its cargo/rustc is too old for the 2021 edition. Building newer deb packages of rust is apparently a difficult, manual process. I tried installing rustup and pulling the latest compiler, but that failed with strange errors that I am tired of debugging. --- .dockerignore | 3 +++ .gitignore | 1 + Dockerfile | 12 ++++-------- Makefile | 12 ++++++------ debian/control | 4 ++-- debian/rules | 4 ---- 6 files changed, 16 insertions(+), 20 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..95b23d8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +/target +.tags +/docker-out diff --git a/.gitignore b/.gitignore index 1ea3cb0..db578f0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ debian/bscreensaver.substvars debian/bscreensaver/ debian/debhelper-build-stamp debian/files +/docker-out/ diff --git a/Dockerfile b/Dockerfile index 67a2122..deaccac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,11 @@ -FROM debian:bullseye-slim - -ARG RUST_VERSION=1.60 - -WORKDIR /bscreensaver +FROM debian:bookworm-slim RUN apt-get update && \ apt-get -y full-upgrade && \ - apt-get -y install curl devscripts && \ - mkdir -p /build + apt-get -y install devscripts && \ + mkdir -p /bscreensaver-build -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y +WORKDIR /bscreensaver # Do this first to get our build deps cached. COPY debian ./debian diff --git a/Makefile b/Makefile index 7f95469..21f1e17 100644 --- a/Makefile +++ b/Makefile @@ -82,16 +82,16 @@ $(RELEASE_OUT)/bscreensaver-settings.desktop: settings/bscreensaver-settings.des deb-pkg: @[ "$(RELEASE_VERSION)" ] || { echo "RELEASE_VERSION not set" >&2; exit 1; } - docker build -t bscreensaver-build:latest . sudo rm -rf docker-out + docker build -t bscreensaver-build:latest . mkdir docker-out - docker run --rm -v $(shell pwd)/docker-out:/build:rw bscreensaver-build:latest bash -c '\ - cp -a /bscreensaver /build/bscreensaver-$(RELEASE_VERSION) && \ - cd /build && \ + docker run --rm -v $(shell pwd)/docker-out:/bscreensaver-build:rw bscreensaver-build:latest bash -c '\ + cp -a /bscreensaver /bscreensaver-build/bscreensaver-$(RELEASE_VERSION) && \ + cd /bscreensaver-build && \ tar cvzf bscreensaver_$(RELEASE_VERSION).orig.tar.gz bscreensaver-$(RELEASE_VERSION) && \ cd bscreensaver-$(RELEASE_VERSION) && \ - debuild --prepend-path=/root/.cargo/bin -uc -us && \ - rm -rf /build/bscreensaver' + debuild -uc -us && \ + rm -rf /bscreensaver-build/bscreensaver' clean: cargo clean diff --git a/debian/control b/debian/control index df7ad75..a1e1999 100644 --- a/debian/control +++ b/debian/control @@ -11,8 +11,8 @@ Build-Depends: libxcb1-dev, libgtk-3-dev, libpam0g-dev, - cargo, - rustc, + cargo (>= 0.57), + rustc (>= 1.58), help2man Package: bscreensaver diff --git a/debian/rules b/debian/rules index a7f7ceb..aa8c763 100755 --- a/debian/rules +++ b/debian/rules @@ -9,10 +9,6 @@ MAKE_ARGS = \ dh $@ override_dh_auto_clean: - @echo "HOME=$$HOME" - @echo "PATH=$$PATH" - ls $$HOME/.rustup - ls $$HOME/.cargo dh_auto_clean -- $(MAKE_ARGS) override_dh_auto_build: