forked from Tribler/tribler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxpitransmakedistmac.sh
executable file
·92 lines (69 loc) · 2.64 KB
/
xpitransmakedistmac.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
82
83
84
85
86
87
88
89
90
91
#!/bin/sh -x
#
# Written by Riccardo Petrocco
# see LICENSE.txt for license information
#
# Script to build SwarmTransport on Mac
#
# Build notes:
# - using libraries from macbinaries
# - simplejson needs to be installed for py2app to work
# - The latest version of XULrunner, working with the latest
# Firefox, has a bug with libidl:
# - install libidl with macports: /opt/local/bin/port
# - link it: ln -s /opt/local/lib/libintl.8.dylib /opt/local/lib/libintl.3.dylib
#
APPNAME=SwarmPlayer
PYTHON_VER=2.5
PWD:=${shell pwd}
ARCH:=${shell arch}
PYTHON=python${PYTHON_VER}
export LIBRARYNAME=Tribler
xul_dir="../xulrunner-sdk/sdk/bin"
if [ -f $xul_dir/xpidl ]; then
echo "Found XULRUNNER directory $xul_dir"
export XULRUNNER_IDL=../xulrunner-sdk/idl
export XULRUNNER_XPIDL=../xulrunner-sdk/sdk/bin/xpidl
else
echo "|==============================================================================|"
echo "| Failed to locate XULRUNNER directory, please modify the xul_dir variable |"
echo "|==============================================================================|"
exit
fi
# ----- TODO check if we have the macbinaries
macbinaries=${PWD}/macbinaries
echo $macbinaries
if [ ! -d $macbinaries ]; then
echo "No macbinaries"
exit
else
echo "Found macbinaries directory $macbinaries"
fi
# ----- Set python paths TODO dynamic checkout
export PYTHONPATH=$macbinaries:${PWD}:$macbinaries/lib/python2.5/site-packages/
# apparently not needed.. TODO
export DYLD_LIBRARY_PATH=$macbinaries
# ----- Clean up
/bin/rm -rf dist build
# ----- Build
${PYTHON} -OO - < ${LIBRARYNAME}/Transport/Build/Mac/setupBGapp.py py2app
mkdir -p dist/installdir/bgprocess
mv dist/SwarmPlayer.app dist/installdir/bgprocess/.
chmod 777 dist/installdir/bgprocess/SwarmPlayer.app/Contents/MacOS/SwarmPlayer
# ----- Build XPI of SwarmTransport
cp $LIBRARYNAME/Transport/icon.png dist/installdir
cp $LIBRARYNAME/Transport/install.rdf dist/installdir
cp $LIBRARYNAME/Transport/chrome.manifest dist/installdir
cp -rf $LIBRARYNAME/Transport/components dist/installdir
cp -rf $LIBRARYNAME/Transport/skin dist/installdir
cp -rf $LIBRARYNAME/Transport/chrome dist/installdir
rm -rf `find dist/installdir -name .svn`
# ----- Turn .idl into .xpt
export DYLD_LIBRARY_PATH=
$XULRUNNER_XPIDL -m typelib -w -v -I $XULRUNNER_IDL -e dist/installdir/components/tribeIChannel.xpt $LIBRARYNAME/Transport/tribeIChannel.idl
$XULRUNNER_XPIDL -m typelib -w -v -I $XULRUNNER_IDL -e dist/installdir/components/tribeISwarmTransport.xpt $LIBRARYNAME/Transport/tribeISwarmTransport.idl
cd dist/installdir
# ----- Turn installdir into .xpi
zip -9 -r SwarmPlayer.xpi *
mv SwarmPlayer.xpi ..
cd ../..