Building

From Buzztrax

Revision as of 14:44, 4 December 2015 by Ensonic (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Project components

The projects GIT repository is hosted at github.com. You can browse the repository starting with the main components. These are described on the Architecture page.

The easiest way to build everything from git and keeping it up-to-date is building with #Jhbuild as documented below.

If you have any problems building the project, please let us know (mail us, talk to us on irc or submit a bug report).

Requirements

Mandatory

  • gstreamer >= 1.2 and its plugins (gstreamer, gst-plugins-base and gst-plugins-good).
  • glib, gsf and libxml2 for the core libraries.
  • clutter-gtk and gtk+ for the UI

Optional

  • gst-plugins-ugly: for the use of mp3 recording
  • gst-plugins-bad: extra audio effects
  • gudev and libasound: for interaction controller support
  • orc: for plugin acceleration
  • fluidsynth: to build a relates gstreamer wrapper
  • check: for unit tests

You need also cvs because the autopoint tool from the gettext package needs this. Without cvs you cannot run 'autogen.sh' or 'autoregen.sh' because these tools using gettext and calling indirect the autopoint tool.

Remember to install the -devel or -dev packages from your distribution. Otherwise the build can't find the packages. The end of the configure run will show a summary of the enable features. Since distributions have different naming schemes, we list the actual package names for a few systems below. We happily add more build instructions.

Gentoo Linux

The latest GStreamer packages are in the testing branch.

emerge --oneshot -uD ...

OpenSuSE

The latest GStreamer packages can be found in e.g. the Gnome unstable repository.

zypper install glib2-devel gstreamer-1_0-devel gstreamer-1_0-plugins-base-devel gtk3-devel gtk-doc gudev-devel clutter-devel libgsf-devel orc-devel libasound2-devel
# once we have official packages, this would work too
# zypper si -d buzztrax

Ubuntu /Debian

For ubuntu you can use this ppa repository to get the latest gstreamer releases. For debian stable you can add the backports repository to get the required dependencies.

# ubuntu
sudo add-apt-repository ppa:gstreamer-developers/ppa
sudo apt-get update
sudo apt-get install gtk-doc-tools libglib2.0-dev libgsf-1-dev libgtk-3-dev libclutter-1.0-dev libclutter-gtk-1.0-dev gstreamer1.0-tools  libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgudev-1.0-dev liborc-dev libasound2-dev

# debian wheezy
sudo echo "deb http://http.debian.net/debian wheezy-backports main" >>/etc/apt/sources.list.d/backports.list
sudo apt-get update
sudo apt-get -t wheezy-backports install gtk-doc-tools libglib2.0-dev libgsf-1-dev libgtk-3-dev libclutter-1.0-dev libclutter-gtk-1.0-dev gstreamer1.0-tools  libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgudev-1.0-dev liborc-dev libasound2-dev
# install gstreamer plugins
apt-cache search gstreamer1.0 | grep "plugins-" | egrep -v "(dbg|doc)" | cut -d' ' -f1 | xargs sudo apt-get install

Arch Linux

Use pacman to get the gstreamer packages you want (all dependencies will be downloaded automatically):

 pacman -S gstreamer1.0-base-plugins gstreamer1.0-good-plugins gstreamer1.0-bad-plugins gstreamer1.0-ugly-plugins

MacOSX

The required build tools and dependencies can be installed from fink or mac-ports.

To make autogen.sh work you need a few tweaks. First you need a symlink or shell alias from glibtoolize to libtoolize. In order for autopoint to be found you need to export PATH=${PATH}:/usr/local/opt/gettext/bin.

When running autogen.sh or configure you need to pass --host=x86_64-apple-darwinx - this is to workaround broken cpu detection (uname -p and uname -m contradict on MacOSX).

If you get warnings like "The 'hicolor' theme was not found either, perhaps you need to install it." when running versions <= 0.7 then try this tip - Create ~/.gtkrc-2.0 with the line

 gtk-icon-theme-name = "gnome"

Getting the sources

You can either download stable releases or checkout sources from GIT. If you intend to help us with bug-fixing and development go for the GIT repos:

git clone https://github.com/Buzztrax/buzztrax.git
git clone https://github.com/Buzztrax/buzzmachines.git

Project developers (with commit access) will use:

git clone git@github.com:Buzztrax/buzztrax.git
git clone git@github.com:Buzztrax/buzzmachines.git

Building

You can build both modules independently. The buzzmachines modules has plugins which are automaticaly detected by buzztrax when starting. We supply autogen.sh scripts with each module. You need to run them after checking out the sources from GIT, to bootstrap the build setup. You can pass configure options to autogen.sh. Further it generates a autoregen.sh script, that you can use after doing GIT updates. Building is done with the usual

  # from git
  ./autogen.sh <options>; make; make install
  # from tarball
  ./configure <options>; make; make install

command triplet.

All modules support some extra configure options:

  • --enable-debug: The debug build has logging enabled and uses pedantic compile options.
  • --disable-deprecated: Warn if deprecated API is used (useful for developers).
  • --enable-gtk-doc: Build API docs (and man-pages)

For testing purposes all packages can be installed locally (to $HOME) by passing --prefix=$HOME/buzztrax. Although in that case several environment variables need to be updated (e.g. put them to ~/.profile) - please note that some distibutions use 'lib64' instead of 'lib' when building on a 64bit platform:

  export DEVHELP_SEARCH_PATH="$DEVHELP_SEARCH_PATH:$HOME/buzztrax/share/gtk-doc/html"
  export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOME/buzztrax/lib/pkgconfig"
  export GST_PLUGIN_PATH_1_0="$GST_PLUGIN_PATH_1_0:$HOME/buzztrax/lib/gstreamer-1.0"
  export OMF_DIR="$OMF_DIR:$HOME/buzztrax/share/omf"
  export BSL_SONG_PATH=/windows/D/buzz/ensonic
  export LD_LIBRARY_PATH="$HOME/buzztrax/lib:$LD_LIBRARY_PATH"
  export MANPATH=$MANPATH:$HOME/buzztrax/share/man
 
  if [ -z $XDG_DATA_DIRS ]; then export XDG_DATA_DIRS="/usr/share"; fi
  export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/buzztrax/share"

If you don't specify a prefix, be aware that installation goes to /usr/local (to keep it apart from packaged software). That means you need to run make install as root. Furthermore its likely that you have to export several environment variables, such as

  export GST_PLUGIN_PATH_1_0=/usr/local/lib/gstreamer-1.0

in order to make the plugins installed by buzztrax available. You will see a list of those env-vars at the end of the configure run (or in the block above). If you don't have any buzztrax packages from your distribution installed, you can also use --prefix=/usr to install it into the default location. This way you won't need to set any environment variables.

Note: If you build for a fedora system running 64bit, you will need to also pass --libdir=$prefix/lib64 (if --prefix=/usr). Likewise for an ubuntu (debian) system running 64bit, you will need to pass --libdir=$prefix/lib/x86_64-linux-gnu. If that fails during the make install step - 'libtool: install: error: cannot install `abc.la' to a directory not ending in /usr/lib', run 'make clean'.

Verifying

You can run some checks to test the freshly built buzztrax version, by running

make check

You should see no failed tests in a release.

Troubleshooting

it does not bootsrap (autogen.sh)

Currently, for autogen.sh to run, you need:

  • gtk-doc package installed. Its sometimes called gtk-doc-tools (e.g. Ubuntu, Debian).

it does not configure

./configure: line 24188: syntax error near unexpected token `1.4'
./configure: line 24188: `GTK_DOC_CHECK(1.4)'

If you build from GIT you need to have gtk-doc installed (see previous section). It basically misses the macro defines (e.g. from m4/gtk-doc.m4) and thus leaves them in the shell script.

it does not start

Does it maybe complain about:

buzztrax-edit: error while loading shared libraries: libbtcore.so.0: cannot open shared object file: No such file or directory

If so, run this as root:

ldconfig

This can happen if you installed into a non-standard location.

it does not find simsyn or audiodelay

Have you maybe installed to /usr/local? The default gstreamer plugin path only covers its own install dir (e.g. /usr). Add this to your settings

 export GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0

it does not find any buzzmachines

Run this command in the terminal:

 gst-inspect-1.0 bml

If is says "No such element or plugin 'bml'", check that GST_PLUGIN_PATH is set if you did not install to /usr (used --prefix=/usr on configure or autogen.sh). If that is not the case, run this command in the terminal:

 gst-inspect-1.0 -b

to check if the gstbml plugin got blacklisted. If so and you are on x68 then install the buzz dll as noted in the bml README (see section "windows machines").

the ui shows no machine icons / icon theme errors

Please make sure icons themes work. Check that XDG_DATA_DIRS is set correctly. In my case it is:

 > printenv | grep XDG_DATA
 XDG_DATA_DIRS=/usr/local/share:/usr/share:/home/user/buzztrax/share

You can also check that gtk finds themes:

 > strace -efile 2>strace.log buzztrax-edit
 > grep "index.theme" /strace.log | grep "/usr" | grep "gnome"

Also please try below and tell us what icon-theme gtk is reporting.

GST_DEBUG_NO_COLOR=1 GST_DEBUG="bt-edit:3" buzztrax-edit 2>debug.log
grep "Icon Theme:" debug.log

the help does not work

Try

yelp help:buzztrax-edit

in a terminal or run yelp and type buzztrax-edit in the search field. The main help file is installed to $prefix/share/gnome/help/buzztrax-edit/C/buzztrax-edit.xml Distributions usually use $prefix=/usr and if you build yourself and don't specify a prefix it is /usr/local by convention.

something else does not work

We are trying out best to make the setup and running the application bullet proof. Please talk to us in the case of troubles, so that we can improve this. If you can run the application, getting a logfile can be very valuable for us to figure out what went wrong. You can generate the logfile by starting the application from the terminal as below:

 GST_DEBUG="*:4" GST_DEBUG_NO_COLOR=1 buzztrax-edit 2>debug.log

Then run through the scenario that fails and leave the application. This will produce a large debug.log in the current directory. You can compress the file using gzip/bzip2 or whatever you prefer and mail it to us (look at the top of the page for contact details).

Jhbuild

Jhbuild allows to build and update everything with one command. It will build the latest sources and install everything into a single directory. Jhbuild can be installed using your distributions package manager or built from source.

Building with Jhbuild

We have a module-set in our repository in the build-tools module. The command will setup everything and do an initial build:

# directory where all the source will be checked out
mkdir -p ~/projects/buzztrax
cd ~/projects/buzztrax
curl https://raw.githubusercontent.com/Buzztrax/build-tools/master/jhbuild/install.sh | sh

The install.sh script will also create a build.sh and run.sh script in the current directory. If you want to update the code, just run build.sh.

Building with jhbuild is not much different from building things manually. You need to have the development tools installed. Among those tools you also need: cvs and gtk-doc (It is autopoint that needs cvs; this is hard coded in the autopoint script). We can check if everything is good by running:

jhbuild -f $PWD/buzztrax.jhbuild.rc sysdeps

Adding a --install parameter, will ask the package-manager to install the required dependencies if possible.

If you have all requirements installed, you can run jhbuild (from anywhere):

jhbuild -f $PWD/buzztrax.jhbuild.rc

This will checkout/update all buzztrax modules from git and compile them. After jhbuild is finished, buzztrax is installed in

$PWD/jhbuild/install/

You can launch the composer using:

jhbuild -f $PWD/buzztrax.jhbuild.rc run $PWD/jhbuild/install/bin/buzztrax-edit

If you want to build only one module (for example buzztrax itself and not the dependent libraries) you can call

jhbuild -f $PWD/buzztrax.jhbuild.rc buildone buzztrax

If you want to start over, you can simple remove the jhbuild subdir.

Debugging with Jhbuild

If you want to get strace logs from jhbuild buzztrax, you can do something like this:

jhbuild -f $PWD/buzztrax.jhbuild.rc shell
strace -e file -o /tmp/strace.log $PWD/jhbuild/install/bin/buzztrax-edit

The strace log file can then be found in

/tmp/strace.log

Cleaning up

Early development sometimes leaves traces. We try to collect here what can be safely removed from your system.

before 0.3

  • remove share/mime-info/buzztrax.{keys,mime}

before 0.4

Lots of renaming. Its turned out choosing just 'bt' was a bit blue eyed.

${prefix}/bin/bt-*                             -> ${prefix}/bin/buzztrax-*
${prefix}/include/libbt*                       -> ${prefix}/include/libbuzztrax-*
${prefix}/lib/libbt*                           -> ${prefix}/bin/libbuzztrax-*
${prefix}/lib/songio                           -> ${prefix}/lib/buzztrax-songio
${prefix}/lib/pkgconfig/libbt*.pc              -> ${prefix}/lib/pkgconfig/libbuzztrax-*.pc
${prefix}/share/applications/bsl.desktop       -> ${prefix}/share/applications/buzztrax-songio-buzz.desktop
${prefix}/share/applications/bt-edit.desktop   -> ${prefix}/share/applications/buzztrax-edit.desktop
${prefix}/share/gnome/help/bt-edit             -> ${prefix}/share/gnome/help/buzztrax-edit
$(prefix}/share/gtk-doc/html/bt-*              -> $(prefix}/share/gtk-doc/html/buzztrax-*
${prefix}/share/mime/packages/buzztrax-bsl.xml -> ${prefix}/share/mime/packages/buzztrax-songio-buzz.xml
${prefix}/share/omf/buzztrax/bt-edit           -> ${prefix}/share/omf/buzztrax/buzztrax-edit

You can try this script to remove old files.

before 0.5

Most icons are now part of icon theme. During 0.4 -> 0.5 cycle they got renamed to use a "buzztrax_" prefix to avoid clashes.

before 0.6

The libbuzzmachineloader has been moved to ${prefix}/lib/bml as it is dlopened.

rm ${prefix}/lib/libbuzzmachineloader.*

Also the help catalog was installed into wrong location due to a bug in the scrollkeeper makefile.

rm -rf ${prefix}/share/omf/buzztrax

before 0.9

Most audioplugins have been merged into a single one. The previous ones need to be removed to not clash:

 rm ${prefix}/lib/gstreamer-1.0/libgst{audiodelay,simsyn,wavereplay,wavetabsyn}.so
Support Us

Collaboration

GStreamer Logo
Become a Friend of GNOME
Linux Sound Logo
MediaWiki
Valgrind
GNU Library Public Licence
GNU Free Documentation License 1.2