Skip to content

Commit

Permalink
Fixed cross-compiling of alsa-sys (closes #192)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcooper committed Apr 15, 2019
1 parent 007ad72 commit 8fcfb6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN apt-get update \
git \
gnupg \
pandoc \
pkg-config \
python-pip \
python-setuptools \
python-wheel \
Expand All @@ -28,7 +29,7 @@ WORKDIR /toolchain
# Check out Raspbian cross-compiler (this will work on *ALL* Raspberry Pi versions)
RUN git clone --depth 1 git://github.com/raspberrypi/tools.git rpi-tools \
&& rm -rf rpi-tools/.git
ENV PATH="/toolchain/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/:${PATH}"
ENV PATH "/toolchain/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/:${PATH}"

# Create wrapper around gcc to point to rpi sysroot
# Thanks @ https://github.com/herrernst/librespot/blob/build-rpi/.travis.yml
Expand All @@ -38,6 +39,8 @@ RUN echo '#!/bin/sh\narm-linux-gnueabihf-gcc --sysroot /toolchain/rpi-tools/arm-
&& ln -s ld-linux.so.3 rpi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot/lib/ld-linux-armhf.so.3

# Install 1.0.x alsa-utils which is needed for compilation
ENV PKG_CONFIG_ALLOW_CROSS 1
ENV PKG_CONFIG_PATH "/toolchain/rpi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot/lib/pkgconfig"
RUN curl -O https://www.mirrorservice.org/sites/ftp.alsa-project.org/pub/lib/alsa-lib-1.0.29.tar.bz2 \
&& tar xvjf alsa-lib-1.0.29.tar.bz2 && cd alsa-lib-1.0.29 \
&& CC=arm-linux-gnueabihf-gcc ./configure --host=arm-linux-gnueabihf --disable-python \
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export CARGO_TARGET_DIR="/build"
export CARGO_HOME="/build/cache"

# Install the gcc wrapper in container into cargo
mkdir /.cargo
mkdir -p /.cargo
echo '[target.arm-unknown-linux-gnueabihf]\nlinker = "gcc-wrapper"' > /.cargo/config
rustup target add arm-unknown-linux-gnueabihf

Expand Down

0 comments on commit 8fcfb6e

Please sign in to comment.