aboutsummaryrefslogtreecommitdiffstats
path: root/qt5/PKGBUILD
blob: baa8fee873db026b222a91fab15bb6aa4dd12c5e (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
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
# $Id: PKGBUILD 249592 2015-10-21 04:24:21Z fyan $
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgbase=qt5
pkgname=('qt5-3d-debug'
         'qt5-base-debug'
         'qt5-canvas3d-debug'
         'qt5-connectivity-debug'
         'qt5-declarative-debug'
         'qt5-doc-debug'
         'qt5-enginio-debug'
         'qt5-graphicaleffects-debug'
         'qt5-imageformats-debug'
         'qt5-location-debug'
         'qt5-multimedia-debug'
         'qt5-quick1-debug'
         'qt5-quickcontrols-debug'
         'qt5-script-debug'
         'qt5-sensors-debug'
         'qt5-serialport-debug'
         'qt5-svg-debug'
         'qt5-tools-debug'
         'qt5-translations-debug'
         'qt5-wayland-debug'
         'qt5-webchannel-debug'
         'qt5-webengine-debug'
         'qt5-webkit-debug'
         'qt5-websockets-debug'
         'qt5-x11extras-debug'
         'qt5-xmlpatterns-debug')
pkgver=5.5.1
pkgrel=1.1
arch=('i686' 'x86_64')
url='http://www.qt.io/developers'
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' 'gst-plugins-base-libs' 'libjpeg-turbo' 'cups'
            'libpulse' 'hicolor-icon-theme' 'desktop-file-utils' 'postgresql-libs' 'nss'
            'libmariadbclient' 'sqlite' 'unixodbc' 'libfbclient' 'libmng' 'python2' 'ruby'
            'gperf' 'libxslt' 'libxcomposite' 'fontconfig' 'bluez-libs' 'openal' 'gtk2'
            'libxkbcommon-x11' 'mtdev' 'harfbuzz' 'libwebp' 'leveldb' 'geoclue' 'pciutils'
            'libinput')
groups=('qt' 'qt5')
_pkgfqn="qt-everywhere-opensource-src-${pkgver}"
source=("http://download.qt-project.org/official_releases/qt/${pkgver%.*}/${pkgver}/single/${_pkgfqn}.tar.xz"
        'assistant.desktop' 'designer.desktop' 'linguist.desktop' 'qdbusviewer.desktop')
md5sums=('c2a249e8795d45200d997d96860d0353'
         'b2897dd6a2967bccf8f10e397aafee55'
         '76e150b20178d2d43801f7367232e5f7'
         '188da8f4c87316e730ebf1c6217bf5a0'
         '322b419b16c75d4de0ee7ad0a246caa1')
options=('debug' '!strip')

prepare() {
  cd ${_pkgfqn}

  # Build qmake using Arch {C,LD}FLAGS
  # This also sets default {C,CXX,LD}FLAGS for projects built using qmake
  sed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${CFLAGS}|" \
    qtbase/mkspecs/common/gcc-base.conf
  sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${LDFLAGS}|" \
    qtbase/mkspecs/common/g++-unix.conf

  # Use python2 for Python 2.x
  find . -name '*.py' -exec sed -i \
    's|#![ ]*/usr/bin/python$|&2|;s|#![ ]*/usr/bin/env python$|&2|' {} +
  # in qtwebengine there are still a lot of relative calls which need a workaround
  mkdir "${srcdir}"/python2-path
  ln -s /usr/bin/python2 "${srcdir}"/python2-path/python
}

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

  # python2 workaround
  export PATH="${srcdir}/python2-path:$PATH"

  # FS#38796
  [[ "${CARCH}" = "i686" ]] && SSE2="-no-sse2"

  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 \
    -system-harfbuzz \
    -journald \
    -libinput \
    -no-use-gold-linker \
    -no-reduce-relocations ${SSE2} \
    -force-debug-info

  make

  # Fix docs build when qt is not installed
  sed -i "s|/usr/lib/qt/bin/qdoc|${QTDIR}/qtbase/bin/qdoc|g" \
    "${QTDIR}"/qtbase/qmake/Makefile.qmake-docs
  find "${QTDIR}" -name Makefile \
    -exec sed -i "s|/usr/lib/qt/bin/qdoc|${QTDIR}/qtbase/bin/qdoc|g" {} +
  sed -i "s|/usr/lib/qt/bin/qhelpgenerator|${QTDIR}/qttools/bin/qhelpgenerator|g" \
    "${QTDIR}"/qtbase/qmake/Makefile.qmake-docs
  find "${QTDIR}" -name Makefile \
    -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
  find "${QTDIR}" -name Makefile \
    -exec sed -i "s|/usr/lib/qt/bin/qmlplugindump|${QTDIR}/qtdeclarative/bin/qmlplugindump|g" {} +

  make docs
}

