From bbd2ffc0f3e4866cf8c8e50723bfd33c561f2064 Mon Sep 17 00:00:00 2001 From: Bart Verhagen Date: Tue, 6 Oct 2020 16:26:26 +0200 Subject: [PATCH] New: Usr: Enabled Spotify for x86_64 and armv7 Due to Spotify stopping support for libspotify, Spotify for arm64 is currently fundamentally broken Fixes #36 --- Dockerfile | 16 +++++++++++++--- Dockerfile.aarch64 | 4 ++-- Dockerfile.armhf | 12 ++++++++++-- README.md | 1 + readme-vars.yml | 1 + 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1ee005d..b7d416a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,8 @@ FROM lsiobase/alpine:3.12 as buildstage ############## build stage ############## ARG DAAPD_RELEASE +ARG LIBSPOTIFY_VERSION=12.1.51 +ARG ARCH=x86_64 RUN \ echo "**** install build packages ****" && \ @@ -41,7 +43,7 @@ RUN \ taglib-dev \ tar && \ apk add --no-cache \ - --repository http://nl.alpinelinux.org/alpine/edge/testing \ + --repository http://nl.alpinelinux.org/alpine/edge/community \ mxml-dev && \ echo "**** make antlr wrapper ****" && \ mkdir -p \ @@ -70,6 +72,13 @@ RUN \ DAAPD_RELEASE=$(curl -sX GET "https://api.github.com/repos/ejurgensen/forked-daapd/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ + curl -L https://github.com/mopidy/libspotify-archive/blob/master/libspotify-${LIBSPOTIFY_VERSION}-Linux-${ARCH}-release.tar.gz?raw=true | tar -xzf- -C /tmp/source/ && \ + mv /tmp/source/libspotify* /tmp/source/libspotify && \ + sed -i 's/ldconfig//' /tmp/source/libspotify/Makefile && \ + make -C /tmp/source/libspotify prefix=/tmp/libspotify-build install && \ + rm -rf /tmp/source/libspotify && \ + export LIBSPOTIFY_CFLAGS="-I/tmp/libspotify-build/include" && \ + export LIBSPOTIFY_LIBS="/tmp/libspotify-build/lib/libspotify.so" && \ curl -o \ /tmp/source/forked.tar.gz -L \ "https://github.com/ejurgensen/forked-daapd/archive/${DAAPD_RELEASE}.tar.gz" && \ @@ -80,11 +89,11 @@ RUN \ autoreconf -i -v && \ ./configure \ --build=$CBUILD \ - --disable-avcodecsend \ --enable-chromecast \ --enable-itunes \ --enable-lastfm \ --enable-mpd \ + --enable-spotify \ --host=$CHOST \ --infodir=/usr/share/info \ --localstatedir=/var \ @@ -123,12 +132,13 @@ RUN \ sqlite \ sqlite-libs && \ apk add --no-cache \ - --repository http://nl.alpinelinux.org/alpine/edge/testing \ + --repository http://nl.alpinelinux.org/alpine/edge/community \ mxml # copy buildstage and local files COPY --from=buildstage /tmp/daapd-build/ / COPY --from=buildstage /tmp/antlr3c-build/ / +COPY --from=buildstage /tmp/libspotify-build/ / COPY root/ / # ports and volumes diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 1cdb9c5..7d88e84 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -41,7 +41,7 @@ RUN \ taglib-dev \ tar && \ apk add --no-cache \ - --repository http://nl.alpinelinux.org/alpine/edge/testing \ + --repository http://nl.alpinelinux.org/alpine/edge/community \ mxml-dev && \ echo "**** make antlr wrapper ****" && \ mkdir -p \ @@ -123,7 +123,7 @@ RUN \ sqlite \ sqlite-libs && \ apk add --no-cache \ - --repository http://nl.alpinelinux.org/alpine/edge/testing \ + --repository http://nl.alpinelinux.org/alpine/edge/community \ mxml # copy buildstage and local files diff --git a/Dockerfile.armhf b/Dockerfile.armhf index 5a0c14e..09401bf 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -2,6 +2,8 @@ FROM lsiobase/alpine:arm32v7-3.12 as buildstage ############## build stage ############## ARG DAAPD_RELEASE +ARG LIBSPOTIFY_VERSION=12.1.51 +ARG ARCH=armv7 RUN \ echo "**** install build packages ****" && \ @@ -41,7 +43,7 @@ RUN \ taglib-dev \ tar && \ apk add --no-cache \ - --repository http://nl.alpinelinux.org/alpine/edge/testing \ + --repository http://nl.alpinelinux.org/alpine/edge/community \ mxml-dev && \ echo "**** make antlr wrapper ****" && \ mkdir -p \ @@ -70,6 +72,11 @@ RUN \ DAAPD_RELEASE=$(curl -sX GET "https://api.github.com/repos/ejurgensen/forked-daapd/releases/latest" \ | awk '/tag_name/{print $4;exit}' FS='[""]'); \ fi && \ + curl -L https://github.com/mopidy/libspotify-archive/blob/master/libspotify-${LIBSPOTIFY_VERSION}-Linux-${ARCH}-release.tar.gz?raw=true | tar -xzf- -C /tmp/source/ && \ + mv /tmp/source/libspotify* /tmp/source/libspotify && \ + sed -i 's/ldconfig//' /tmp/source/libspotify/Makefile && \ + make -C /tmp/source/libspotify prefix=/tmp/libspotify-build install && \ + rm -rf /tmp/source/libspotify && \ curl -o \ /tmp/source/forked.tar.gz -L \ "https://github.com/ejurgensen/forked-daapd/archive/${DAAPD_RELEASE}.tar.gz" && \ @@ -123,12 +130,13 @@ RUN \ sqlite \ sqlite-libs && \ apk add --no-cache \ - --repository http://nl.alpinelinux.org/alpine/edge/testing \ + --repository http://nl.alpinelinux.org/alpine/edge/community \ mxml # copy buildstage and local files COPY --from=buildstage /tmp/daapd-build/ / COPY --from=buildstage /tmp/antlr3c-build/ / +COPY --from=buildstage /tmp/libspotify-build/ / COPY root/ / # ports and volumes diff --git a/README.md b/README.md index d40f455..0b44b4f 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **06.10.20:** - Enabled Spotify on Alpine 3.12 for X86_64 and ARMv7. * **01.06.20:** - Rebasing to alpine 3.12. * **16.01.20:** - Rebase to alpine linux 3.11 and build antlr3c from source. * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. diff --git a/readme-vars.yml b/readme-vars.yml index 9d1bc8c..85db87d 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -53,6 +53,7 @@ app_setup_block: | # changelog changelogs: + - { date: "06.10.20:", desc: "Enabled Spotify on Alpine 3.12 for X86_64 and ARMv7." } - { date: "01.06.20:", desc: "Rebasing to alpine 3.12." } - { date: "16.01.20:", desc: "Rebase to alpine linux 3.11 and build antlr3c from source." } - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." }