updated on Tue Jan 10 00:10:07 UTC 2012
[aur-mirror.git] / qt-git / PKGBUILD
blob0b5b32828dc6d4598c7488c749868a5d692d75be
1 # $Id$
2 # Contributor: friesoft <friesoft@gmail.com>
3 # This package provides the master branch of Qt
5 pkgname=qt-git
6 pkgver=20100826
7 pkgrel=2
8 pkgdesc="The C++ Qt GUI framework - current development snapshot (master branch)"
9 arch=('i686' 'x86_64')
10 url="http://www.qtsoftware.com"
11 license=('GPL3' 'LGPL')
13 depends=('libpng' 'mesa' 'fontconfig' 'libtiff' 'libmng' 'sqlite3' 'libxrandr' 'glib2' 'libxi' 'dbus' 'libxcursor' 'libxinerama' 'libxrender' 'ca-certificates')
14 optdepends=('postgresql-libs' 'libmysqlclient' 'unixodbc')
15 makedepends=('inputproto' 'postgresql-libs' 'mysql' 'unixodbc' 'cups' 'libxfixes' 'gtk2')
16 provides=('qt' 'qt4' 'qt-doc' 'qt=4.7.0' 'qt4=4.7.0')
17 replaces=('qt' 'qt4' 'qt-doc' 'qt4-git' 'qt4-doc')
18 conflicts=('qt' 'qt4' 'qt-doc' 'qt4-git' 'qt4-doc')
19 options=('!libtool' 'docs')
21 # desktop files and qdoc3 patch -- needed for qtdesigner-git build
22 source=('assistant.desktop' 'designer.desktop' 'linguist.desktop' 'qtconfig.desktop')
24 md5sums=('83d1fd8da6a350dc1f1459d0c8cd226b'
25          'bb1afccb14bcad7e7dac826612f5dc9c'
26          '038d7083823c2600c97239fe088b2f4b'
27          '8618e4b1875143fab8ad244688b2aae7')
29 _gitroot="git://gitorious.org/qt/qt.git"
30 _gitname="qt"
32 build() {
33           msg "Connecting to git server...."
35           if [ -d ${srcdir}/$_gitname ] ; then
36                     cd $_gitname
37                     git reset --hard HEAD
38                     git pull origin 
40                     msg "The local files have been updated to the current revision"
42                     cd $srcdir/$_gitname
43           else
44                     git clone $_gitroot
46                     cd $srcdir/$_gitname
48                     sed -i "s|-O2|$CXXFLAGS|" mkspecs/common/g++.conf
49                     sed -i "/^QMAKE_RPATH/s| -Wl,-rpath,||g" mkspecs/common/g++.conf
50                     sed -i "/^QMAKE_LFLAGS\s/s|+=|+= $LDFLAGS|g" mkspecs/common/g++.conf
51           fi
53           unset QMAKESPEC
54           export QT4DIR=$srcdir/$_gitname
55           export PATH=${QT4DIR}/bin:${PATH}
56           export LD_LIBRARY_PATH=${QT4DIR}/lib:${LD_LIBRARY_PATH}
58           ./configure -confirm-license -opensource  -v \
59                     -prefix /usr \
60                     -sysconfdir /etc \
61                     -plugindir /usr/lib/qt/plugins \
62                     -translationdir /usr/share/qt/translations \
63                     -datadir /usr/share/qt \
64                     -docdir /usr/share/doc/qt \
65                     -examplesdir /usr/share/doc/qt/examples \
66                     -demosdir /usr/share/doc/qt/demos \
67                     -largefile \
68                     -plugin-sql-{psql,mysql,sqlite,odbc} \
69                     -system-sqlite \
70                     -xmlpatterns \
71                     -no-phonon \
72                     -no-phonon-backend \
73                     -svg \
74                     -webkit \
75                     -scripttools \
76                     -system-zlib \
77                     -system-libtiff \
78                     -system-libpng \
79                     -system-libmng \
80                     -system-libjpeg \
81                     -openssl-linked \
82                     -dbus-linked \
83                     -no-rpath \
84                     -silent \
85                     -optimized-qmake \
86                     -dbus \
87                     -no-separate-debug-info \
88                     -reduce-relocations \
89                     -gtkstyle \
90                     -opengl \
91                     -glib \
92                     -cups \
93                     -no-iconv \
94                     -xinerama \
95                     -xcursor \
96                     -xfixes \
97                     -qdbus
99           # build qt master
100           make || return 1
101           make docs
104 package() {
105           cd $srcdir/$_gitname
107           #install everything
108           make INSTALL_ROOT=$pkgdir install
110           # install missing icons and desktop files
111           for icon in tools/linguist/linguist/images/icons/linguist-*-32.png ; do
112                   size=$(echo $(basename ${icon}) | cut -d- -f2)
113                   install -p -D -m644 ${icon} ${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/linguist.png
114           done
115           install -p -D -m644 src/gui/dialogs/images/qtlogo-64.png ${pkgdir}/usr/share/icons/hicolor/64x64/apps/qtlogo.png
116           install -p -D -m644 tools/assistant/tools/assistant/images/assistant.png ${pkgdir}/usr/share/icons/hicolor/32x32/apps/assistant.png
117           install -p -D -m644 tools/designer/src/designer/images/designer.png ${pkgdir}/usr/share/icons/hicolor/128x128/apps/designer.png
118           install -d ${pkgdir}/usr/share/applications
119           install -m644 ${srcdir}/{linguist,designer,assistant,qtconfig}.desktop ${pkgdir}/usr/share/applications/
121           # install license addition
122           install -D -m644 LGPL_EXCEPTION.txt ${pkgdir}/usr/share/licenses/qt/LGPL_EXCEPTION.txt
124           # Fix wrong path in pkgconfig files
125           find ${pkgdir}/usr/lib/pkgconfig -type f -name '*.pc' \
126                   -exec perl -pi -e "s, -L${srcdir}/?\S+,,g" {} \;
127           # Fix wrong path in prl files
128           find ${pkgdir}/usr/lib -type f -name '*.prl' \
129                   -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
131           # install doc
132           install -d ${pkgdir}/usr/share/doc/qt
133           cp -r doc/* ${pkgdir}/usr/share/doc/qt