package_qt5-3d-debug() {
  pkgdesc='C++ and QML APIs for easy inclusion of 3D graphics'
  depends=('qt5-declarative')
  license=('LGPL')
  provides=("qt5-3d=$pkgver")
  conflicts=('qt5-3d')
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
}

package_qt5-base-debug() {
  pkgdesc='A cross-platform application and UI framework'
  depends=('libjpeg-turbo' 'xcb-util-keysyms' 'libgl' 'dbus' 'fontconfig' 'systemd'
           'xcb-util-wm' 'libxrender' 'libxi' 'sqlite' 'xcb-util-image' 'icu'
           'qtchooser' 'libinput')
  optdepends=('qt5-svg: to use SVG icon themes'
              'postgresql-libs: PostgreSQL driver'
              'libmariadbclient: MariaDB driver'
              'unixodbc: ODBC driver'
              'libfbclient: Firebird/iBase driver'
              'mtdev: evdev plugin'
              'libxkbcommon-x11: xcb plugin'
              'libsm: xcb plugin'
              'gtk2: GTK2 plugin')
  conflicts=('qt' 'qt5-base')
  provides=("qt5-base=$pkgver")
  options=('debug' '!strip')

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

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  # Fix wrong qmake path in pri file
  sed -i "s|${srcdir}/${_pkgfqn}/qtbase|/usr|" \
    "${pkgdir}"/usr/lib/qt/mkspecs/modules/qt_lib_bootstrap_private.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-canvas3d-debug() {
  pkgdesc='A JavaScript 3D rendering API for Qt Quick'
  depends=('qt5-declarative')
  license=('LGPL')
  provides=("qt5-canvas3d=$pkgver")
  conflicts=('qt5-canvas3d')
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
}

package_qt5-connectivity-debug() {
  pkgdesc='Provides access to Bluetooth hardware'
  depends=('qt5-declarative' 'bluez-libs')
  provides=("qt5-connectivity=$pkgver")
  conflicts=('qt5-connectivity')
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-declarative-debug() {
  pkgdesc='Classes for QML and JavaScript languages'
  depends=('qt5-xmlpatterns' 'libxkbcommon-x11')
  conflicts=('qt' 'qt5-declarative')
  provides=("qt5-declarative=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  # 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

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

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

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

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-enginio-debug() {
  pkgdesc='A Backend-as-a-Service solution to ease the backend development for connected and data-driven application'
  depends=('qt5-declarative')
  conflicts=('qt5-enginio')
  provides=("qt5-enginio=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-graphicaleffects-debug() {
  pkgdesc='Graphical effects for use with Qt Quick 2'
  depends=('qt5-declarative')
  conflicts=('qt5-graphicaleffects')
  provides=("qt5-graphicaleffects=$pkgver")
  options=('debug' '!strip')

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

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-imageformats-debug() {
  pkgdesc='Plugins for additional image formats: TIFF, MNG, TGA, WBMP'
  depends=('qt5-base' 'jasper' 'libmng' 'libwebp')
  conflicts=('qt' 'qt5-imageformats')
  provides=("qt5-imageformats=$pkgver")
  options=('debug' '!strip')

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

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-location-debug() {
  pkgdesc='Provides access to position, satellite and area monitoring classes'
  depends=('qt5-declarative' 'geoclue')
  conflicts=('qt5-location')
  provides=("qt5-location=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-multimedia-debug() {
  pkgdesc='Classes for audio, video, radio and camera functionality'
  depends=('qt5-declarative' 'libpulse' 'gst-plugins-base-libs' 'openal')
  optdepends=('gst-plugins-bad: Qt MediaService plugin')
  conflicts=('qt' 'qt5-multimedia')
  provides=("qt5-multimedia=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-quick1-debug() {
  pkgdesc='Qt Declarative is provided for Qt 4 compatibility'
  depends=('qt5-webkit' 'qt5-script')
  conflicts=('qt' 'qt5-quick1')
  provides=("qt5-quick1=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  # 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

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-quickcontrols-debug() {
  pkgdesc='Reusable Qt Quick based UI controls to create classic desktop-style user interfaces'
  depends=('qt5-declarative')
  license=('LGPL')
  conflicts=('qt5-quickcontrols')
  provides=("qt5-quickcontrols=$pkgver")
  options=('debug' '!strip')

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

package_qt5-script-debug() {
  pkgdesc='Classes for making Qt applications scriptable. Provided for Qt 4.x compatibility'
  depends=('qt5-base')
  conflicts=('qt' 'qt5-script')
  provides=("qt5-script=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-sensors-debug() {
  pkgdesc='Provides access to sensor hardware and motion gesture recognition'
  depends=('qt5-declarative')
  conflicts=('qt5-sensors')
  provides=("qt5-sensors=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-serialport-debug() {
  pkgdesc='Provides access to hardware and virtual serial ports'
  depends=('qt5-base')
  conflicts=('qt5-serialport')
  provides=("qt5-serialport=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-svg-debug() {
  pkgdesc='Classes for displaying the contents of SVG files'
  depends=('qt5-base')
  conflicts=('qt' 'qt5-svg')
  provides=("qt5-svg=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-tools-debug() {
  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' 'qt5-tools')
  options=('staticlibs' 'debug' '!strip') # libQt5UiTools builds as static only$
  provides=("qt5-tools=$pkgver")

  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/QtProject-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/"

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  # 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

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-translations-debug() {
  pkgdesc='A cross-platform application and UI framework (Translations)'
  depends=('qt5-base')
  conflicts=('qt' 'qt5-translations')
  provides=("qt5-translations=$pkgver")
  options=('debug' '!strip')

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

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-wayland-debug() {
  pkgdesc='Provides APIs for Wayland'
  depends=('qt5-base' 'libxcomposite' 'libxkbcommon')
  conflicts=('qt5-wayland')
  provides=("qt5-wayland=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-webchannel-debug() {
  pkgdesc='Provides access to QObject or QML objects from HTML clients for seamless integration of Qt applications with HTML/JavaScript clients'
  depends=('qt5-declarative')
  conflicts=('qt5-webchannel')
  provides=("qt5-webchannel=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-webengine-debug() {
  pkgdesc='Provides support for web applications using the Chromium browser project'
  depends=('qt5-webchannel' 'qt5-location' 'nss' 'libxtst' 'libxcursor' 'libxrandr' 'alsa-lib' 'libxcomposite')
  license=('LGPL')
  conflicts=('qt5-webengine')
  provides=("qt5-webengine=$pkgver")
  options=('debug' '!strip')

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

  rm -rf "${pkgdir}"/usr/share/doc
}

package_qt5-webkit-debug() {
  pkgdesc='Classes for a WebKit2 based implementation and a new QML API'
  depends=('qt5-sensors' 'qt5-location' 'qt5-webchannel' 'gst-plugins-base' 'libxslt'
           'libxcomposite' 'libwebp')
  optdepends=('gst-plugins-good: Webm codec support')
  license=('GPL3' 'LGPL' 'FDL')
  conflicts=('qt5-webkit')
  provides=("qt5-webkit=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

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

package_qt5-websockets-debug() {
  pkgdesc='Provides WebSocket communication compliant with RFC 6455'
  depends=('qt5-declarative')
  conflicts=('qt5-websockets')
  provides=("qt5-websockets=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-x11extras-debug() {
  pkgdesc='Provides platform-specific APIs for X11'
  depends=('qt5-base')
  conflicts=('qt5-x11extras')
  provides=("qt5-x11extras=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}

package_qt5-xmlpatterns-debug() {
  pkgdesc='Support for XPath, XQuery, XSLT and XML schema validation'
  depends=('qt5-base')
  conflicts=('qt' 'qt5-xmlpatterns')
  provides=("qt5-xmlpatterns=$pkgver")
  options=('debug' '!strip')

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

  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
  find "${pkgdir}/usr/lib" -type f -name '*.prl' \
    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;

  # 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

  install -D -m644 LGPL_EXCEPTION.txt \
    "${pkgdir}"/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
}