From cc9dba8e457c48011e8f5e9768865419db14b39f Mon Sep 17 00:00:00 2001 From: herrernst Date: Sun, 26 Mar 2017 13:55:23 +0200 Subject: [PATCH] Librespot for Raspberry Pi (and other Linux on ARM) Uses alsa output, only needs libasound2 installed --- .travis.yml | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 726cedd4..734c002c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,10 +16,26 @@ 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 @@ -27,7 +43,22 @@ script: - 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