Skip to content

Commit 40d7960

Browse files
committed
Tweak armv6hf crossbuild script
Fix example typo in Dockerfile Fix docker run example comment for `armv6hf` Revert "Fix docker run example comment for `armv6hf`" This reverts commit 22af679.
1 parent c0a45d7 commit 40d7960

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

contrib/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Build the docker image from the root of the project with the following command :
33
# $ docker build -t librespot-cross -f contrib/Dockerfile .
44
#
5-
# The resulting image can be used to build librespot for linux x86_64, i386 and armhf(with support for armv6hf), armel, mipsel, aarch64
5+
# The resulting image can be used to build librespot for linux x86_64, armhf(with support for armv6hf), armel, mipsel, aarch64
66
# $ docker run -v /tmp/librespot-build:/build librespot-cross
77
#
88
# The compiled binaries will be located in /tmp/librespot-build
@@ -11,7 +11,7 @@
1111
# $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --no-default-features --features "alsa-backend"
1212
# $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features "alsa-backend"
1313
# $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabi --no-default-features --features "alsa-backend"
14-
# $ docker run -v /tmp/librespot-build:/build librespot-cross docker-build-pi-armv6hf.sh
14+
# $ docker run -v /tmp/librespot-build:/build contrib/librespot-cross docker-build-pi-armv6hf.sh
1515

1616
FROM debian:stretch
1717

contrib/docker-build-pi-armv6hf.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
#!/usr/bin/env bash
22

33
# Snipped and tucked from https://github.com/plietar/librespot/pull/202/commits/21549641d39399cbaec0bc92b36c9951d1b87b90
4+
# and further inputs from https://github.com/kingosticks/librespot/commit/c55dd20bd6c7e44dd75ff33185cf50b2d3bd79c3
45

56
set -eux
7+
# Get alsa lib and headers
8+
ALSA_VER="1.0.25-4"
9+
DEPS=( \
10+
"http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2_${ALSA_VER}_armhf.deb" \
11+
"http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2-dev_${ALSA_VER}_armhf.deb" \
12+
)
13+
614
# Collect Paths
715
SYSROOT="/pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot"
816
GCC="/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin"
@@ -18,16 +26,11 @@ export TARGET_CC="$GCC/arm-linux-gnueabihf-gcc"
1826
echo -e '#!/bin/bash' "\n$TARGET_CC --sysroot $SYSROOT \"\$@\"" > $GCC_SYSROOT
1927
chmod +x $GCC_SYSROOT
2028

21-
# get alsa lib and headers
22-
ALSA_VER="1.0.25-4"
23-
ALSA_LIB="libasound2_${ALSA_VER}_armhf.deb"
24-
ALSA_DEV_LIB="libasound2-dev_${ALSA_VER}_armhf.deb"
25-
26-
curl -OL "http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/$ALSA_LIB"
27-
dpkg -x $ALSA_LIB $SYSROOT
28-
curl -OL "http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/$ALSA_DEV_LIB"
29-
dpkg -x $ALSA_DEV_LIB $SYSROOT
30-
29+
# Add extra target dependencies to our rpi sysroot
30+
for path in "${DEPS[@]}"; do
31+
curl -OL $path
32+
dpkg -x $(basename $path) $SYSROOT
33+
done
3134

3235
# i don't why this is neccessary
3336
# ln -s ld-linux.so.3 $SYSROOT/lib/ld-linux-armhf.so.3

0 commit comments

Comments
 (0)