Here's the script I used to build the most recent mixx bundle.

It will likely only work on 10.5 and i386.



#!/bin/bash

# TODO libmad and fftw have optimized asm, it might be possible to build
# i386 & ppc seperately with asm and then lipo them together

MIXXXURI="http://downloads.mixxx.org/mixxx-1.7.0-beta1/ 
mixxx-1.7.0~beta1-src.tar.gz"
LSFHDRURI="http://supercollider.svn.sourceforge.net/viewvc/supercollider/trunk/libsndfile/sndfile.h
 
"
LSFBINURI="http://supercollider.svn.sourceforge.net/viewvc/supercollider/trunk/libsndfile/libsndfile.a
 
"
LFLACURI="http://softlayer.dl.sourceforge.net/sourceforge/flac/flac-1.2.1.dmg 
"

# pkgs that do a simple config/make
PKGS0=(
     "PortAudio"
     "S"
     "http://www.portaudio.com/archives/pa_snapshot.tgz";
     "pa_snapshot.tgz"
     "portaudio"
     "/lib/libportaudio.2.0.0.dylib"
     "--disable-mac-universal"
)
PKGS1=(
     "LibFFTW"
     "S"
     "http://www.fftw.org/fftw-3.2.1.tar.gz";
     "fftw-3.2.1.tar.gz"
     "fftw-3.2.1"
     "/lib/libfftw3.a"
     ""
)
PKGS2=(
     "LibMP4v2"
     "S"
     "http://resare.com/libmp4v2/dist/libmp4v2-1.5.0.1.tar.bz2";
     "libmp4v2-1.5.0.1.tar.bz2"
     "libmp4v2-1.5.0.1"
     "/lib/libmp4v2.a"
     ""
)
PKGS3=(
     "LibFAAD2"
     "S"
     "http://softlayer.dl.sourceforge.net/sourceforge/faac/faad2-2.7.tar.bz2 
"
     "faad2-2.7.tar.bz2"
     "faad2-2.7"
     "/lib/libfaad.a"
     ""
)
# pkgs that need autotools updates before config/make
PKGS4=(
     "libid3tag"
     "U"
     
"http://softlayer.dl.sourceforge.net/sourceforge/mad/libid3tag-0.15.1b.tar.gz 
"
     "libid3tag-0.15.1b.tar.gz"
     "libid3tag-0.15.1b"
     "/lib/libid3tag.0.dylib"
     ""
)
PKGS5=(
     "libmad"
     "U"
     "http://softlayer.dl.sourceforge.net/sourceforge/mad/libmad-0.15.1b.tar.gz 
"
     "libmad-0.15.1b.tar.gz"
     "libmad-0.15.1b"
     "/lib/libmad.0.dylib"
     ""
)
PKGS6=(
     "libogg"
     "U"
     "http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz";
     "libogg-1.1.3.tar.gz"
     "libogg-1.1.3"
     "/lib/libogg.a"
     ""
)
PKGS7=(
     "libvorbis"
     "U"
     "http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz";
     "libvorbis-1.2.0.tar.gz"
     "libvorbis-1.2.0"
     "/lib/libvorbis.a"
     ""
)
# why oh why can't bash just support multi-dimentionsal arrays

IDIR="`pwd`/libs"
OWD="`pwd`"


UNICFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
     -arch ppc -arch i386 -mmacosx-version-min=10.4 \
     -L${IDIR}/lib -I${IDIR}/include"
UNILDFLAGS="-arch ppc -arch i386"

I386CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
     -arch i386 -mmacosx-version-min=10.4"
I386LDFLAGS="-arch i386"

PPCFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
     -arch ppc -mmacosx-version-min=10.4"
PPCLDFLAGS="-arch ppc"

export MACOSX_DEPLOYMENT_TARGET=10.4
export CFLAGS=$UNICFLAGS
export CXXFLAGS=$UNICFLAGS
export LDFLAGS=$UNILDFLAGS

mkdir $IDIR >& /dev/null

for num in {0..7} ; do
     arrnm=PKGS${num}[*]
     arr=(${!arrnm})
     pkgname=${arr[0]}
     build_type=${arr[1]}
     uri=${arr[2]}
     archive=${arr[3]}
     srcdir=${arr[4]}
     instfile=${arr[5]}
     extra_conf=${arr[6]}

     cd $OWD

     # fetch the archive if we don't have it already
     [ -f $archive ] || curl -o $archive $uri

     # check if we've already installed the pkg, if not build/install
     if [ ! -f "${IDIR}${instfile}" ] ; then
         echo "========= Building $pkgname ========"
         rm -rf $srcdir
         tar -xf $archive
         cd $srcdir
         if [[ "$build_type" == "U" ]] ; then
             aclocal
             automake --gnu --add-missing
             autoconf
             glibtoolize --force
         fi
         ./configure --disable-dependency-tracking --prefix=$IDIR  
$extra_conf
         make -j2
         make install
     fi
done

### can't build universal libsndfile apparently, wtg developer
if [ ! -f "$IDIR/lib/libsndfile.a" ] ; then
     echo "========= downloading binary build of libsndfile ========"
     curl -o $IDIR/lib/libsndfile.a $LSFBINURI
     curl -o $IDIR/include/sndfile.h $LSFHDRURI
fi


if [ ! -f "$OWD/flac/usr/local/lib/libFLAC.a" ] ; then
     LFLACARC="${LFLACURI##*\/}"
     echo "========= downloading binary build of flac ========"
     cd $OWD
     [ -f $LFLACARC ] || curl -o $LFLACARC $LFLACURI
     mntdir=$(hdid $LFLACARC | grep Apple_HFS | awk '{print $3}')

     mkdir flac
     cd flac
     #gzcat /Volumes/flac-1.2.1/flac-1.2.1.mpkg/Contents/Packages/ 
ogg-1.1.3.pkg/Contents/Resources/ogg-1.1.3.pax.gz | pax -r
     gzcat /Volumes/flac-1.2.1/flac-1.2.1.mpkg/Contents/Packages/ 
flac-1.2.1.pkg/Contents/Resources/flac-1.2.1.pax.gz | pax -r

     diskutil eject $mntdir
fi


# deps finally done

cd $OWD
echo "========= Building Mixxx ========"
MIXXXARC="${MIXXXURI##*\/}"
MIXXXSRC="${MIXXXARC%*-src.tar.gz}"
[ -f $MIXXXARC ] || curl -o $MIXXXARC $MIXXXURI
#rm -rf $MIXXXSRC
#tar -xzf $MIXXXARC
cd $MIXXXSRC
# change QT dir in src/Sconscript
# add env.Append lines to src/Sconscript (the perl bit is necessary  
because sed won't expand \t)
#sed -i -e "s:\'osx\'\: \'\/usr\/local\/.*:\'osx\'\: \'\/usr\/local\/ 
Qt-4.5\/\',:" \
#    src/SConscript
#sed -i -e "s:-Wl,-rpath.*lib:-arch ppc -arch i386:" \
#    src/SConscript
sed -i -e '153s/.uint32_t\*.//' src/m4a/mp4-mixxx.cpp
#perl -pi -le 'print "\tenv.Append\(LIBPATH = [\047'${IDIR}'/lib 
\047]\)" if $. == 462' src/SConscript
#perl -pi -le 'print "\tenv.Append\(CPPPATH = [\047'${IDIR}'/include 
\047]\)" if $. == 463' src/SConscript

# these vars are for mixxx only
export CCFLAGS=$UNICFLAGS
export CXXFLAGS=$UNIFLAGS
export LINKFLAGS=$UNILDFLAGS
export LIBPATH="${IDIR}/lib"
export CPPPATH="${IDIR}/include"

echo "LIBPATH=$LIBPATH"

scons optimize=1 m4a=1
scons bundle




------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to