/
bundleapp.sh
executable file
·81 lines (63 loc) · 3.04 KB
/
bundleapp.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
# Helper script for bundling the application on OS X
echo "Bundling Doomsday.app..."
CP="cp -fRp"
SRCDIR=$1
echo "Source directory: $SRCDIR"
BUILDDIR=engine
if [ ! -e $BUILDDIR/doomsday.app ]; then
echo "Built product not found, skipping bundling."
exit
fi
mv $BUILDDIR/doomsday.app $BUILDDIR/Doomsday.app
APPDIR=$BUILDDIR/Doomsday.app/Contents
echo "Bundle directory: $APPDIR"
echo "Clearing existing bundles..."
rm -rf $BUILDDIR/*.bundle
echo "Copying server..."
$CP server/doomsday-server $APPDIR/Resources
echo "Copying bundles from plugins..."
PLUGDIR=$APPDIR/DengPlugins
rm -rf $PLUGDIR
mkdir -p $PLUGDIR
$CP plugins/dehread/dehread.bundle $PLUGDIR/
$CP plugins/wadmapconverter/wadmapconverter.bundle $PLUGDIR/
$CP plugins/doom/doom.bundle $PLUGDIR/
$CP plugins/heretic/heretic.bundle $PLUGDIR/
$CP plugins/hexen/hexen.bundle $PLUGDIR/
$CP plugins/doom64/doom64.bundle $PLUGDIR/
$CP plugins/fmod/audio_fmod.bundle $PLUGDIR/
# Tools
#$CP $SRCDIR/../tools/wadtool/wadtool $APPDIR/Resources
$CP $SRCDIR/../tools/texc/texc $APPDIR/Resources
$CP $SRCDIR/../tools/md2tool/md2tool $APPDIR/Resources
if [ -e plugins/fluidsynth/audio_fluidsynth.bundle ]; then
$CP plugins/fluidsynth/audio_fluidsynth.bundle $PLUGDIR/
echo "Installing deps for audio_fluidsynth..."
FWDIR=$BUILDDIR/Doomsday.app/Contents/Frameworks
cp /usr/local/lib/libglib-2.0.0.dylib $FWDIR
cp /usr/local/lib/libgthread-2.0.0.dylib $FWDIR
cp /usr/local/Cellar/gettext/0.18.1.1/lib/libintl.8.dylib $FWDIR
chmod u+w $FWDIR/libglib-2.0.0.dylib $FWDIR/libgthread-2.0.0.dylib $FWDIR/libintl.8.dylib
# IDs
install_name_tool -id @executable_path/../Frameworks/libglib-2.0.0.dylib $FWDIR/libglib-2.0.0.dylib
install_name_tool -id @executable_path/../Frameworks/libgthread-2.0.0.dylib $FWDIR/libgthread-2.0.0.dylib
install_name_tool -id @executable_path/../Frameworks/libintl.8.dylib $FWDIR/libintl.8.dylib
# glib-2.0.0
install_name_tool -change /usr/local/Cellar/gettext/0.18.1.1/lib/libintl.8.dylib \
@executable_path/../Frameworks/libintl.8.dylib $FWDIR/libglib-2.0.0.dylib
# gthread-2.0.0
install_name_tool -change /usr/local/Cellar/glib/2.32.3/lib/libglib-2.0.0.dylib \
@executable_path/../Frameworks/libglib-2.0.0.dylib $FWDIR/libgthread-2.0.0.dylib
install_name_tool -change /usr/local/Cellar/gettext/0.18.1.1/lib/libintl.8.dylib \
@executable_path/../Frameworks/libintl.8.dylib $FWDIR/libgthread-2.0.0.dylib
# audio_fluidsynth
DSFS=$PLUGDIR/audio_fluidsynth.bundle/audio_fluidsynth
install_name_tool -change /usr/local/lib/libglib-2.0.0.dylib \
@executable_path/../Frameworks/libglib-2.0.0.dylib $DSFS
install_name_tool -change /usr/local/lib/libgthread-2.0.0.dylib \
@executable_path/../Frameworks/libgthread-2.0.0.dylib $DSFS
install_name_tool -change /usr/local/Cellar/gettext/0.18.1.1/lib/libintl.8.dylib \
@executable_path/../Frameworks/libintl.8.dylib $DSFS
fi
echo "Bundling done."