Ubuntu 14.04 install Cmus and Lyvid

After searching a while for a commandline music-players for linux and testing them I just settled down with cmus. Cmus is a feature rich music-player built using ncurses which provides a nice commandline based GUI. Since I wanted a lyric module for the player I added lyvi which is a simple command-line lyrics viewer for various audio players.

At first we install cmus:

sudo apt-get install cmus

Alternatively, if you want the latest cmus version you can clone the repository from github and build it yourself.
If you face dependency problems installing cmus be shure that you don’t have hold back packages using dist-upgrade:

sudo apt-get dist-upgrade

Then we install all dependencies of lyvi which are part of the ubuntu repos:

sudo apt-get install cmake libcurl4-openssl-dev sqlite3 libsqlite3-0 python3 python2.7 python3-pip wget git libpcre3-dev libsqlite3-dev libjpeg-dev

The lyvi installation is a bit more work since you need to download and build it yourself, which includes downloading and building some dependencies as well. For this demo I’ll install lyvi into ~/bin which is already part of the PATH variable.

cd ~/bin
git clone https://github.com/ok100/lyvi.git lyvi_
cd lyvi_

Since lyvi has a few dependencies which are not part of the repos we need to download and build them all, for simplicity I’ll give you a small dependency overview:

lyvi
  |__libglyr
       |__glib >= 2.14
            |__libffi-3.1

We now install the packages in reverse order starting with libffi. We download and unpack libffi into ~/bin/lyvi_ and then follow the libffi install instructions.

cd ~/bin/lyvi_
wget ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz
tar -xzf libffi-3.1.tar.gz
cd ~/bin/lyvi_/libffi-3.1/
sed -e '/^includesdir/ s:$(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include:$(includedir):' -i include/Makefile.in && \
sed -e '/^includedir/ s:${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include:@includedir@:' -e 's/^Cflags: -I${includedir}/Cflags:/' -i libffi.pc.in && \
./configure --prefix=/usr --disable-static && \
make
make check
sudo make install

After that we need to download and unpack glib into ~/bin/lyvi_ and follow their install instructions.

cd ~/bin/lyvi_
wget http://ftp.gnome.org/pub/gnome/sources/glib/2.40/glib-2.40.0.tar.xz
tar -xf glib-2.40.0.tar.xz
cd ~/bin/lyvi_/glib-2.40.0
./configure --prefix=/usr --with-pcre=system && \
make
sudo make install

Now that we have all its dependencies we can download and install glyr following their instructions.

cd ~/bin/lyvi_/
git clone https://github.com/sahib/glyr.git
cd ~/bin/lyvi_/glyr
cmake -DCMAKE_INSTALL_PREFIX=/usr && \
make && \
sudo make install

The last step is to download and install lyvi itself, as always following the install instructions.

cd ~/bin/lyvi_
sudo pip3 install cython
sudo pip3 install -r pip_requirements.txt --use-mirrors

After that you are basically finished, for convenience I would recommend to add a small start-script or an alias for lyvi.

echo -e '#!/bin/bash\ncd ~/bin/lyvi_/\npython3 lyvi.py' > ~/bin/lyvi.sh
chmod +x ~/bin/lyvi.sh

If you now run lyvi (typing lyvi.sh) and cmus, lyvi fetches the lyrics for the song cmus is currently playing (see image below). Be aware though that cmus has to be started before lyvi!
Fear Factory - The Industrialist - The Industrialist (2012)_041

For a quick-start with cmus there are many good sources showing an overview of basic usage e.g. [1-2], for an in depth functionality description see the man page [3]. This approach was tested using vagrant and amplifi/ubuntu-desktop-14.04.minimal.

[1] cmus-overview-1
[2] cmus-overview-2
[3] cmus-man

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: