FWIW, here's the script I use, it takes a preexisting src dir or a url to a tarball as a parameter, then downloads/compiles all the deps. This is what I use to create the releases.

#!/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

SFBASEURI="http://downloads.sourceforge.net/project";
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="${SFBASEURI}/flac/flac-darwin/flac-1.2.1-darwin-ppc%2Bi386/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.2.tar.gz";
    "fftw-3.2.2.tar.gz"
    "fftw-3.2.2"
    "/lib/libfftw3.a"
    ""
)
PKGS2=(
    "LibMP4v2"
    "CLEANENV"
    "${SFBASEURI}/mpeg4ip/mpeg4ip/1.5.0.1/mpeg4ip-1.5.0.1.tar.gz"
    "mpeg4ip-1.5.0.1.tar.gz"
    "mpeg4ip-1.5.0.1"
    "/lib/libmp4v2.a"
    "--enable-ub=i386,ppc"
)
PKGS3=(
    "LibFAAD2"
    "S"
    "${SFBASEURI}/faac/faad2-src/faad2-2.7/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"
    "${SFBASEURI}/mad/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz"
    "libid3tag-0.15.1b.tar.gz"
    "libid3tag-0.15.1b"
    "/lib/libid3tag.0.dylib"
    ""
)
PKGS5=(
    "libmad"
    "U"
    "${SFBASEURI}/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz"
    "libmad-0.15.1b.tar.gz"
    "libmad-0.15.1b"
    "/lib/libmad.0.dylib"
    "--disable-fpm"
)
PKGS6=(
    "libogg"
    "U"
    "http://downloads.xiph.org/releases/ogg/libogg-1.1.4.tar.gz";
    "libogg-1.1.4.tar.gz"
    "libogg-1.1.4"
    "/lib/libogg.a"
    ""
)
PKGS7=(
    "libvorbis"
    "S"
    "http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.3.tar.gz";
    "libvorbis-1.2.3.tar.gz"
    "libvorbis-1.2.3"
    "/lib/libvorbis.a"
    ""
)
PKGS8=(
    "portmidi"
    "S"
    "${SFBASEURI}/portmedia/portmidi/200/portmidi-src-200.zip"
    "portmidi-src-200.zip"
    "portmidi"
    "/lib/libportmidi"
    ""
)
# why oh why can't bash just support multi-dimentionsal arrays

die() {
        echo $*
        exit 1
}

fetch_unpack() {
    archive=$1
    uri=$2
    srcdir=$3

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

    # FIXME reinstate this check
    #file $archive | grep -q compressed || \
    #   die "not a compressed file - maybe the URL changed"

    rm -rf $srcdir
    if [ `echo $archive | grep -q 'zip$' ; echo $?` -eq 0 ] ; then
        unzip $archive || die "failed to extract $archive"
    elif [ `echo $archive | grep -q '.tar.' ; echo $?` -eq 0 ] ; then
        tar -xf $archive || die "failed to extract $archive"
    else
        die "unknown archive type"
    fi
}

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

set -x

mkdir $IDIR >& /dev/null

for num in {0..1} ; 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

    # check if we've already installed the pkg, if not build/install
    if [ ! -f "${IDIR}${instfile}" ] ; then
        echo "========= Building $pkgname ========"

        fetch_unpack $archive $uri $srcdir
        cd $srcdir

        if [[ "$build_type" == "U" ]] ; then
            aclocal || die "failed to run aclocal for $pkgname"
automake --gnu --add-missing #|| die "failed to run automake for $pkgname"
            autoconf || die "failed to run autoconf for $pkgname"
glibtoolize --force || die "failed to run glibtoolize for $pkgname"
        fi
        if [[ "$build_type" == "CLEANENV" ]] ; then
            unset CFLAGS
            unset CPPFLAGS
            unset LDFLAGS
        else
            export CFLAGS=$UNICFLAGS
            export CXXFLAGS=$UNICFLAGS
            export LDFLAGS=$UNILDFLAGS
        fi
        ./configure  --prefix=$IDIR $extra_conf || \
                die "$pkgname: failed to run configure"
        make -k -j2 || die "$pkgname: make failed"
        make install || die "$pkgname: make install failed"
    fi
done



### can't build universal libsndfile apparently, wtg developer

#    echo "========= Building libsndfile ========"
#    LSFARC="${LSFURI##*\/}"
#    LSFSRC="${LSFARC%*.tar.gz}"
#    cd $OWD
#    [ -f $LSFARC ] || curl -o $LSFARC $LSFURI
#    rm -rf $LSFSRC
#    tar -xzf $LSFARC
#    cd $LSFSRC
#    CFLAGS=$I386CFLAGS LDFLAGS=$I386LDFLAGS ./configure \
#        --disable-dependency-tracking --prefix=$OWD/tmp/i386 \
#        --target=i386-apple-darwin
#    CFLAGS=$I386CFLAGS LDFLAGS=$I386LDFLAGS make -j2
#    make install
#
#    cd $OWD
#    rm -rf $LSFSRC
#    tar -xzf $LSFARC
#    cd $LSFSRC
#    CFLAGS=$PPCCFLAGS LDFLAGS=$PPCLDFLAGS ./configure \
#        --disable-dependency-tracking --prefix=$OWD/tmp/ppc \
#        --target=powerpc-apple-darwin
#    CFLAGS=$PPCCFLAGS LDFLAGS=$PPCLDFLAGS make
#    #make install

if [ ! -f "$IDIR/lib/libsndfile.a" ] ; then
    echo "========= downloading binary build of libsndfile ========"
    curl -L -o $IDIR/lib/libsndfile.a $LSFBINURI
    curl -L -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 -L -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
#MIXXXSRC="mixxx-1.7/mixxx"
#rm -rf $MIXXXSRC
#tar -xzf $MIXXXARC
if [ -d $1 ] ; then
        echo "Using $1 as Mixxx SRC DIR"
        MIXXXSRC=$1
else
        echo "Assuming $1 is a url to a tarball, will fetch and build that"
        curl -L -o `basename $1` $1
        tar -xf `basename $1`
        if [ -d `basename $1 | sed 's:.tar.*::'` ] ; then
                MIXXXSRC=`basename $1 | sed 's:.tar.*::'`
        fi
fi

cd $MIXXXSRC

#if [ -d "${MIXXXSRC}/../.bzr" ] ; then
        #bzr update
#fi

# 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
#-Wl,-rpath,$QTDIR/lib
sed -i bak -e 's:-W.*rpath.*lib:-arch ppc -arch i386:g' -e 's:Quicktime:QuickTime:g' src/SConscript || die "sed failed" sed -i bak -e 's:-W.*rpath.*lib:-arch ppc -arch i386:g' -e 's:Quicktime:QuickTime:g' plugins/soundsourcem4a/SConscript || die "sed failed"
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"

MIXVER="$(grep VERSION src/defs_version.h | cut -f3 -d' ' | sed 's:[^\.0-9~A-Za-z]::g')"

#scons qtdir=/usr clean || exit
scons optimize=1 m4a=0 qtdir=/usr || exit
scons optimize=1 m4a=0 qtdir=/usr bundle || exit

touch osx_build/Mixxx.app/Contents/Resources/qt.conf

mkdir ${OWD}/dmg_cont
cp -R \
        LICENSE \
        README \
        Mixxx-Manual.pdf \
        osx_build/Mixxx.app \
        ${OWD}/dmg_cont

rm -rf ${OWD}/dmg_cont/Applications
/usr/bin/osascript <<EOT
tell application "Finder"
    set macSrcPath to POSIX file "/Applications" as text
    set macDestPath to POSIX file "${OWD}/dmg_cont" as text
    make new alias file to folder macSrcPath at folder macDestPath
end tell
EOT

DMGSIZE="$(( $(du -sm ${OWD}/dmg_cont | cut -f1) + 10))"

hdiutil create ${OWD}/Mixxx.dmg -megabytes $DMGSIZE \
        -ov \
        -fs HFS+ \
        -volname Mixxx \
        -attach

cp -Rp ${OWD}/dmg_cont/* /Volumes/Mixxx

hdiutil eject /Volumes/Mixxx

cd ${OWD}
zip -9 Mixxx.zip Mixxx.dmg

EOF

On 7/20/2010 11:53 AM, Bruno Buccolo wrote:
Hey Garth,

I gave up using Mixxx in my mac because I was struggling to get it right.
This is a fresh install of Snow Leopard (64bits), without any libs installed, MacPorts or by hand.
Running Mixxx.app throws:

dyld: Library not loaded: @executable_path/../Frameworks/libportmidi.dylib
Referenced from: /Users/brunobuccolo/Downloads/./Mixxx.app/Contents/MacOS/mixxx
  Reason: no suitable image found.  Did find:
/usr/local/lib/libportmidi.dylib: no matching architecture in universal wrapper
Trace/BPT trap

I'm not sure about what to do with that, maybe some 32/64 bit incompatibility?

Cheers!

On Jul 20, 2010, at 5:35 AM, Garth Dahlstrom wrote:

Yeah, yeah, I know I'll probably get flamed for this (because "macports sucks")... but you know me I'm lazy, and I really don't like managing tarball compiles of deps...

I've thrown up a macports based OSX build of Mixxx/Trunk in http://mixxx.org/packages/osx/ -- if someone without MacPorts could try it and let me know if it works...

There were something like 12 lines of changes I had to make to SConscript and SConscript.env, a couple of lines of hack to otool.py (to work around a phantom depend on libportmidi)... and there was a manual step of copying qmenu.nib into the app bundle...

Anyway if the method is of interest to others I can throw a patch on the list after some sleep.

Cheers,

-G
------------------------------------------------------------------------------
This SF.net <http://SF.net> email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first <http://sprint.com/first> -- http://p.sf.net/sfu/sprint-com-first_______________________________________________
Mixxx-devel mailing list
[email protected] <mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Bruno Buccolo




------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first


_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to