Skip to content

Commit

Permalink
fix ci cross-compilation by compiling libpulse ourselves
Browse files Browse the repository at this point in the history
  • Loading branch information
acheronfail committed Jan 4, 2024
1 parent fae109a commit fae1d98
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,8 @@ codegen-units = 1
panic = "abort"

# cross configuration
# see: https://github.com/cross-rs/cross/blob/main/docs/cross_toml.md
# FIXME: cross images are based on ubuntu:20.04, but pulse there is still v13, we need v14
# see: https://github.com/cross-rs/cross/pull/973
[package.metadata.cross.target.aarch64-unknown-linux-gnu]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main"
pre-build = ["DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential clang dbus dunst i3-wm imagemagick libfaketime libiw-dev libpulse-dev libx11-dev scrot xserver-xephyr xvfb"]
dockerfile = "./cross/aarch64-unknown-linux-gnu.Dockerfile"

[package.metadata.cross.target.x86_64-unknown-linux-gnu]
image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main"
pre-build = ["DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential clang dbus dunst i3-wm imagemagick libfaketime libiw-dev libpulse-dev libx11-dev scrot xserver-xephyr xvfb"]
dockerfile = "./cross/x86_64-unknown-linux-gnu.Dockerfile"
12 changes: 12 additions & 0 deletions cross/aarch64-meson.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[binaries]
c = 'aarch64-linux-gnu-gcc'
cpp = 'aarch64-linux-gnu-g++'
ar = 'aarch64-linux-gnu-ar'
strip = 'aarch64-linux-gnu-strip'
pkgconfig = 'aarch64-linux-gnu-pkg-config'

[host_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'
75 changes: 75 additions & 0 deletions cross/aarch64-unknown-linux-gnu.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main

ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/London

RUN apt-get install -y \
build-essential \
clang \
dbus \
dunst \
i3-wm \
imagemagick \
libfaketime \
libiw-dev \
libx11-dev \
scrot \
xserver-xephyr \
xvfb

# NOTE: we build and install libpulse manually ourselves, since the version in
# cross' current image is too low (v13). We need at least v14.
RUN dpkg --add-architecture arm64
RUN apt-get update && apt-get install -y \
autopoint \
bash-completion \
check:arm64 \
curl \
dbus-x11 \
dpkg-dev \
g++ \
gcc \
gettext \
git-core \
libasound2-dev \
libasyncns-dev \
libavahi-client-dev \
libbluetooth-dev \
libcap-dev:arm64 \
libdbus-1-dev:arm64 \
libfftw3-dev \
libglib2.0-dev \
libgtk-3-dev \
libice-dev \
libjack-dev \
liblircclient-dev \
libltdl-dev:arm64 \
liborc-0.4-dev \
libsbc-dev:arm64 \
libsndfile1-dev:arm64 \
libsoxr-dev \
libspeexdsp-dev \
libssl-dev \
libsystemd-dev \
libtdb-dev:arm64 \
libudev-dev \
libwebrtc-audio-processing-dev \
libwrap0-dev \
libx11-xcb-dev \
libxcb1-dev \
libxml-parser-perl \
libxml2-utils \
libxtst-dev \
m4 \
meson \
ninja-build \
pkg-config:arm64 \
python3-setuptools \
systemd \
wget
RUN rm -rf /opt/pulseaudio && git clone \
--depth 1 \
--branch stable-14.x \
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git \
/opt/pulseaudio
COPY ./cross/aarch64-meson.txt /opt/pulseaudio/aarch64-meson.txt
RUN cd /opt/pulseaudio && meson --cross-file aarch64-meson.txt build && cd build && ninja && ninja install
71 changes: 71 additions & 0 deletions cross/x86_64-unknown-linux-gnu.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
FROM ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main

ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/London

RUN apt-get install -y \
build-essential \
clang \
dbus \
dunst \
i3-wm \
imagemagick \
libfaketime \
libiw-dev \
libx11-dev \
scrot \
xserver-xephyr \
xvfb

# NOTE: we build and install libpulse manually ourselves, since the version in
# cross' current image is too low (v13). We need at least v14.
RUN apt-get install -y \
autopoint \
bash-completion \
check \
curl \
dbus-x11 \
g++ \
gcc \
gettext \
git-core \
libasound2-dev \
libasyncns-dev \
libavahi-client-dev \
libbluetooth-dev \
libcap-dev \
libfftw3-dev \
libglib2.0-dev \
libgtk-3-dev \
libice-dev \
libjack-dev \
liblircclient-dev \
libltdl-dev \
liborc-0.4-dev \
libsbc-dev \
libsndfile1-dev \
libsoxr-dev \
libspeexdsp-dev \
libssl-dev \
libsystemd-dev \
libtdb-dev \
libudev-dev \
libwebrtc-audio-processing-dev \
libwrap0-dev \
libx11-xcb-dev \
libxcb1-dev \
libxml-parser-perl \
libxml2-utils \
libxtst-dev \
m4 \
meson \
ninja-build \
pkg-config \
python3-setuptools \
systemd \
wget
RUN rm -rf /opt/pulseaudio && git clone \
--depth 1 \
--branch stable-14.x \
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git \
/opt/pulseaudio
RUN cd /opt/pulseaudio && meson build && cd build && ninja && ninja install

0 comments on commit fae1d98

Please sign in to comment.