/
build_package.sh
executable file
·139 lines (125 loc) · 4.9 KB
/
build_package.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/sh
set -e
if [ $# != 3 ]; then
echo "usage: $0 [package] [arch] [prefix]"
exit 1
fi
platform=`uname -s`
if [ "$platform" == "Darwin" ]; then
platform=mac
elif [ "$platform" == "MINGW32_NT-6.1" ]; then
platform=win
else
echo "error: unsupported platform $platform"
exit 1
fi
. ./package_info
package_name=$1
target_arch=$2
base_prefix=$3
if [ "$platform" == "mac" ]; then
target_platform=$target_arch-apple-darwin
export MACOSX_DEPLOYMENT_TARGET=10.5
else
if [ "$target_arch" == "x86_64" ]; then
export PATH=/c/mingw64/bin:$PATH
fi
fi
arch_prefix=$base_prefix/$target_arch
pkgdir=$PWD/packages
patchdir=$PWD/patches
build_base=$PWD
psi_base=$PWD/../..
deps_base=$PWD/deps
get_msys_path() {
if [ `expr index $1 :` -gt 0 ]; then
pdrive=`echo $1 | cut -f 1 --delimiter=:`
prest=`echo $1 | cut -f 2 --delimiter=:`
echo /$pdrive$prest
else
echo $1
fi
}
build_package() {
if [ ! -d "build/$2/$1" ]; then
echo "$1/$2: building..."
mkdir -p build/$2/$1
old_pwd=$PWD
cd build/$2/$1
build_package_$1
cd $old_pwd
else
echo "$1/$2: failed on previous run. remove the \"build/$2/$1\" directory to try again"
exit 1
fi
}
build_package_psi() {
if [ "$platform" == "win" ]; then
if [ "$target_arch" == "x86_64" ]; then
qtdir=$QTDIR64
else
qtdir=$QTDIR32
fi
mqtdir=`get_msys_path $qtdir`
cd $psi_base
PATH=$mqtdir/bin:$PATH ./configure.exe --qtdir=$qtdir --release --with-qca-inc=$deps_base/$qca_win_dir/$target_arch/include --with-qca-lib=$deps_base/$qca_win_dir/$target_arch/lib --with-zlib-inc=$deps_base/$zlib_win_dir/$target_arch/include --with-zlib-lib=$deps_base/$zlib_win_dir/$target_arch/lib --with-aspell-inc=$deps_base/$aspell_win_dir/$target_arch/include --with-aspell-lib=$deps_base/$aspell_win_dir/$target_arch/lib
mingw32-make
mkdir -p $arch_prefix
cp psi.exe $arch_prefix/Psi.exe
cp $mqtdir/bin/QtCore4.dll $arch_prefix
cp $mqtdir/bin/QtNetwork4.dll $arch_prefix
cp $mqtdir/bin/QtXml4.dll $arch_prefix
cp $mqtdir/bin/QtGui4.dll $arch_prefix
mkdir -p $arch_prefix/imageformats
cp $mqtdir/plugins/imageformats/qgif4.dll $arch_prefix/imageformats
cp $mqtdir/plugins/imageformats/qjpeg4.dll $arch_prefix/imageformats
cp $mqtdir/plugins/imageformats/qmng4.dll $arch_prefix/imageformats
cp $deps_base/$qca_win_dir/$target_arch/bin/qca2.dll $arch_prefix
mkdir -p $arch_prefix/crypto
cp $deps_base/$qca_win_dir/$target_arch/plugins/crypto/qca-gnupg2.dll $arch_prefix/crypto
cp $deps_base/$qca_win_dir/$target_arch/plugins/crypto/qca-ossl2.dll $arch_prefix/crypto
cp $deps_base/$zlib_win_dir/$target_arch/bin/zlib1.dll $arch_prefix
cp $deps_base/$aspell_win_dir/$target_arch/bin/libaspell-15.dll $arch_prefix
cp -a $deps_base/$aspell_win_dir/$target_arch/lib/aspell-0.60 $arch_prefix/aspell
cp $deps_base/$openssl_win_dir/$target_arch/bin/libeay32.dll $arch_prefix
cp $deps_base/$openssl_win_dir/$target_arch/bin/ssleay32.dll $arch_prefix
for n in `cat $build_base/gstbundle_libs_win`; do
cp -a $deps_base/$gstbundle_win_dir/$target_arch/bin/$n $arch_prefix
done
mkdir -p $arch_prefix/gstreamer-0.10
for n in `cat $build_base/gstbundle_gstplugins_win`; do
cp -a $deps_base/$gstbundle_win_dir/$target_arch/lib/gstreamer-0.10/$n $arch_prefix/gstreamer-0.10
done
cp $deps_base/$psimedia_win_dir/$target_arch/plugins/gstprovider.dll $arch_prefix
if [ "$target_arch" == "x86_64" ]; then
cp /c/mingw64/bin/libgcc_s_sjlj-1.dll $arch_prefix
cp /c/mingw64/bin/libstdc++-6.dll $arch_prefix
cp /c/mingw64/bin/libwinpthread-1.dll $arch_prefix
else
cp /mingw/bin/libgcc_s_dw2-1.dll $arch_prefix
cp /mingw/bin/libstdc++-6.dll $arch_prefix
cp /mingw/bin/mingwm10.dll $arch_prefix
cp /mingw/bin/pthreadGC2.dll $arch_prefix
fi
cp -a certs $arch_prefix
cp -a iconsets $arch_prefix
cp -a sound $arch_prefix
cp COPYING $arch_prefix
win32/tod README $arch_prefix/ReadMe.txt
win32/tod INSTALL $arch_prefix/Install.txt
mingw32-make distclean
else
if [ "$QT_LIB_PATH" == "" ]; then
QT_LIB_PATH=$QTDIR/lib
fi
cd $psi_base
export DYLD_FRAMEWORK_PATH=$QT_LIB_PATH:$deps_base/$qca_mac_dir/lib:$deps_base/$growl_dir/Framework
./configure --with-qca-inc=$deps_base/$qca_mac_dir/include --with-qca-lib=$deps_base/$qca_mac_dir/lib --with-growl=$deps_base/$growl_dir/Framework --enable-universal
make
fi
}
if [ "$target_arch" != "" ]; then
build_package $package_name $target_arch
else
build_package $package_name uni
fi