FreeBoB on Arch Linux

From FreeBoB

Table of contents

Prerequisities

FreeBoB needs a couple of support libraries to run. These are alsa-lib (http://archlinux.org/packages/4200/), libxml2 (http://archlinux.org/packages/4133/), libraw1394 (http://archlinux.org/packages/838/), libiec61883 (http://archlinux.org/packages/11514/) and libavc1394 (http://archlinux.org/packages/3345/).

All are included as dependencies in the libfreebob package, so they will be installed automatically during the build process. libraw1394, libavc1394 and libiec61883 are in the extra repository, so please be sure you have it present and enabled in your /etc/pacman.conf file.

Note: libfreebob 1.0 requires version 1.1.0 of libiec61883, which, as of now, hasn't made it into the Arch repository yet. Therefore, you have to compile it yourself. You will find a PKGBUILD that can automate the build process for you below. Copy/paste it to a PKGBUILD file somewhere (let's say /var/abs/local/libiec61883) and run makepkg.

Moreover, you will need a kernel driver for your IEEE-1394 controller (usually OHCI 1394) along with raw1394 support (for libraw1394) and an ALSA sequencer module (for the MIDI capability). This is all compiled by default in the stock kernels, but in case you're building your own one, be sure to have the current options configured:

  CONFIG_IEEE1394=m
  CONFIG_IEEE1394_OHCI1394=m
  CONFIG_IEEE1394_RAWIO=m
  CONFIG_SOUND=m
  CONFIG_SND=m
  CONFIG_SND_SEQUENCER=m

libfreebob

