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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
|
# $Id$
# Maintainer: David C. Rankin <drankinatty@gmail.com>
#
# All modifications and uses of this file are licensed under
# the software for which this file was made for, should the software
# be under an Open Source License, at least version 1.9, defined
# by the Open Source Initiative. In other cases, this file is automatically
# released to the Public Domain.
#
pkgname=trinity-qt3
pkgver=3.3.8b
pkgrel=1
pkgdesc="The Qt3 gui toolkit - with Trinity patch."
_prefix="opt/qt"
_patchver=3.3.8c
arch=(i686 x86_64)
license=('GPL')
url="http://www.trolltech.com/products/qt/index.html"
pkgfqn=qt-x11-free-${pkgver}
# install=qt.install
groups=('trinity-bld')
depends=('libjpeg-turbo'
'libmng'
'libmysqlclient'
'libpng'
'libxmu'
'libxcursor'
'libxinerama'
'libxft'
'libxrandr'
'mesa'
'postgresql-libs'
'unixodbc')
makedepends=('cups' 'libxi' 'mysql' 'postgresql' 'unixodbc' 'sqlite3')
optdepends=()
# optdepends=('libmysqlclient' 'postgresql-libs' 'unixodbc')
provides=('trinity-qt3' 'qt3')
conflicts=('qt3' 'qt3-enhanced')
replaces=('trinity-qt3')
# 'ftp://ftp.trolltech.com/qt/source/${pkgfqn}.tar.gz'
# ftp://ftp.trolltech.com/qt/source/qt-x11-free-3.3.8b.tar.gz
source=(ftp://ftp.trolltech.com/qt/source/${pkgfqn}.tar.gz
qt3-png14.patch
qt-patches.tar.bz2
qt3-png14.patch
eastern_asian_languagues.diff
qt-odbc.patch
gcc46-arch.diff
qt3_3.3.8c.arch.diff)
# 'qt.profile'
# 'qt-copy-kde-patches.tar.bz2'
# 'utf8-bug-qt3.diff'
# 'mysql.patch'
# 'qt-font-default-subst.diff'
options=(!libtool)
md5sums=('9f05b4125cfe477cc52c9742c3c09009'
'1dc671df42b9030dbdf68bb61cd3375e'
'2f00e5c0c1e2c2a23dddc982cd79f3e0'
'1dc671df42b9030dbdf68bb61cd3375e'
'616f1f3029cf8375256ad6a406de3549'
'2178ca88dfd75a230918593b30eb0dbe'
'445d6937ad197fa31e1a8e4668d3caa6'
'd763bdc087786a45e5e5eec84f5c9896')
# gcc46.diff
# 'e77192301879b05a4b8ebc35d5c5702b'
# qt-copy-kde-patches come from http://websvn.kde.org/trunk/qt-copy/patches/
# other qt-patches come from fedora and gentoo
build() {
unset QMAKESPEC
export QTDIR=${srcdir}/$pkgfqn
export PATH=${QTDIR}/bin:${PATH}
export LD_LIBRARY_PATH=${QTDIR}/lib:${LD_LIBRARY_PATH}
export QMAKESPEC=$QTDIR/mkspecs/linux-g++
export CPATH=/usr/include/postgresql/server:/usr/include/mysql
cd ${QTDIR}
# cd ${srcdir}/$pkgfqn
# apply other qt patches and one security fix from debian/gentoo
for i in ../qt-patches/*; do
patch -Np1 -i $i || return 1
done
# fix CJK font/chars select error (FS#11245)
patch -p1 -i ${srcdir}/eastern_asian_languagues.diff || return 1
# fix build problem against new unixODBC
patch -p1 -i ${srcdir}/qt-odbc.patch || return 1
patch -p0 -i ${srcdir}/qt3-png14.patch || return 1
# patch for gcc 4.6
patch -p1 -i ${srcdir}/gcc46-arch.diff || return 1
# patch for qt3_3.3.8c
patch -p0 -i ${srcdir}/qt3_3.3.8c.arch.diff || return 1
# start compiling qt
# baho additions
# # remove runtime library search not needed when installed into /usr
# sed -i '/QMAKE_RPATH/d' mkspecs/linux*/qmake.conf
sed -i 's|-cp -P -f|-cp -L -f|' qmake/Makefile.unix
rm -rf doc/html examples tutorial
sed -i "s|sub-tutorial sub-examples||" Makefile
sed -i "s|-O2|$CXXFLAGS|" mkspecs/linux-g++/qmake.conf
sed -i "s|-O2|$CXXFLAGS|" mkspecs/linux-g++-32/qmake.conf
sed -i "s|-O2|$CXXFLAGS|" mkspecs/linux-g++-64/qmake.conf
sed -i "s|-I. |$CXXFLAGS -I. |" qmake/Makefile.unix
sed -i "s|read acceptance|acceptance=yes|" configure
# remove unwanted mkspecs
rm -rf mkspecs/{*aix*,*bsd*,cygwin*,dgux*,darwin*,hpux*,hurd*,irix*,lynxos*,macx*,qnx*,reliant*,sco*,solaris*,tru64*,unixware*,win32*}
# set arch if x86_64 build
if [ "$CARCH" = "x86_64" ]; then
export ARCH="-64"
else unset ARCH
fi
# ./configure -prefix /opt/qt -platform linux-g++$ARCH \
# -system-zlib -qt-gif -release -shared -sm -nis -thread -stl \
# -system-lib{png,jpeg,mng} \
# -no-g++-exceptions -plugin-sql-{mysql,psql,sqlite,odbc}
msg "Starting configure..."
./configure -prefix ${_prefix} \
-sysconfdir /etc/qt \
-qt-gif \
-system-zlib \
-system-libjpeg \
-plugin-imgfmt-jpeg \
-system-libmng \
-plugin-imgfmt-mng \
-system-libpng \
-plugin-imgfmt-png \
-plugin-sql-mysql \
-plugin-sql-psql \
-plugin-sql-sqlite \
-plugin-sql-odbc \
-no-exceptions \
-thread \
-no-tablet
#-platform linux-g++ \
## remove custom locations from Baho's /usr install experiment
# -docdir ${_prefix}/share/doc/qt \
# -headerdir ${_prefix}/include/qt \
# -plugindir ${_prefix}/lib/qt/plugins \
# -datadir ${_prefix}/share/qt \
# -translationdir ${_prefix}/share/qt/translations \
# fix /opt/qt/lib path
[ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" ${QTDIR}/src/Makefile
[ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" ${QTDIR}/tools/designer/designer/Makefile
[ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" ${QTDIR}/tools/designer/editor/Makefile
[ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" ${QTDIR}/tools/assistant/lib/Makefile
[ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" ${QTDIR}/tools/designer/uilib/Makefile
# bahoo make
# make sub-tools
cd ${QTDIR}
make -C qmake || return 1
cd ${QTDIR}/plugins/src/sqldrivers/mysql
${QTDIR}/bin/qmake -o Makefile "INCPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysql -lmysqlclient" mysql.pro
cd ${QTDIR}/plugins/src/sqldrivers/psql
${QTDIR}/bin/qmake -o Makefile "INCPATH+=/usr/src/include /usr/include/postgresql/server" "LIBS+=-L/usr/lib -lpq" psql.pro
cd ${QTDIR}
# fix the broken makefiles
#sed -i 's|[[:space:]]*strip.*doc/html.*$|#|g' src/Makefile
make || return 1
}
package() {
msg "Packaging - $pkgname-$pkgver"
cd ${QTDIR}
pkgver=${_patchver}
make INSTALL_ROOT=${pkgdir} install
## Original Qt Build
rm -rf ${pkgdir}${_prefix}/{phrasebooks,templates,translations}
sed -i "s|-L${QTDIR}/lib ||g" ${pkgdir}${_prefix}/lib/*.prl
install -D -m755 qmake/qmake ${pkgdir}${_prefix}/bin/qmake
# Build and install qt.profile
echo "export QTDIR=${_prefix}" > ${srcdir}/qt.profile
echo "export QT_XFT=true" >> ${srcdir}/qt.profile
echo 'export PATH=$PATH:$QTDIR/bin' >> ${srcdir}/qt.profile
echo 'export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$QTDIR/pkgconfig' >> ${srcdir}/qt.profile
install -D -m755 ${srcdir}/qt.profile ${pkgdir}/etc/profile.d/qt3.sh
ln -sf ${_prefix}/bin/qtconfig ${pkgdir}${_prefix}/bin/qt3config
rm -f ${pkgdir}${_prefix}/mkspecs/linux-g++$ARCH/linux-g++$ARCH
# install man pages
mkdir -p ${pkgdir}${_prefix}/man
cp -r ${QTDIR}/doc/man/{man1,man3} ${pkgdir}${_prefix}/man/
# Uncomment to install examples
# cp -v -r ${QTDIR}/examples ${pkgdir}${_prefix}/share/doc/qt
install -d -m755 ${pkgdir}/etc/ld.so.conf.d/
echo "${_prefix}/lib" > ${pkgdir}/etc/ld.so.conf.d/qt3.conf
}
## Baho Additions
# ln -v -sf libqt-mt.so ${pkgdir}${_prefix}/lib/libqt.so
# ln -v -snf ../../bin ${pkgdir}${_prefix}/share/qt/bin
# ln -v -snf ../../include/qt ${pkgdir}${_prefix}/share/qt/include
# ln -v -snf ../../lib ${pkgdir}${_prefix}/share/qt/lib
# rm ${pkgdir}${_prefix}/share/qt/mkspecs/linux-g++/linux-g++
# ln -v -snf ../linux-g++ ${pkgdir}${_prefix}/share/qt/mkspecs/linux-g++/linux-g++
# cp -v -r doc/man ${pkgdir}${_prefix}/share
# # Don't do examples
# cp -v -r examples ${pkgdir}${_prefix}/share/doc/qt
# # Build qt.profile
# echo "export QTDIR=${_prefix}" > ${srcdir}/qt.profile
# echo "export QT_XFT=true" >> ${srcdir}/qt.profile
# echo 'export PATH=$PATH:$QTDIR/bin' >> ${srcdir}/qt.profile
# echo 'export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$QTDIR/pkgconfig' >> ${srcdir}/qt.profile
#
# install -D -m755 ${srcdir}/qt.profile ${pkgdir}/etc/profile.d/qt3.sh
# ln -sf ${_prefix}/bin/qtconfig ${pkgdir}${_prefix}/bin/qt3config
## scraps
# apply qt patches from kde.org
# for i in ../qt-copy-kde-patches/*; do
# patch -Np0 -i $i || return 1
# done
# fix utf8 bug
# patch -Np0 -i ../utf8-bug-qt3.diff || return 1
# fix asia fonts
# patch -Np0 -i ../qt-font-default-subst.diff || return 1
# fix segfaults on exit when using mysql DB driver
# patch -Np0 -i ../mysql.patch || return 1
# # fix /opt/qt/lib path
# [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" ${srcdir}/$pkgfqn/src/Makefile
# [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" ${srcdir}/$pkgfqn/tools/designer/designer/Makefile
# [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" ${srcdir}/$pkgfqn/tools/designer/editor/Makefile
# [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" ${srcdir}/$pkgfqn/tools/assistant/lib/Makefile
# [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" ${srcdir}/$pkgfqn/tools/designer/uilib/Makefile
#
# cd ${srcdir}/$pkgfqn
# make -C qmake || return 1
# cd ${srcdir}/$pkgfqn/plugins/src/sqldrivers/mysql
# ${srcdir}/$pkgfqn/bin/qmake -o Makefile "INCPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysql -lmysqlclient" mysql.pro
# cd ${srcdir}/$pkgfqn/plugins/src/sqldrivers/psql
# ${srcdir}/$pkgfqn/bin/qmake -o Makefile "INCPATH+=/usr/src/include /usr/include/postgresql/server" "LIBS+=-L/usr/lib -lpq" psql.pro
#
# cd ${srcdir}/$pkgfqn
# # fix the broken makefiles
# #sed -i 's|[[:space:]]*strip.*doc/html.*$|#|g' src/Makefile
# make || return 1
# make INSTALL_ROOT=${pkgdir} install
# rm -rf ${pkgdir}/opt/qt/{phrasebooks,templates,translations}
# sed -i "s|-L${srcdir}/$pkgfqn/lib ||g" ${pkgdir}/opt/qt/lib/*.prl
# install -D -m755 qmake/qmake ${pkgdir}/opt/qt/bin/qmake
# install -D -m755 ${srcdir}/qt.profile ${pkgdir}/etc/profile.d/qt3.sh
# ln -sf /opt/qt/bin/qtconfig ${pkgdir}/opt/qt/bin/qt3config
# rm -f ${pkgdir}/opt/qt/mkspecs/linux-g++$ARCH/linux-g++$ARCH
#
# # install man pages
# mkdir -p ${pkgdir}/opt/qt/man
# cp -r ${srcdir}/$pkgfqn/doc/man/{man1,man3} ${pkgdir}/opt/qt/man/
#
# install -d -m755 ${pkgdir}/etc/ld.so.conf.d/
# echo '/opt/qt/lib' > ${pkgdir}/etc/ld.so.conf.d/qt3.conf
# }
|