summaryrefslogtreecommitdiff
path: root/extra/qt5/PKGBUILD
blob: 1ce2339d3793b819ca57de8e957b39cfff92bb8c (plain)
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# $Id: PKGBUILD 197149 2013-10-23 11:49:27Z andrea $
# Maintainer: Andrea Scarpino <andrea@archlinux.org>

pkgbase=qt5
pkgname=('qt5-base'
         'qt5-declarative'
         'qt5-doc'
         'qt5-graphicaleffects'
         'qt5-imageformats'
         'qt5-jsbackend'
         'qt5-multimedia'
         'qt5-quick1'
         'qt5-quickcontrols'
         'qt5-script'
         'qt5-sensors'
         'qt5-serialport'
         'qt5-svg'
         'qt5-tools'
         'qt5-translations'
         'qt5-webkit'
         'qt5-x11extras'
         'qt5-xmlpatterns')
pkgver=5.1.1
pkgrel=5
arch=('i686' 'x86_64')
url='http://qt-project.org/'
license=('GPL3' 'LGPL' 'FDL' 'custom')
makedepends=('libxcb' 'xcb-proto' 'xcb-util' 'xcb-util-image' 'xcb-util-wm' 'xcb-util-keysyms'
            'mesa' 'at-spi2-core' 'alsa-lib' 'gstreamer0.10-base-plugins'
            'libjpeg-turbo' 'cups' 'libpulse' 'hicolor-icon-theme' 'desktop-file-utils'
            'postgresql-libs' 'libmariadbclient' 'sqlite' 'unixodbc' 'libfbclient'
            'python2' 'ruby' 'gperf' 'libxslt' 'libxcomposite' 'fontconfig'
            'openal' 'gtk2' 'libxkbcommon')
groups=('qt' 'qt5')
_pkgfqn="qt-everywhere-opensource-src-${pkgver}"
source=("http://download.qt-project.org/official_releases/qt/5.1/${pkgver}/single/${_pkgfqn}.tar.xz"
        'assistant.desktop' 'designer.desktop' 'linguist.desktop' 'qdbusviewer.desktop'
        'use-python2.patch'
        'bison3.patch')
md5sums=('697b7b8768ef8895e168366ab6b44760'
         'b2897dd6a2967bccf8f10e397aafee55'
         '9638a78e502719ef8fe5f8d10d0361a9'
         '188da8f4c87316e730ebf1c6217bf5a0'
         '322b419b16c75d4de0ee7ad0a246caa1'
         '92831f79144d5cb8121915423ba47575'
         '6b162cd2bc104f0ae83ca039401be7bf')

prepare() {
  cd ${_pkgfqn}

  sed -i "s|-O2|${CXXFLAGS}|" qtbase/mkspecs/common/{g++,gcc}-base.conf
  sed -i "/^QMAKE_LFLAGS_RPATH/s| -Wl,-rpath,||g" qtbase/mkspecs/common/gcc-base-unix.conf
  sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS}|g" qtbase/mkspecs/common/gcc-base.conf

  # Use python2 for Python 2.x
  patch -p1 -i "${srcdir}"/use-python2.patch
  sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
    -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
    $(find . -name '*.py')

  # Fix build with bison 3.x
  cd qtwebkit
  patch -p1 -i "${srcdir}"/bison3.patch
}

build() {
  cd ${_pkgfqn}

  export QTDIR="${srcdir}"/${_pkgfqn}
  export LD_LIBRARY_PATH="${QTDIR}"/qtbase/lib:"${QTDIR}"/qttools/lib:"${LD_LIBRARY_PATH}"
  export QT_PLUGIN_PATH="${QTDIR}"/qtbase/plugins

  PYTHON=/usr/bin/python2 ./configure -confirm-license -opensource \
    -prefix /usr \
    -bindir /usr/lib/qt/bin \
    -docdir /usr/share/doc/qt \
    -headerdir /usr/include/qt \
    -archdatadir /usr/lib/qt \
    -datadir /usr/share/qt \
    -sysconfdir /etc/xdg \
    -examplesdir /usr/share/doc/qt/examples \
    -plugin-sql-{psql,mysql,sqlite,odbc,ibase} \
    -system-sqlite \
    -openssl-linked \
    -nomake examples \
    -no-rpath \
    -optimized-qmake \
    -dbus-linked \
    -reduce-relocations

  make

  # Fix paths
  find "${QTDIR}" -name Makefile -exec sed -i "s|/usr/lib/qt/bin/qdoc|${QTDIR}/qtbase/bin/qdoc|g" {} +
  find "${QTDIR}" -name Makefile.qmake-docs -exec sed -i "s|/usr/lib/qt/bin/qdoc|${QTDIR}/qtbase/bin/qdoc|g" {} +
  find "${QTDIR}" -name Makefile -exec sed -i "s|/usr/lib/qt/bin/qhelpgenerator|${QTDIR}/qttools/bin/qhelpgenerator|g" {} +
  find "${QTDIR}" -name Makefile.qmake-docs -exec sed -i "s|/usr/lib/qt/bin/qhelpgenerator|${QTDIR}/qttools/bin/qhelpgenerator|g" {} +
  sed -i "s|/usr/lib/qt/bin/qhelpgenerator|${QTDIR}/qttools/bin/qhelpgenerator|g" qtwebkit/Source/Makefile.api

  make docs
}

