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.
This commit is contained in:
Brian Tarricone 2022-05-14 00:15:03 -07:00
parent b63de1d416
commit aafe026092
6 changed files with 16 additions and 20 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
/target
.tags
/docker-out

1
.gitignore vendored
View File

@ -7,3 +7,4 @@ debian/bscreensaver.substvars
debian/bscreensaver/
debian/debhelper-build-stamp
debian/files
/docker-out/

View File

@ -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

View File

@ -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

4
debian/control vendored
View File

@ -11,8 +11,8 @@ Build-Depends:
libxcb1-dev,
libgtk-3-dev,
libpam0g-dev,
cargo,
rustc,
cargo (>= 0.57),
rustc (>= 1.58),
help2man
Package: bscreensaver

4
debian/rules vendored
View File

@ -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: