How to install Pianobar on Mac OS X

You will need homebrew to install gnutls unless you want to install it manually. Get homebrew at http://mxcl.github.com/homebrew/

You can either then try brew update to update the homebrew repositories.

To install pianobar using homebrew you can do

brew install pianobar

However, if after installation pianobar is giving you an error, check out the issues at https://github.com/PromyLOPh/pianobar/issues, and if your issue is listed you may need to install the very latest version of pianobar by doing a manual build.

To do this I’d recommend that you remove the homebrew installations of pianobar, and then manually build.

So, to remove the pianobar that was installed with homebrew, type

brew remove --force pianobar

Next see my notes about installing pianobar manually.

// download the root certificates into your home directory as ~/pianobar-cacert.pem
// these are needed to help pianobar make a secure connection to pandora
wget -O ~/pianobar-cacert.pem http://curl.haxx.se/ca/cacert.pem 

// add the path to the pianobar config file
// ================================================================
echo "tls_ca_path = $HOME/pianobar-cacert.pem" >> ~/.config/pianobar/config 

// install the dev tools
// ================================================================
brew install gnutls json-c


// change to your home directory, then clone the latest version of pianobar
// change to the directory created, make pianobar
cd ~
git clone https://github.com/PromyLOPh/pianobar.git
cd pianobar/
make clean && make CFLAGS="-O2 -DNDEBUG -W64"


// run pianobar from the current directory
./pianobar 


// note: just typing "pianobar" instead of "./pianobar" will fail if the current directory is not in your path

//after running pianobar you should get:

Welcome to pianobar (2011.11.09-dev)! Press ? for a list of commands. (i) Login... Ok. (i) Get stations... Ok. 

// you should then be able to run pianobar on subsequent runs
// by typing in ~/pianobar/pianobar no matter what your current directory is

If you’re getting:

Error: Protocol incompatible. Please upgrade libpiano

Then you should check for issues at https://github.com/PromyLOPh/pianobar/

Related Posts:

This entry was posted in Mac, Software, Tech Tips and tagged , , , , . Bookmark the permalink.

6 Responses to How to install Pianobar on Mac OS X

  1. Will says:

    Maybe try opening an issue on the github page

  2. JP says:

    I’m trying to build this, and I’ve tried both manual and homebrew, however I keep getting an error on gpg-error.h:

    In file included from src/libpiano/piano.h:31: /usr/local/include/gcrypt.h:32:10: fatal error: ‘gpg-error.h’ file not found

    include

    Any thoughts?

  3. francisco velazquez says:

    @W thanks! it worked. I hope this is fixed on a brew update.

  4. W says:

    @francisco – edit your ~/.config/pianobar/config file and add

    tls_fingerprint = 2D0AFDAFA16F4B5C0A43F3CB1D4752F9535507C0

  5. W says:

    @francisco – this is an issue with pandora updating their protocol. keep an eye on github as it will first be resolved there :)

  6. francisco velazquez says:

    I followed your guide. My pianobar got the same error you mentioned after updating xcode. I uninstalled like you said, then installed but I received a new error. “TLS handshake failed. I am now reading the github issues and it seems I am not the only one. If you have fixed this new problem, please share your solution. Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *