1 |
export QTDIR=/usr/local/Trolltech/Qt-4.3.3 |
2 |
export PATH=$QTDIR/bin:$PATH |
3 |
export QMAKESPEC=$QTDIR/mkspecs/macx-g++ |
4 |
export DYLD_LIBRARY_PATH=$QTDIR/lib |
5 |
|
6 |
#export WITH_INSTALL=1 |
7 |
export BUILD_BASE_DIR=$PWD/../temp_build |
8 |
export CONFIG_OPTIONS="--disable-shared" |
9 |
export C_INCLUDE_PATH="$BUILD_BASE_DIR/$BUILD_STYLE/local/include:$QTDIR/include" |
10 |
export CPLUS_INCLUDE_PATH=$C_INCLUDE_PATH |
11 |
export LIBRARY_PATH="$BUILD_BASE_DIR/$BUILD_STYLE/local/lib:$QTDIR/lib" |
12 |
export CFLAGS="-framework CoreFoundation" |
13 |
export CXXFLAGS=$CFLAGS |
14 |
export PKG_CONFIG_PATH="$BUILD_BASE_DIR/$BUILD_STYLE/local/lib/pkgconfig" |
15 |
#export HAVE_UNIX98=1 |
16 |
export UB_PRODUCTS=bin/qsampler.app # Dummy (for 'clean' target) |
17 |
|
18 |
case "$BUILD_STYLE" in |
19 |
*UB) |
20 |
BUILD_STYLE_BASE=${BUILD_STYLE/UB/} |
21 |
if test "x$ACTION" = "xclean"; then |
22 |
source $PROJECT_DIR/autoconf_builder.sh |
23 |
exit 0 |
24 |
fi |
25 |
BUILD_STYLE="${BUILD_STYLE_BASE}ppc" |
26 |
/bin/sh $0 || exit $? |
27 |
BUILD_STYLE="${BUILD_STYLE_BASE}i386" |
28 |
/bin/sh $0 || exit $? |
29 |
BUILD_STYLE="${BUILD_STYLE_BASE}UB" |
30 |
ODIR=`dirname "$0"` |
31 |
cd "$BUILD_BASE_DIR" |
32 |
cp -r "${BUILD_STYLE_BASE}ppc/local/bin/qsampler.app" "${BUILD_STYLE_BASE}UB/local/bin" |
33 |
echo "qsampler.app has been copied to $BUILD_BASE_DIR/$BUILD_STYLE/local/bin" |
34 |
XDIR="local/bin/qsampler.app/Contents/MacOS" |
35 |
lipo -create "${BUILD_STYLE_BASE}ppc/$XDIR/qsampler" "${BUILD_STYLE_BASE}i386/$XDIR/qsampler" -output "$BUILD_STYLE/$XDIR/qsampler" || exit $? |
36 |
# A trick: rename the executable to "qsampler " (note the whitespace) and place a wrapper |
37 |
# script as "qsampler" |
38 |
# cd "$BUILD_STYLE/$XDIR" |
39 |
# mv qsampler "qsampler " |
40 |
# cp "$ODIR/qsampler.wrapper" ./qsampler |
41 |
# chmod +x qsampler |
42 |
|
43 |
# Place the icon file and modify the Info.plist file |
44 |
cd "$BUILD_STYLE/$XDIR/.." # qsampler.app/Contents |
45 |
rm -rf Resources |
46 |
mkdir Resources |
47 |
cp "$ODIR/qsampler.icns" Resources/ |
48 |
mv Info.plist Info.plist~ |
49 |
sed '/CFBundleIconFile/,/<key>/s/<string>.*<\/string>/<string>qsampler.icns<\/string>/' Info.plist~ >Info.plist |
50 |
rm Info.plist~ |
51 |
|
52 |
# Embed the Qt frameworks and plugins |
53 |
if test -e /Library/Frameworks/QtCore.framework; then |
54 |
# Copy frameworks |
55 |
mkdir -p Frameworks |
56 |
rm -rf Frameworks/* |
57 |
QTLIBS="QtCore QtGui QtSvg QtXml" |
58 |
for lib in $QTLIBS; do |
59 |
cp -R /Library/Frameworks/$lib.framework ./Frameworks/ |
60 |
done |
61 |
# Copy plugins |
62 |
rm -rf plugins |
63 |
mkdir -p plugins/imageformats |
64 |
QTPLUGINS="libqgif libqjpeg libqmng libqsvg libqtiff" |
65 |
for plugin in $QTPLUGINS; do |
66 |
cp -R /Developer/Applications/Qt/plugins/imageformats/$plugin.dylib ./plugins/imageformats/ |
67 |
done |
68 |
# Update the install names so that the executable can find the correct frameworks |
69 |
for lib in $QTLIBS; do |
70 |
install_name_tool -change $lib.framework/Versions/4/$lib @executable_path/../Frameworks/$lib.framework/Versions/4/$lib MacOS/qsampler |
71 |
install_name_tool -id @executable_path/../Frameworks/$lib.framework/Versions/4/$lib Frameworks/$lib.framework/Versions/4/$lib |
72 |
for lib2 in $QTLIBS; do |
73 |
install_name_tool -change $lib.framework/Versions/4/$lib @executable_path/../Frameworks/$lib.framework/Versions/4/$lib Frameworks/$lib2.framework/Versions/4/$lib2 |
74 |
done |
75 |
for plugin in $QTPLUGINS; do |
76 |
install_name_tool -change $lib.framework/Versions/4/$lib @executable_path/../Frameworks/$lib.framework/Versions/4/$lib plugins/imageformats/$plugin.dylib |
77 |
done |
78 |
done |
79 |
fi |
80 |
cp -f "$ODIR/linuxsampler.starter" $BUILD_BASE_DIR/$BUILD_STYLE/local/bin/ |
81 |
chmod +x "$BUILD_BASE_DIR/$BUILD_STYLE/local/bin/linuxsampler.starter" |
82 |
echo "Universal binary package qsampler.app has been created in $BUILD_BASE_DIR/$BUILD_STYLE/local/bin" |
83 |
exit 0 |
84 |
;; |
85 |
*ppc) export QMAKE_ARCHS="ppc" ;; |
86 |
*i386) export QMAKE_ARCHS="x86" ;; |
87 |
esac |
88 |
|
89 |
source $PROJECT_DIR/autoconf_builder.sh |
90 |
|
91 |
if test "x$ACTION" != "xclean"; then |
92 |
# "install" |
93 |
mkdir -p "$BUILD_BASE_DIR/$BUILD_STYLE/local/bin" |
94 |
cp -r "$BUILD_DIR/qsampler.app" "$BUILD_BASE_DIR/$BUILD_STYLE/local/bin" |
95 |
echo "qsampler.app has been copied to $BUILD_BASE_DIR/$BUILD_STYLE/local/bin" |
96 |
fi |