diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rwxr-xr-x | autogen.osx.sh | 4 | ||||
-rwxr-xr-x | autogen.sh | 8 | ||||
-rw-r--r-- | build/osx/README | 70 | ||||
-rwxr-xr-x | build/osx/autogen.sh | 35 | ||||
-rwxr-xr-x | build/osx/build-deps.sh | 123 | ||||
-rw-r--r-- | build/osx/build.env | 18 |
7 files changed, 267 insertions, 3 deletions
@@ -1,3 +1,15 @@ +2008-10-19 Aaron Bockover <abock@gnome.org> + + This commit adds preliminary build scripts/environment/directions for + building Banshee on OS X, based heavily on Eoin's great work on porting + Banshee to OS X. Banshee does not actually build yet on OS X with this + commit, so don't try. This is phase one of merging Eoin's great work + into our trunk. + + * build/osx/*: Scripts and an awesome README for building on OS X + + * autogen.osx.sh: Helper to call into the real OS X autogen wrapper + 2008-10-13 Aaron Bockover <abock@gnome.org> * configure.ac: Support --disable-gnome, should make building on OS X diff --git a/autogen.osx.sh b/autogen.osx.sh new file mode 100755 index 000000000..a6f7393b9 --- /dev/null +++ b/autogen.osx.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +build/osx/autogen.sh + diff --git a/autogen.sh b/autogen.sh index d8b4f72bb..eff796a45 100755 --- a/autogen.sh +++ b/autogen.sh @@ -50,17 +50,19 @@ test -z "$srcdir" && srcdir=. error "Directory \"$srcdir\" does not look like the top-level $PROJECT directory" } +# MacPorts on OS X only seems to have glibtoolize +LIBTOOLIZE=$(basename $(which libtoolize || which glibtoolize)) + check_autotool_version aclocal 1.9 check_autotool_version automake 1.9 check_autotool_version autoconf 2.53 -check_autotool_version libtoolize 1.4.3 +check_autotool_version $LIBTOOLIZE 1.4.3 check_autotool_version glib-gettextize 2.0.0 check_autotool_version intltoolize 0.21.0 check_autotool_version pkg-config 0.14.0 -run libtoolize --force --copy run glib-gettextize --force --copy -run intltoolize --force --copy --automake +run $LIBTOOLIZE --force --copy --automake run aclocal -I build/m4/banshee -I build/m4/shamrock $ACLOCAL_FLAGS run autoconf run autoheader diff --git a/build/osx/README b/build/osx/README new file mode 100644 index 000000000..94e5fa36b --- /dev/null +++ b/build/osx/README @@ -0,0 +1,70 @@ +Building Banshee on Mac OS X 10.5 +================================= + +Dependency Frameworks +--------------------- + + Before building Banshee, you must first install a few dependency + frameworks, namely Mono, Xcode, and a few small bootstrap libraries + from the MacPorts project. + + When installing these frameworks, it is highly recommended that you + leave all installation paths to their defaults. + + Install the frameworks in this order: + + * Xcode (http://developer.apple.com/technology/xcode.html) + * Mono 2.0 (http://mono-project.com/Downloads) + * MacPorts (http://macports.org/install.php) + + +Working Environment +------------------- + + Ensure that whenever you will be working with MacPorts (i.e. + the 'port' command) or building Banshee or any of its dependencies + that you have the /opt/local/bin path set in your PATH. It MUST + come before Mono's framework! + + It is recommended that as a precaution you add this line to your + ~/.bash_profile + + export PATH="/opt/local/bin:$PATH" + + Additionally, there are two helper scripts for actually building + Banshee and any native libraries that will be bundled with it. + These scripts will be covered later. + + +MacPorts Dependencies +--------------------- + + Install the gettext, intltool, glib2, and libtool ports from + MacPorts, in that order. This can be done like this: + + $ sudo port install gettext intltool glib2 libtool + + After this is done, you should not need to worry about the port + command or dealing with MacPorts for building Banshee. + + +Banshee Bundle Dependencies +--------------------------- + + A few libraries need to be built manually, outside of the MacPorts + context. These are libraries that are bundled within Banshee.app + to reduce the runtime dependencies that end users must deal with. + + Once your build environment is set up (as described in the three + sections above), building these bundle dependencies is as easy + as running the build-deps.sh script in this directory. + + +Building Banshee +---------------- + + Once the build environment and the bundled dependencies are built, + as described in the four sections above, building Banshee is as + easy as running the build-banshee.sh script in this directory. + + diff --git a/build/osx/autogen.sh b/build/osx/autogen.sh new file mode 100755 index 000000000..f67b335a5 --- /dev/null +++ b/build/osx/autogen.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +pushd $(dirname $0) &>/dev/null +source build.env + +if [ ! -d $BUILD_PREFIX ]; then + echo "Error: Banshee bundle dependencies do not appear to be built." + echo " please run the build-deps.sh script, and refer to the" + echo " README file for building on Mac OS X." + echo + echo " $(dirname $0)/README" + echo + exit 1 +fi + +pushd ../.. &>/dev/null + +# Fix up the configure.ac script, unfortunately there +# is not an easy way around this; autoconf just sucks +if [ ! -f configure.ac.orig ]; then + cp configure.ac configure.ac.orig + grep -v AM_GCONF_SOURCE_2 < configure.ac.orig > configure.ac +fi + +# Run the upstream autogen +./autogen.sh \ + --disable-mtp \ + --disable-daap \ + --disable-ipod \ + --disable-docs \ + --disable-gnome + +popd &>/dev/null +popd &>/dev/null + diff --git a/build/osx/build-deps.sh b/build/osx/build-deps.sh new file mode 100755 index 000000000..088292e2c --- /dev/null +++ b/build/osx/build-deps.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +GST_DOWNLOAD_URI="http://gstreamer.freedesktop.org/src/%n/%f" +GST_CONFIGURE_ARGS="--disable-gtk-doc" + +TARGETS=( + # name (%n) version (%v) dir (%d) file (%f) download uri configure args + "liboil 0.3.15 %n-%v %d.tar.gz http://liboil.freedesktop.org/download/%f ${GST_CONFIGURE_ARGS}" + "gstreamer 0.10.19 %n-%v %d.tar.gz ${GST_DOWNLOAD_URI} ${GST_CONFIGURE_ARGS}" + "gst-plugins-base 0.10.19 %n-%v %d.tar.gz ${GST_DOWNLOAD_URI} ${GST_CONFIGURE_ARGS}" + "gst-plugins-good 0.10.7 %n-%v %d.tar.gz ${GST_DOWNLOAD_URI} ${GST_CONFIGURE_ARGS}" +) + +# There's probably no need to modify anything below + +VERBOSE=0 +BUILD_LOG=`pwd`/build-log + +pushd $(dirname $0) &>/dev/null +source build.env + +function show_help () { + echo "Usage: $0 [options]" + echo + echo "Available Options:" + echo " -h, --help show this help" + echo " -v, --verbose show all build messages" + echo + exit 1 +} + +for arg in $@; do + case $arg in + -v|--verbose) VERBOSE=1 ;; + -h|--help) show_help ;; + esac +done + +function expand_target_defs () { + for def in $@; do + in_value=$(eval "echo \$$(echo ${def})") + out_value=$(echo "${in_value}" | sed " + s,%n,${TARGET_NAME},g; + s,%v,${TARGET_VERSION},g; + s,%d,${TARGET_DIR},g; + s,%f,${TARGET_FILE},g; + ") + eval $def="${out_value}" + done +} + +function bail () { + echo "ERROR: $1" 1>&2 + exit $2 +} + +function run () { + echo "--> Running: $@" + BAIL_MESSAGE="Failed to run $1 against ${TARGET_NAME}" + if [ $VERBOSE -ne 0 ]; then + $@ || bail "${BAIL_MESSAGE}" $? + else + $@ &>$BUILD_LOG || bail "${BAIL_MESSAGE}" $? + fi +} + +which wget &>/dev/null || bail "You need to install wget (sudo port install wget)" + +SOURCES_ROOT=sources +mkdir -p $SOURCES_ROOT +pushd $SOURCES_ROOT &>/dev/null + +for ((i = 0, n = ${#TARGETS[@]}; i < n; i++)); do + # Break the target definition into its parts + TARGET=(${TARGETS[$i]}) + TARGET_NAME=${TARGET[0]} + TARGET_VERSION=${TARGET[1]} + TARGET_DIR=${TARGET[2]} + TARGET_FILE=${TARGET[3]} + TARGET_URI=${TARGET[4]} + TARGET_CONFIGURE_ARGS="${TARGET[@]:5}" + + # Perform expansion through indirect variable referencing + expand_target_defs TARGET_DIR TARGET_FILE TARGET_URI + + echo "Processing ${TARGET_NAME} ($(($i + 1)) of $n)" + + if [ ! -d $TARGET_DIR ]; then + # Download the tarball + if [ ! -a $TARGET_FILE ]; then + echo "--> Downloading ${TARGET_FILE}..." + wget -q $TARGET_URI || bail "Failed to download: ${TARGET_NAME}" $? + fi + + # Extract the tarball + echo "--> Extracting ${TARGET_FILE}..." + case ${TARGET_FILE#*tar.} in + bz2) TAR_ARGS=jxf ;; + gz) TAR_ARGS=zxf ;; + *) bail "Unknown archive type: ${TARGET_FILE}" 1 ;; + esac + + tar $TAR_ARGS $TARGET_FILE || bail "Could not extract archive: ${TARGET_FILE}" $? + fi + + pushd $TARGET_DIR &>/dev/null + CONFIGURE=./configure + if [ -f ./autogen.sh ]; then + CONFIGURE=./autogen.sh + fi + + run $CONFIGURE --prefix=$BUILD_PREFIX $TARGET_CONFIGURE_ARGS + run make clean + run make -j2 + run make install + popd &>/dev/null +done + +popd &>/dev/null +popd &>/dev/null + +test -f $BUILD_LOG && rm $BUILD_LOG + diff --git a/build/osx/build.env b/build/osx/build.env new file mode 100644 index 000000000..e60f2daec --- /dev/null +++ b/build/osx/build.env @@ -0,0 +1,18 @@ +# Ensure these paths are set to the correct locations of +# the XCode, Mono 2.0, and MacPorts installations +MAC_SDK_PATH="/Developer/SDKs/MacOSX10.4u.sdk" +MONO_SDK_PATH="/Library/Frameworks/Mono.framework/Versions/Current/" +MACPORTS_SDK_PATH="/opt/local/bin" + +# Where GStreamer and other Banshee dependencies that will +# end up being bundled should be installed for the build. +# It's generally a good idea to leave this alone. +BUILD_PREFIX="`pwd`/bundle-deps" + +# Build configuration. Really, no reason to touch this. +export PKG_CONFIG_PATH="/usr/lib/pkgconfig:$MONO_SDK_PATH/lib/pkgconfig:$BUILD_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" +export PATH="$MACPORTS_SDK_PATH:$MONO_SDK_PATH/bin:$PATH" +export LDFLAGS="-L$MONO_SDK_PATH/lib $LDFLAGS" +export CFLAGS="-isysroot $MAC_SDK_PATH -mmacosx-version-min=10.4 -I$MONO_SDK_PATH/include $CFLAGS" +export LD_LIBRARY_PATH="$MONO_SDK_PATH/lib:$LD_LIBRARY_PATH" +export ACLOCAL_FLAGS="-I $MONO_SDK_PATH/share/aclocal" |