1 # Description: Qt Free Edition
2 # URL: http://www.trolltech.com
3 # Maintainer: Daniel Mueller, daniel at danm dot de
4 # Depends on: x11, freetype, libjpeg, libmng, libpng, fontconfig, expat
5
6 name=qt3
7 version=3.3.5
8 release=1
9 source=(ftp://ftp.trolltech.com/qt/source/qt-x11-free-$version.tar.bz2 \
10 http://crux.danm.de/files/dist/$name/$version/$name-$version-2-patches.tar.bz2 \
11 $name-$version-gcc4.patch)
12
13 build () {
14 cd qt-x11-free-$version
15
16 # KDE patches (http://websvn.kde.org/branches/qt/3.3/qt-copy/patches/?rev=507267)
17 for i in ../$name-patches/*.*; do
18 patch -p2 < $i
19 done
20
21 # gcc4 + 64bit issue
22 patch -p1 < $SRC/$name-$version-gcc4.patch
23
24 local SQL
25 if [ "`pkginfo -i | grep mysql`" ];then
26 SQL="-qt-sql-mysql -I/usr/include/mysql -L/usr/lib/mysql"
27 fi
28
29 if [ -d /usr/include/nvidia ]; then
30 export CFLAGS="$CFLAGS -I/usr/include/nvidia"
31 export CXXFLAGS="$CXXFLAGS -I/usr/include/nvidia"
32 fi
33
34 # don't link against our currently installed libraries
35 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`pwd`/lib"
36 rm -rf {doc/html,examples,tutorial}
37
38 # we don't want docs, sample code; please use our optimizations flags
39 sed -i "s|sub-tutorial sub-examples| |" Makefile
40 sed -i "s|-O2|$CXXFLAGS|" mkspecs/linux-g++/qmake.conf
41 sed -i "s|-I. |$CXXFLAGS -I. |" qmake/Makefile.unix
42
43 ./configure -prefix /usr/share/qt \
44 -bindir /usr/bin \
45 -headerdir /usr/include/qt \
46 -libdir /usr/lib \
47 -plugindir /usr/lib/qt \
48 -platform linux-g++ -release -shared -thread -sm \
49 -tablet -nis -verbose -qt-gif -system-zlib \
50 -{system-lib,plugin-imgfmt-}{png,jpeg,mng} \
51 -no-{cups,fast,exceptions,nas-sound} \
52 -x{cursor,ft,inerama,kb,randr,render} \
53 $SQL
54
55 make src-moc sub-src
56
57 # Makefile magic, don't link against our currently installed libs
58 find . -name Makefile -exec sed -i "s|,/usr/lib|,`pwd`/lib|" {} \;
59 make sub-tools
60 make INSTALL_ROOT=$PKG install
61
62 for i in mergetr msg2qm qconfig qembed qvfb; do
63 (cd tools/$i/;make SUBLIBS="-lpng -lmng";mv $i $PKG/usr/bin/)
64 done
65 mv bin/{findtr,qtrename140} $PKG/usr/bin/
66
67 mkdir $PKG/usr/man
68 mv doc/man/man1 $PKG/usr/man
69
70 rm -rf `find $PKG/usr/share/qt/mkspecs/* | grep -v linux-g++` \
71 $PKG/usr/share/qt/{phrasebooks,templates,translations} \
72 $PKG/usr/include/qt/{j,n}*
73 rm -f $PKG/usr/share/qt/mkspecs/linux-g++/linux-g++
74
75 ln -s ../../bin $PKG/usr/share/qt/bin
76 ln -s ../../include/qt $PKG/usr/share/qt/include
77 ln -s ../../lib $PKG/usr/share/qt/lib
78 ln -s ../../lib/qt $PKG/usr/share/qt/plugins
79 ln -s linux-g++ $PKG/usr/share/qt/mkspecs/default
80
81 # correct qmake's PRL files (the libraries were placed into /usr/lib*/ and
82 # not in our temporary build directory ./work/src/..)
83 sed -i "s|-L$SRC/qt-x11-free-$version/lib ||g" $PKG/usr/lib/*.prl
84
85 chmod -R u+w,g-sw $PKG
86 chown -R root:root $PKG
87 }
|