package_qt5-base() {
  pkgdesc='A cross-platform application and UI framework'
  depends=('libjpeg-turbo' 'xcb-util-keysyms' 'libgl' 'dbus' 'fontconfig' 'systemd'
           'xcb-util-wm' 'libxrender' 'libxi' 'sqlite' 'libpng' 'xcb-util-image'
           'icu' 'qtchooser' 'libxkbcommon')
  optdepends=('postgresql-libs: PostgreSQL driver'
              'libmariadbclient: MariaDB driver'
              'unixodbc: ODBC driver'
              'libfbclient: Firebird/iBase driver')
  conflicts=('qt')

  cd ${_pkgfqn}/qtbase
  make INSTALL_ROOT="${pkgdir}" install

  cd "${srcdir}"
  install -D -m644 ${_pkgfqn}/qtbase/LGPL_EXCEPTION.txt \
    ${pkgdir}/usr/share/licenses/${pkgbase}/LGPL_EXCEPTION.txt

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;

  # Fix wrong qmake path in pri file
  sed -i "s|${srcdir}/${_pkgfqn}/qtbase|/usr|" \
    "${pkgdir}"/usr/lib/qt/mkspecs/modules/qt_lib_bootstrap.pri

  # Useful symlinks
  install -d "${pkgdir}"/usr/bin
  for b in "${pkgdir}"/usr/lib/qt/bin/*; do
    ln -s /usr/lib/qt/bin/$(basename $b) "${pkgdir}"/usr/bin/$(basename $b)-qt5
  done
}

package_qt5-declarative() {
  pkgdesc='A cross-platform application and UI framework (QtQml, QtQuick)'
  depends=('qt5-jsbackend' 'qt5-xmlpatterns')
  conflicts=('qt')

  cd ${_pkgfqn}/qtdeclarative
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;

  # Useful symlinks
  install -d "${pkgdir}"/usr/bin
  for b in "${pkgdir}"/usr/lib/qt/bin/*; do
    ln -s /usr/lib/qt/bin/$(basename $b) "${pkgdir}"/usr/bin/$(basename $b)-qt5
  done
}

package_qt5-doc() {
  pkgdesc='A cross-platform application and UI framework (Documentation)'
  depends=('qt5-base')
#  arch=('any')
  conflicts=('qt-doc')
  replaces=('qt-doc')
  provides=('qt-doc')
  options=('docs')
  groups=()

  cd ${_pkgfqn}
  make INSTALL_ROOT="${pkgdir}" install_docs
}

package_qt5-jsbackend() {
  pkgdesc='A cross-platform application and UI framework (QtV8)'
  depends=('qt5-base')

  cd ${_pkgfqn}/qtjsbackend
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
}

package_qt5-xmlpatterns() {
  pkgdesc='A cross-platform application and UI framework (QtXmlPatterns)'
  depends=('qt5-base')
  conflicts=('qt')

  cd ${_pkgfqn}/qtxmlpatterns
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;

  # Useful symlinks
  install -d "${pkgdir}"/usr/bin
  for b in "${pkgdir}"/usr/lib/qt/bin/*; do
    ln -s /usr/lib/qt/bin/$(basename $b) "${pkgdir}"/usr/bin/$(basename $b)-qt5
  done
}

package_qt5-translations() {
  pkgdesc='A cross-platform application and UI framework (Translations)'
  depends=('qt5-base')
  conflicts=('qt')

  cd ${_pkgfqn}/qttranslations
  make INSTALL_ROOT="${pkgdir}" install
}

package_qt5-multimedia() {
  pkgdesc='A cross-platform application and UI framework (QtMultimedia)'
  depends=('qt5-declarative' 'libpulse' 'gstreamer0.10-base' 'openal')
  conflicts=('qt')

  cd ${_pkgfqn}/qtmultimedia
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
}

package_qt5-graphicaleffects() {
  pkgdesc='A cross-platform application and UI framework (QtGraphicalEffects)'
  depends=('qt5-declarative')

  cd ${_pkgfqn}/qtgraphicaleffects
  make INSTALL_ROOT="${pkgdir}" install
}

package_qt5-imageformats() {
  pkgdesc='A cross-platform application and UI framework (Images plugins)'
  depends=('qt5-base' 'libtiff')
  conflicts=('qt')

  cd ${_pkgfqn}/qtimageformats
  make INSTALL_ROOT="${pkgdir}" install
}

package_qt5-quick1() {
  pkgdesc='A cross-platform application and UI framework (QtDeclarative)'
  depends=('qt5-webkit' 'qt5-script')
  conflicts=('qt')

  cd ${_pkgfqn}/qtquick1
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;

  # Useful symlinks
  install -d "${pkgdir}"/usr/bin
  for b in "${pkgdir}"/usr/lib/qt/bin/*; do
    ln -s /usr/lib/qt/bin/$(basename $b) "${pkgdir}"/usr/bin/$(basename $b)-qt5
  done
}

package_qt5-quickcontrols() {
  pkgdesc='A cross-platform application and UI framework (QtQuick)'
  depends=('qt5-declarative')

  cd ${_pkgfqn}/qtquickcontrols
  make INSTALL_ROOT="${pkgdir}" install
}

package_qt5-script() {
  pkgdesc='A cross-platform application and UI framework (QtScript)'
  depends=('qt5-base')
  conflicts=('qt')

  cd ${_pkgfqn}/qtscript
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
}

package_qt5-sensors() {
  pkgdesc='A cross-platform application and UI framework (QtSensors)'
  depends=('qt5-declarative')

  cd ${_pkgfqn}/qtsensors
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
}

package_qt5-serialport() {
  pkgdesc='A cross-platform application and UI framework (QtSerialPort)'
  depends=('qt5-base')

  cd ${_pkgfqn}/qtserialport
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
}

package_qt5-svg() {
  pkgdesc='A cross-platform application and UI framework (QtSvg)'
  depends=('qt5-base')
  conflicts=('qt')

  cd ${_pkgfqn}/qtsvg
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
}

package_qt5-tools() {
  pkgdesc='A cross-platform application and UI framework (Development Tools, QtHelp)'
  depends=('qt5-webkit' 'desktop-file-utils' 'qt5-translations' 'hicolor-icon-theme'
           'xdg-utils')
  optdepends=('qt5-doc: documentation')
  install='qt5-tools.install'
  conflicts=('qt')
  options=('staticlibs') # libQtUiTools builds as static only$

  cd ${_pkgfqn}/qttools
  make INSTALL_ROOT="${pkgdir}" install

  # install missing icons and desktop files
  for icon in src/linguist/linguist/images/icons/linguist-*-32.png ; do
    size=$(echo $(basename ${icon}) | cut -d- -f2)
    install -p -D -m644 ${icon} \
      "${pkgdir}/usr/share/icons/hicolor/${size}x${size}/apps/linguist.png"
  done

  install -D -m644 src/assistant/assistant/images/assistant.png \
    "${pkgdir}/usr/share/icons/hicolor/32x32/apps/assistant.png"
  install -D -m644 src/assistant/assistant/images/assistant-128.png \
    "${pkgdir}/usr/share/icons/hicolor/128x128/apps/assistant.png"
  install -D -m644 src/designer/src/designer/images/designer.png \
    "${pkgdir}/usr/share/icons/hicolor/128x128/apps/designer.png"
  install -D -m644 src/qdbus/qdbusviewer/images/qdbusviewer.png \
    "${pkgdir}/usr/share/icons/hicolor/32x32/apps/qdbusviewer.png"
  install -D -m644 src/qdbus/qdbusviewer/images/qdbusviewer-128.png \
    "${pkgdir}/usr/share/icons/hicolor/128x128/apps/qdbusviewer.png"
  install -d "${pkgdir}/usr/share/applications"
  install -m644 "${srcdir}"/{linguist,designer,assistant,qdbusviewer}.desktop \
    "${pkgdir}/usr/share/applications/"

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;

  # Useful symlinks
  install -d "${pkgdir}"/usr/bin
  for b in "${pkgdir}"/usr/lib/qt/bin/*; do
    ln -s /usr/lib/qt/bin/$(basename $b) "${pkgdir}"/usr/bin/$(basename $b)-qt5
  done
}

package_qt5-webkit() {
  pkgdesc='A cross-platform application and UI framework (QtWebKit)'
  depends=('qt5-declarative' 'gstreamer0.10-base' 'libxslt' 'libxcomposite' 'qt5-sensors')

  cd ${_pkgfqn}/qtwebkit
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;

  # Fix wrong path in pc file
  perl -pi -e "s, -L${srcdir}/?\S+,,g" "${pkgdir}"/usr/lib/pkgconfig/Qt5WebKit.pc
}

package_qt5-x11extras() {
  pkgdesc='A cross-platform application and UI framework (QtX11Extras)'
  depends=('qt5-base')

  cd ${_pkgfqn}/qtx11extras
  make INSTALL_ROOT="${pkgdir}" install

  # Fix wrong path in prl files
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
}