forked from jcfr/qt-easy-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build-qt.txt
149 lines (120 loc) · 4.82 KB
/
Build-qt.txt
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
140
141
142
143
144
145
146
147
148
149
# # # # # # #
# Linux
# # # # # # #
# Prerequisites
cmake=/home/kitware/Dashboards/Support/cmake-2.8.10.2-Linux-i386/bin/cmake
# Build zlib
cwd=$(pwd)
rm -rf zlib* && \
mkdir zlib-install && \
mkdir zlib-build && \
git clone git://github.com/commontk/zlib.git && \
cd zlib-build && \
"$cmake" -DCMAKE_BUILD_TYPE:STRING=Release \
-DZLIB_MANGLE_PREFIX:STRING=slicer_zlib_ \
-DCMAKE_INSTALL_PREFIX:PATH=$cwd/zlib-install \
../zlib && \
make -j4 && \
make install && \
cd .. && \
cp zlib-install/lib/libzlib.a zlib-install/lib/libz.a
# Build OpenSSL
cwd=$(pwd)
rm -f openssl-1.0.1h.tar.gz && \
rm -rf openssl-1.0.1h/ && \
wget https://packages.kitware.com/download/item/6173/openssl-1.0.1h.tar.gz && \
md5=`md5sum ./openssl-1.0.1h.tar.gz | awk '{ print $1 }'` &&
[ $md5 == "8d6d684a9430d5cc98a62a5d8fbda8cf" ] ||
( echo "MD5 mismatch. Problem downloading OpenSSL" ; exit 1; ) &&
tar -xzvf openssl-1.0.1h.tar.gz && \
cd openssl-1.0.1h/ && \
./config zlib -I$cwd/zlib-install/include -L$cwd/zlib-install/lib shared && \
make -j1 build_libs && \
cd ..
# Build Qt
cwd=$(pwd)
rm -f qt-everywhere-opensource-src-4.8.7.tar.gz
rm -rf qt-everywhere-opensource-src-4.8.7 && \
rm -rf qt-everywhere-opensource-build-4.8.7 && \
mkdir qt-everywhere-opensource-build-4.8.7 && \
curl -OL http://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz
md5=`md5sum ./qt-everywhere-opensource-src-4.8.7.tar.gz | awk '{ print $1 }'` &&
[ $md5 == "d990ee66bf7ab0c785589776f35ba6ad" ] ||
( echo "MD5 mismatch. Problem downloading Qt" ; exit 1; ) &&
tar -xzvf qt-everywhere-opensource-src-4.8.7.tar.gz && \
cd qt-everywhere-opensource-src-4.8.7 && \
./configure -prefix ../qt-everywhere-opensource-build-4.8.7/ \
-release -opensource -confirm-license -no-qt3support \
-webkit -nomake examples -nomake demos \
-openssl -I $cwd/openssl-1.0.1h/include \
-L $cwd/openssl-1.0.1h && \
make -j7 && \
make install
# # # # # # #
# MacOSX
# # # # # # #
# Prerequisites
cmake=/Users/kitware/Dashboards/Support/CMake\ 2.8-12.app/Contents/bin/cmake
deployment_target=10.6
sysroot=/Developer/SDKs/MacOSX10.6.sdk
#cmake=/Volumes/Dashboards/Support/CMake\ 2.8-11.app/Contents/bin/cmake
#deployment_target=10.8
#sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
# Build zlib
cwd=$(pwd)
rm -rf zlib* && \
mkdir zlib-install && \
mkdir zlib-build && \
git clone git://github.com/commontk/zlib.git && \
cd zlib-build && \
"$cmake" -DCMAKE_BUILD_TYPE:STRING=Release \
-DZLIB_MANGLE_PREFIX:STRING=slicer_zlib_ \
-DCMAKE_INSTALL_PREFIX:PATH=$cwd/zlib-install \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_SYSROOT=$sysroot \
-DCMAKE_OSX_DEPLOYMENT_TARGET=$deployment_target \
../zlib && \
make -j4 && \
make install && \
cd .. && \
cp zlib-install/lib/libzlib.a zlib-install/lib/libz.a
# Build OpenSSL
cwd=$(pwd)
rm -f openssl-1.0.1h.tar.gz && \
rm -rf openssl-1.0.1h/ && \
curl -OL https://packages.kitware.com/download/item/6173/openssl-1.0.1h.tar.gz && \
md5=`md5 ./openssl-1.0.1h.tar.gz | awk '{ print $4 }'` &&
[ $md5 == "8d6d684a9430d5cc98a62a5d8fbda8cf" ] ||
( echo "MD5 mismatch. Problem downloading OpenSSL" ; exit 1; ) &&
tar -xzvf openssl-1.0.1h.tar.gz && \
cd openssl-1.0.1h/ && \
export KERNEL_BITS=64 && \
./config zlib -I$cwd/zlib-install/include -L$cwd/zlib-install/lib shared && \
make -j1 build_libs && \
install_name_tool -id $cwd/openssl-1.0.1h/libcrypto.dylib $cwd/openssl-1.0.1h/libcrypto.dylib && \
install_name_tool \
-change /usr/local/ssl/lib/libcrypto.1.0.0.dylib $cwd/openssl-1.0.1h/libcrypto.dylib \
-id $cwd/openssl-1.0.1h/libssl.dylib $cwd/openssl-1.0.1h/libssl.dylib && \
cd ..
# Build Qt
# Patch linked from thread: https://github.com/Homebrew/legacy-homebrew/issues/40585
cwd=$(pwd)
rm -f qt-everywhere-opensource-src-4.8.7.tar.gz
rm -rf qt-everywhere-opensource-src-4.8.7 && \
rm -rf qt-everywhere-opensource-build-4.8.7 && \
mkdir qt-everywhere-opensource-build-4.8.7 && \
curl -OL http://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz
md5=`md5 ./qt-everywhere-opensource-src-4.8.7.tar.gz | awk '{ print $4 }'` &&
[ $md5 == "d990ee66bf7ab0c785589776f35ba6ad" ] ||
( echo "MD5 mismatch. Problem downloading Qt" ; exit 1; ) &&
curl https://gist.githubusercontent.com/ejtttje/7163a9ced64f12ae9444/raw | patch -p1 && \
tar -xzvf qt-everywhere-opensource-src-4.8.7.tar.gz && \
cd qt-everywhere-opensource-src-4.8.7 && \
./configure -prefix ../qt-everywhere-opensource-build-4.8.7/ \
-release -opensource -confirm-license -no-qt3support \
-webkit -arch x86_64 -nomake examples -nomake demos \
-sdk $sysroot \
-openssl -I $cwd/openssl-1.0.1h/include \
-L $cwd/openssl-1.0.1h && \
make -j7 && \
make install