[GH-ISSUE #142] Dockerfile: Install necessary dependencies for pulseaudio #106

Closed
opened 2026-02-27 19:28:52 +03:00 by kerem · 13 comments
Owner

Originally created by @floli on GitHub (Feb 11, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/142

Currrently, the crosscompile setup at https://github.com/librespot-org/librespot/wiki/Cross-compiling gives instruction how to compile for the portaudio backend and I have no intentions to change the default.
However, it would be nice to also add the dependencies needed to build for pulseaudio, e.g. so that
docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features pulseaudio-backend works. Currently there is libraries not found -lpulse -lpulse-simple at linking.

Originally created by @floli on GitHub (Feb 11, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/142 Currrently, the crosscompile setup at https://github.com/librespot-org/librespot/wiki/Cross-compiling gives instruction how to compile for the portaudio backend and I have no intentions to change the default. However, it would be nice to also add the dependencies needed to build for pulseaudio, e.g. so that ```docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features pulseaudio-backend``` works. Currently there is libraries not found ```-lpulse -lpulse-simple``` at linking.
kerem 2026-02-27 19:28:52 +03:00
Author
Owner

@awiouy commented on GitHub (Feb 11, 2018):

You need libpulse-dev
Add it after https://github.com/librespot-org/librespot/blob/master/contrib/Dockerfile#L25

<!-- gh-comment-id:364783644 --> @awiouy commented on GitHub (Feb 11, 2018): You need `libpulse-dev` Add it after https://github.com/librespot-org/librespot/blob/master/contrib/Dockerfile#L25
Author
Owner

@sashahilton00 commented on GitHub (Feb 12, 2018):

We just need to add this to the Dockerfile dependencies to compile right? If so, create a PR and will test/merge to make sure it doesn't drastically increase docker image build time, then merge.

<!-- gh-comment-id:364805191 --> @sashahilton00 commented on GitHub (Feb 12, 2018): We just need to add this to the Dockerfile dependencies to compile right? If so, create a PR and will test/merge to make sure it doesn't drastically increase docker image build time, then merge.
Author
Owner

@floli commented on GitHub (Feb 12, 2018):

Adding this line

RUN apt-get install -y libpulse-dev libpulse-dev:arm64 libpulse-dev:armel libpulse-dev:armhf libpulse-dev:mipsel

gives me

The following packages have unmet dependencies:
 libpulse-dev:arm64 : Depends: libglib2.0-dev:arm64 but it is not going to be installed
 libpulse-dev:armhf : Depends: libglib2.0-dev:armhf but it is not going to be installed
 libpulse-dev:armel : Depends: libglib2.0-dev:armel but it is not going to be installed
 libpulse-dev:mipsel : Depends: libglib2.0-dev:mipsel but it is not going to be installed

when I add the same line for libglib2.0-dev, I get conflicts

The following packages have unmet dependencies:
 libglib2.0-dev : Conflicts: libglib2.0-dev:arm64 but 2.50.3-2 is to be installed
                  Conflicts: libglib2.0-dev:armhf but 2.50.3-2 is to be installed
                  Conflicts: libglib2.0-dev:armel but 2.50.3-2 is to be installed
                  Conflicts: libglib2.0-dev:mipsel but 2.50.3-2 is to be installed
 libglib2.0-dev:arm64 : Conflicts: libglib2.0-dev but 2.50.3-2 is to be installed
                        Conflicts: libglib2.0-dev:armhf but 2.50.3-2 is to be installed
                        Conflicts: libglib2.0-dev:armel but 2.50.3-2 is to be installed
                        Conflicts: libglib2.0-dev:mipsel but 2.50.3-2 is to be installed

but honestly, I do just some cargo cult changes here, no idea what I am actually doing.

<!-- gh-comment-id:364882745 --> @floli commented on GitHub (Feb 12, 2018): Adding this line ``` RUN apt-get install -y libpulse-dev libpulse-dev:arm64 libpulse-dev:armel libpulse-dev:armhf libpulse-dev:mipsel ``` gives me ``` The following packages have unmet dependencies: libpulse-dev:arm64 : Depends: libglib2.0-dev:arm64 but it is not going to be installed libpulse-dev:armhf : Depends: libglib2.0-dev:armhf but it is not going to be installed libpulse-dev:armel : Depends: libglib2.0-dev:armel but it is not going to be installed libpulse-dev:mipsel : Depends: libglib2.0-dev:mipsel but it is not going to be installed ``` when I add the same line for ```libglib2.0-dev```, I get conflicts ``` The following packages have unmet dependencies: libglib2.0-dev : Conflicts: libglib2.0-dev:arm64 but 2.50.3-2 is to be installed Conflicts: libglib2.0-dev:armhf but 2.50.3-2 is to be installed Conflicts: libglib2.0-dev:armel but 2.50.3-2 is to be installed Conflicts: libglib2.0-dev:mipsel but 2.50.3-2 is to be installed libglib2.0-dev:arm64 : Conflicts: libglib2.0-dev but 2.50.3-2 is to be installed Conflicts: libglib2.0-dev:armhf but 2.50.3-2 is to be installed Conflicts: libglib2.0-dev:armel but 2.50.3-2 is to be installed Conflicts: libglib2.0-dev:mipsel but 2.50.3-2 is to be installed ``` but honestly, I do just some cargo cult changes here, no idea what I am actually doing.
Author
Owner

@plietar commented on GitHub (Feb 12, 2018):

Unfortunately not all debian packages support side by side installation of multiple architecures. Seems like that's the case here.

<!-- gh-comment-id:364908178 --> @plietar commented on GitHub (Feb 12, 2018): Unfortunately not all debian packages support side by side installation of multiple architecures. Seems like that's the case here.
Author
Owner

@sashahilton00 commented on GitHub (Feb 12, 2018):

You might be able to use a Docker ARG to enable the passing of a --build-arg arch=arm64 for example the conditionally install dependencies depending on which architecture you want to build...

<!-- gh-comment-id:364917385 --> @sashahilton00 commented on GitHub (Feb 12, 2018): You might be able to use a Docker ARG to enable the passing of a ```--build-arg arch=arm64``` for example the conditionally install dependencies depending on which architecture you want to build...
Author
Owner

@awiouy commented on GitHub (Feb 12, 2018):

libpulse-dev installs with debian-sid:

--- a/contrib/Dockerfile
+++ b/contrib/Dockerfile
@@ -13,7 +13,7 @@
 # $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabi --no-default-features --features "alsa-backend"
 #
 
-FROM debian:stretch
+FROM debian:sid
 
 RUN dpkg --add-architecture arm64
 RUN dpkg --add-architecture armhf
@@ -23,6 +23,7 @@ RUN apt-get update
 
 RUN apt-get install -y curl git build-essential crossbuild-essential-arm64 crossbuild-essential-armel crossbuild-essential-armhf crossbuild-essential-mipsel
 RUN apt-get install -y libasound2-dev libasound2-dev:arm64 libasound2-dev:armel libasound2-dev:armhf libasound2-dev:mipsel
+RUN apt-get install -y libpulse-dev libpulse-dev:arm64 libpulse-dev:armel libpulse-dev:armhf libpulse-dev:mipsel
 
 RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
 ENV PATH="/root/.cargo/bin/:${PATH}"
<!-- gh-comment-id:365067255 --> @awiouy commented on GitHub (Feb 12, 2018): `libpulse-dev` installs with `debian-sid`: ``` --- a/contrib/Dockerfile +++ b/contrib/Dockerfile @@ -13,7 +13,7 @@ # $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabi --no-default-features --features "alsa-backend" # -FROM debian:stretch +FROM debian:sid RUN dpkg --add-architecture arm64 RUN dpkg --add-architecture armhf @@ -23,6 +23,7 @@ RUN apt-get update RUN apt-get install -y curl git build-essential crossbuild-essential-arm64 crossbuild-essential-armel crossbuild-essential-armhf crossbuild-essential-mipsel RUN apt-get install -y libasound2-dev libasound2-dev:arm64 libasound2-dev:armel libasound2-dev:armhf libasound2-dev:mipsel +RUN apt-get install -y libpulse-dev libpulse-dev:arm64 libpulse-dev:armel libpulse-dev:armhf libpulse-dev:mipsel RUN curl https://sh.rustup.rs -sSf | sh -s -- -y ENV PATH="/root/.cargo/bin/:${PATH}" ```
Author
Owner

@floli commented on GitHub (Feb 13, 2018):

I can confirm that it build and runs just fine with your patch. I just build the armhf version for my Raspi 3 running with Raspian.

<!-- gh-comment-id:365351186 --> @floli commented on GitHub (Feb 13, 2018): I can confirm that it build and runs just fine with your patch. I just build the armhf version for my Raspi 3 running with Raspian.
Author
Owner

@sashahilton00 commented on GitHub (Feb 13, 2018):

For those who wish to cross-compile pulseaudio support, the patch suggested above by @awiouy works. We're not switching the build image to unstable though, so closing this for now.

<!-- gh-comment-id:365406703 --> @sashahilton00 commented on GitHub (Feb 13, 2018): For those who wish to cross-compile pulseaudio support, the patch suggested above by @awiouy works. We're not switching the build image to unstable though, so closing this for now.
Author
Owner

@plietar commented on GitHub (Feb 14, 2018):

What's wrong with switching the build image to unstable? Debian's notion of unstable is definitely good enough for us

<!-- gh-comment-id:365568021 --> @plietar commented on GitHub (Feb 14, 2018): What's wrong with switching the build image to unstable? Debian's notion of unstable is definitely good enough for us
Author
Owner

@awiouy commented on GitHub (Feb 14, 2018):

Workaround indicates that the problem will likely be solved by a stretch upgrade or a buster release. In other words the issue will solve itself.
Building on sid might break or break system dependencies of the compiled code.

<!-- gh-comment-id:365587900 --> @awiouy commented on GitHub (Feb 14, 2018): Workaround indicates that the problem will likely be solved by a stretch upgrade or a buster release. In other words the issue will solve itself. Building on sid might break or break system dependencies of the compiled code.
Author
Owner

@plietar commented on GitHub (Feb 14, 2018):

I doubt this is the sort of thing that gets backported into new stable releases, and a buster release is at least a year or two away.
Does this work on current buster?

<!-- gh-comment-id:365588953 --> @plietar commented on GitHub (Feb 14, 2018): I doubt this is the sort of thing that gets backported into new stable releases, and a buster release is at least a year or two away. Does this work on current buster?
Author
Owner

@unimatrix27 commented on GitHub (Apr 25, 2018):

I have tried to apply this patch to cross compile for Raspberry Pi but there I still get missing -lpulse - I tried to add libpulse-dev_11.1-5+b1_armhf.deb as an additional dependency from Raspbian into the build script for PI, but that did not help. I also tried the other version that I found on raspbian.Mirror.

Any ideas?

<!-- gh-comment-id:384226815 --> @unimatrix27 commented on GitHub (Apr 25, 2018): I have tried to apply this patch to cross compile for Raspberry Pi but there I still get missing -lpulse - I tried to add libpulse-dev_11.1-5+b1_armhf.deb as an additional dependency from Raspbian into the build script for PI, but that did not help. I also tried the other version that I found on raspbian.Mirror. Any ideas?
Author
Owner

@mfeif commented on GitHub (Jun 4, 2018):

The patch works; the compile works, but it's compiled against glibc 2.27, which is not available on my distro (current version of "DietPi") which is at 2.24
:-(

<!-- gh-comment-id:394480419 --> @mfeif commented on GitHub (Jun 4, 2018): The patch works; the compile works, but it's compiled against glibc 2.27, which is not available on my distro (current version of "DietPi") which is at 2.24 :-(
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#106
No description provided.