This repository has been archived by the owner on Sep 29, 2022. It is now read-only.
/
build.sh
106 lines (92 loc) · 2.89 KB
/
build.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
#!/bin/bash
# Compile
# -------
if [ `uname` == Linux ]; then
chmod +x configure
if [ $ARCH == 64 ]; then
MARCH=x86-64
else
MARCH=i686
fi
# Building QtWebKit on CentOS 5 fails without setting these flags
# explicitly. This is caused by using an old gcc version
# See https://bugs.webkit.org/show_bug.cgi?id=25836#c5
CFLAGS="-march=${MARCH}" CXXFLAGS="-march=${MARCH}" \
CPPFLAGS="-march=${MARCH}" LDFLAGS="-march=${MARCH}" \
./configure -prefix $PREFIX/lib/qt4 \
-libdir $PREFIX/lib \
-bindir $PREFIX/lib/qt4/bin \
-headerdir $PREFIX/include/qt4 \
-datadir $PREFIX/lib/qt4 \
-L $PREFIX/lib \
-I $PREFIX/include \
-release \
-fast \
-no-qt3support \
-nomake examples \
-nomake demos \
-nomake docs \
-opensource \
-verbose \
-openssl \
-webkit \
-system-libpng \
-system-zlib \
-gtkstyle \
-dbus
# Build on RPM based distros fails without setting LD_LIBRARY_PATH
# to the build lib dir
# See https://bugreports.qt.io/browse/QTBUG-5385
LD_LIBRARY_PATH=$SRC_DIR/lib make -j $CPU_COUNT
make install
fi
if [ `uname` == Darwin ]; then
# Leave Qt set its own flags and vars, else compilation errors
# will occur
for x in OSX_ARCH CFLAGS CXXFLAGS LDFLAGS
do
unset $x
done
chmod +x configure
./configure -prefix $PREFIX/lib/qt4 \
-libdir $PREFIX/lib \
-bindir $PREFIX/lib/qt4/bin \
-headerdir $PREFIX/include/qt4 \
-datadir $PREFIX/lib/qt4 \
-L $PREFIX/lib \
-I $PREFIX/include \
-release \
-fast \
-no-pch \
-no-qt3support \
-nomake examples \
-nomake demos \
-nomake docs \
-opensource \
-verbose \
-openssl \
-system-libpng \
-system-zlib \
-no-framework \
-platform macx-g++ \
-arch `uname -m`
make -j $(sysctl -n hw.ncpu)
make install
fi
# Post build setup
# ----------------
BIN=$PREFIX/lib/qt4/bin
# Remove unneeded files
pushd $PREFIX/lib/qt4
rm -rf phrasebooks translations q3porting.xml
popd
# Make symlinks of binaries in $BIN to $PREFIX/bin
for file in $BIN/*
do
ln -sfv ../lib/qt4/bin/$(basename $file) $PREFIX/bin/$(basename $file)-qt4
done
# Remove qmake-qt4 symlink and add qmake-qt4 bash script
rm -f $PREFIX/bin/qmake-qt4
cp $RECIPE_DIR/qmake-qt4 $PREFIX/bin/
# Add qt.conf file to the package to make it fully relocatable
cp $RECIPE_DIR/qt.conf $PREFIX/bin/