| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 | # Cross compilation environment for librespot# Build the docker image from the root of the project with the following command :# $ docker build -t librespot-cross -f contrib/Dockerfile .## The resulting image can be used to build librespot for linux x86_64, armhf(with support for armv6hf), armel, mipsel, aarch64# $ docker run -v /tmp/librespot-build:/build librespot-cross## The compiled binaries will be located in /tmp/librespot-build## If only one architecture is desired, cargo can be invoked directly with the appropriate options :# $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --no-default-features --features "alsa-backend"# $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features "alsa-backend"# $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabi --no-default-features --features "alsa-backend"# $ docker run -v /tmp/librespot-build:/build librespot-cross contrib/docker-build-pi-armv6hf.shFROM debian:stretchRUN dpkg --add-architecture arm64RUN dpkg --add-architecture armhfRUN dpkg --add-architecture armelRUN dpkg --add-architecture mipselRUN apt-get updateRUN apt-get install -y curl git build-essential crossbuild-essential-arm64 crossbuild-essential-armel crossbuild-essential-armhf crossbuild-essential-mipselRUN apt-get install -y libasound2-dev libasound2-dev:arm64 libasound2-dev:armel libasound2-dev:armhf libasound2-dev:mipselRUN curl https://sh.rustup.rs -sSf | sh -s -- -yENV PATH="/root/.cargo/bin/:${PATH}"RUN rustup target add aarch64-unknown-linux-gnuRUN rustup target add arm-unknown-linux-gnueabiRUN rustup target add arm-unknown-linux-gnueabihfRUN rustup target add mipsel-unknown-linux-gnuRUN mkdir /.cargo && \    echo '[target.aarch64-unknown-linux-gnu]\nlinker = "aarch64-linux-gnu-gcc"' > /.cargo/config && \    echo '[target.arm-unknown-linux-gnueabihf]\nlinker = "arm-linux-gnueabihf-gcc"' >> /.cargo/config && \    echo '[target.arm-unknown-linux-gnueabi]\nlinker = "arm-linux-gnueabi-gcc"' >> /.cargo/config && \    echo '[target.mipsel-unknown-linux-gnu]\nlinker = "mipsel-linux-gnu-gcc"' >> /.cargo/configRUN mkdir /build && \    mkdir /pi-tools && \    curl -L https://github.com/raspberrypi/tools/archive/648a6eeb1e3c2b40af4eb34d88941ee0edeb3e9a.tar.gz | tar xz --strip-components 1 -C /pi-toolsENV CARGO_TARGET_DIR /buildENV CARGO_HOME /build/cacheADD . /srcWORKDIR /srcCMD ["/src/contrib/docker-build.sh"]
 |