PKGBUILD (http://aur.archlinux.org/packages.php?do_Details=1&ID=5338) for the libfreebob library is currently in AUR (http://aur.archlinux.org/packages.php?do_Details=1&ID=5338). In case you have no previous experience with AUR, have a look at this AUR User how-to (http://wiki.archlinux.org/index.php/AUR_User_Guidelines).

If you don't have all the required libraries installed already, use the -S switch when running makepkg in order for them to be installed prior to the build.

So the entire build process could look like this:

  $ cd /var/abs/local
  $ curl http://aur.archlinux.org/packages/libfreebob/libfreebob.tar.gz | tar xz
  $ cd libfreebob
  $ makepkg -S

pacman will usually ask you for your root password during the installation of dependencies.

If there were no errors and everything went ok, you should have a libfreebob package ready, named like libfreebob-1.0.0-1.pkg.tar.gz, so let's install it:

  $ sudo pacman -Up libfreebob-1.0.0-1.pkg.tar.gz

JACK

Although there is a JACK package in the extra repository, the current one (0.102.20-1) is compiled without FreeBoB support. Therefore, you have to recompile it on your own after you've installed libfreebob.

The easiest way to do so is to use the Arch Build System (http://wiki.archlinux.org/index.php/ABS_-_The_Arch_Build_System). First, run abs to have your ABS tree (typically in /var/abs) updated. Then, the process should be pretty straightforward:

  $ cd /var/abs/extra/daemons/jack-audio-connection-kit/
  $ makepkg

If there were no errors and everything went ok, you should have a JACK package ready, named like jack-audio-connection-kit-0.102.20-1.pkg.tar.gz, so let's install it:

  $ sudo pacman -Up jack-audio-connection-kit-0.102.20-1.pkg.tar.gz

Note that the default PKGBUILD disables compile optimization by processor type. Therefore, if you like to have your JACK compiled with -O3 and the likes, replace the --enable-optimization-by-compiler on the configure line in PKGBUILD with --enable-optimization-by-cpu --enable-optimize.

Now there should be nothing stoping you from heading over to the using FreeBoB section.

PKGBUILDs

PKGBUILD for building libiec61883 1.1.0

pkgname=libiec61883
pkgver=1.1.0
pkgrel=1
pkgdesc="A higher level API for streaming DV, MPEG-2 and audio over Linux IEEE 1394"
url="http://www.linux1394.org/"
arch=(i686 x86_64)
license=('LGPL')
depends=('libraw1394')
options=('!libtool')
source=(http://www.linux1394.org/dl/$pkgname-$pkgver.tar.gz)
md5sums=('08f46840912ae2032499186228842a32')

build() {
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/usr
  make || return 1
  make DESTDIR=$startdir/pkg install
}

PKGBUILD for building libfreebob from SVN

pkgname=libfreebob-svn
pkgver=389
pkgrel=2
arch=('i686')
pkgdesc="Aims to provide a generic Linux driver for BeBoB devices."
license=('GPL')
depends=('alsa-lib>=1.0.0' 'glibc' 'libxml2>=2.6.0' 'libxml++2>=2.14.0' 'libraw1394>=1.2.1' 'libiec61883>=1.0.0' 'libavc1394>=0.5.3')
makedepends=('subversion' 'pkgconfig')
provides=('libfreebob')
conflicts=('libfreebob')
options=('!libtool')
url="http://freebob.sourceforge.net/"
source=()
md5sums=()
 
_svntrunk='https://svn.sourceforge.net/svnroot/freebob/trunk/libfreebob/'
_svnmod='libfreebob'

# or if you're after the stable branch
#_svntrunk='https://svn.sourceforge.net/svnroot/freebob/branches/libfreebob-1.0/'
#_svnmod='libfreebob-1.0'

# or the 1.4 branch
#_svntrunk='https://svn.sourceforge.net/svnroot/freebob/branches/libfreebob-1.4/'
#_svnmod='libfreebob-1.4'

build() {
  cd $startdir/src

  msg "Finding out current revision..."
  _svnrev=`svn info $_svntrunk | grep "Last Changed Rev" | grep -o '[0-9]\+'`

  if [ "$_svnrev" = "" ]; then
          error "Could not determine current revision."
          exit
  fi
  msg "Current revision is $_svnrev."
  if [ $FORCE != 1 ] && [ "$_svnrev" == "$pkgver" ] ; then
          error "No new revision available.  (use -f to overwrite)"
          exit
  elif [ "$_svnrev" != "$pkgver" ] ; then
          sed -i "1,11 s|pkgver=$pkgver|pkgver=$_svnrev|" $startdir/PKGBUILD
          sed -i "1,11 s|pkgrel=.*|pkgrel=1|" $startdir/PKGBUILD
  	  pkgver=$_svnrev
  	  pkgrel=1
  fi
  
  svn co $_svntrunk --config-dir ./ --no-auth-cache -r $pkgver
  cd $_svnmod
  
  sed s/AC_CANONICAL_HOST/AC_CANONICAL_TARGET/ -i configure.ac
  autoreconf -f -i -s
  
  ./configure --prefix=/usr --enable-maintainer-mode
  # or if you want more compiler optimization
  #./configure --prefix=/usr --enable-maintainer-mode --enable-optimize
  
  make clean
  make DESTDIR=$startdir/pkg install
  
  sed -i "1,11 s|pkgrel=$pkgrel|pkgrel=`expr $pkgrel + 1`|" $startdir/PKGBUILD
}

PKGBUILD for building JACK from SVN

pkgname=jack-audio-connection-kit-svn
pkgver=984
pkgrel=1
arch=(i686 x86_64)
license=('GPL')
pkgdesc="a low-latency audio server"
depends=('libsndfile' 'bash' 'readline')
makedepends=('subversion' 'doxygen')
conflicts=('jack-audio-connection-kit')
provides=('jack-audio-connection-kit')
backup=(/etc/conf.d/jack-audio-connection-kit)
options=('!libtool')
url="http://jackaudio.org/"
source=()

_svntrunk='http://subversion.jackaudio.org/jack/trunk/jack'
_svnmod='jack'

build() {
  cd $startdir/src 

  msg "Finding out current revision..."
  _svnrev=`svn info $_svntrunk | grep "Last Changed Rev" | grep -o '[0-9]\+'`

  if [ "$_svnrev" = "" ]; then
          error "Could not determine current revision."
          exit
  fi
  msg "Current revision is $_svnrev."
  if [ $FORCE != 1 ] && [ "$_svnrev" == "$pkgver" ] ; then
          error "No new revision available.  (use -f to overwrite)"
          exit
  elif [ "$_svnrev" != "$pkgver" ] ; then
          sed -i "1,11 s|pkgver=$pkgver|pkgver=$_svnrev|" $startdir/PKGBUILD
          sed -i "1,11 s|pkgrel=.*|pkgrel=1|" $startdir/PKGBUILD
  	   pkgver=$_svnrev
  	   pkgrel=1
  fi

  svn co $_svntrunk --config-dir ./ -r $pkgver
  cd $_svnmod

  ./autogen.sh --prefix=/usr --enable-timestamps --enable-posix-shm
  # or if you're after more compiler optimization
  #./autogen.sh --prefix=/usr --enable-optimize --enable-optimization-by-cpu --enable-timestamps --enable-posix-shm

  msg "Starting make..."  
 
  make || return 1
  make DESTDIR=$startdir/pkg install
  
  sed -i "1,11 s|pkgrel=$pkgrel|pkgrel=`expr $pkgrel + 1`|" $startdir/PKGBUILD
}