Skip to content

Commit

Permalink
Librespot for Raspberry Pi (and other Linux on ARM)
Browse files Browse the repository at this point in the history
Uses alsa output, only needs libasound2 installed
  • Loading branch information
herrernst committed Jul 17, 2017
1 parent 910974e commit cc9dba8
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,49 @@ addons:
- portaudio19-dev

before_script:
- mkdir -p ~/.cargo
- echo '[target.armv7-unknown-linux-gnueabihf]' > ~/.cargo/config
- echo 'linker = "arm-linux-gnueabihf-gcc"' >> ~/.cargo/config
- rustup target add armv7-unknown-linux-gnueabihf
# get raspberry pi tools (cross compiler etc); use fixed rev, should be updated sometimes
# (if we would ignore rpi1 support, we could just use ubuntu's/debian's gcc-arm-linux-gnueabihf; with libc6-armhf-cross, libc6-dev-armhf-cross, etc.)
- mkdir pi-tools
- curl -L https://github.com/raspberrypi/tools/archive/648a6eeb1e3c2b40af4eb34d88941ee0edeb3e9a.tar.gz | tar xz --strip-components 1 -C pi-tools
- export PATH=$PWD/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/:$PATH
# create wrapper around gcc to point to rpi sysroot
- echo -e '#!/bin/bash' > pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot
- echo -e "arm-linux-gnueabihf-gcc --sysroot $PWD/pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot \"\$@\"" >> pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot
- chmod +x pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot
# get alsa lib and headers
- curl -OL http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2_1.0.25-4_armhf.deb
- ar p libasound2_1.0.25-4_armhf.deb data.tar.gz | tar -xz -C pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot
- curl -OL http://mirrordirector.raspbian.org/raspbian/pool/main/a/alsa-lib/libasound2-dev_1.0.25-4_armhf.deb
- ar p libasound2-dev_1.0.25-4_armhf.deb data.tar.gz | tar -xz -C pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot/
# i don't why this is neccessary
- ln -s ld-linux.so.3 pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot/lib/ld-linux-armhf.so.3
# point cargo to use gcc wrapper as linker
- mkdir -p ~/.cargo
- echo -e '[target.arm-unknown-linux-gnueabihf]\nlinker = "gcc-sysroot"' > ~/.cargo/config
- rustup target add arm-unknown-linux-gnueabihf

script:
- cargo build --no-default-features
- cargo build --no-default-features --features "with-tremor"
- cargo build --no-default-features --features "portaudio-backend"
- cargo build --no-default-features --features "pulseaudio-backend"
- cargo build --no-default-features --features "alsa-backend"
- cargo build --no-default-features --target armv7-unknown-linux-gnueabihf

- cargo build --no-default-features --features "alsa-backend" --target arm-unknown-linux-gnueabihf --release

before_deploy:
zip -j librespot-linux-armhf-raspberry_pi.zip target/arm-unknown-linux-gnueabihf/release/librespot

deploy:
provider: releases
api_key:
secure: "cbVGQm9I8RN4qV5i+uE206vRvXoHqzGeDA7qmz6diNjLMWuhTxNf8Kzw1R0alUig2c0RPVslqnaaWTo01nCaB77SOK/E/EP4mCD2SesfGVLgbJ0iim/MB0GcwDPsCYeb1gx2fvdNGC5gnfWI75Bo/wCvfaGZL9bTb+5Dk63EVAVF70sj3RmQSoPC6VsPuPc3l/a6/Bxk2A2gGFZ5+k3JaUu9XYGjaGSzVPWKMG2mBhTKZcBIQivUul0C/31K6G5ZXhZTVA/7p01sDvYeuYOx8YSjnXcBqztkeNAZdRY6hYwi/rF3saBTJ6HX8c/KH6/XNvb94C2ZhCt+5MZ/zEdMoxVGVbiPkyJ/gJYcEsM43dc+ldB6OQTXnruVpy3v4gKieNhKgtPiVtXSlLHB87DAlORhJj8iQwBoNxSE0mUixCQbfQCqUFi/cXH9Xb3yPGa7288YYs0gymX+Pi6QvWPR4OP9JzKLeZiH826bTd3M1HiR/2zb+UAZ2sT8ggZgRHnBOBfQ2GOajuZ9DZ6HJMrr4GIw3vaFEbbR1S+Ujn93XRUVQZZWQRXTBXknBp/GJ2WTtddZPnGV3lSj7MXnk1H6t+mPpgJOY8cON3tWRpxosm/+838oiLdZNc9QGp6AkGaSCisW0LHr0uBvKkjUUx24dvhfl53Fmg6YAd2dbQtk8NE="
file: "librespot-linux-armhf-raspberry_pi.zip"
skip_cleanup: true
on:
condition: $TRAVIS_RUST_VERSION = stable
tags: true


notifications:
email: false

0 comments on commit cc9dba8

Please sign in to comment.