summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4d6df5748f3f4a74be7ca4d2ed997d320d54cd38 (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
# Maintainer: Llewelyn Trahaearn <woefulderelict [at] gmail [dot] com>
# Contributor: MichaƂ Lisowski <lisu [at] riseup [dot] net>
# Contributor: Florian Pritz <flo [at] xssn [dot] at>
# Contributor: Felix Yan <felixonmars [at] archlinux [dot] org>
# Contributor: Andrea Scarpino <andrea[at] archlinux [dot] org>
# Contributor: Pierre Schmitz <pierre [at] archlinux [dot] de>

pkgname=lib32-qt4
pkgver=4.8.7
pkgrel=9
pkgdesc='A cross-platform application and UI framework (32-bit)'
arch=('x86_64')
url='http://qt-project.org/'
license=('GPL3' 'LGPL' 'FDL' 'custom')
depends=("${pkgname#lib32-}" 'lib32-alsa-lib' 'lib32-dbus' 'lib32-fontconfig' 'lib32-glib2'
         'lib32-libgl' 'lib32-libmng' 'lib32-libpng' 'lib32-libsm' 'lib32-libtiff'
         'lib32-libxi' 'lib32-libxrandr' 'lib32-libxv' 'lib32-openssl' 'lib32-sqlite')
makedepends=('cups' 'gcc-multilib'  'lib32-gtk2' 'lib32-libcups' 'lib32-libxfixes' 'lib32-mesa')
optdepends=('lib32-libxcursor: Xcursor support'
            'lib32-libxfixes: Xfixes support'
            'lib32-libxinerama: Xinerama support'
            'lib32-sni-qt: StatusNotifierItem (AppIndicators) support')
options=('staticlibs') # libQtUiTools builds as static only FS#36606
conflicts=('lib32-qt')
replaces=('lib32-qt<=4.8.4')
_pkgfqn="qt-everywhere-opensource-src-${pkgver}"
source=("http://download.qt.io/official_releases/qt/4.8/${pkgver}/${_pkgfqn}.tar.gz"
        'improve-cups-support.patch'
        'moc-boost-workaround.patch'
        'kubuntu_14_systemtrayicon.diff'
        'kde4-settings.patch'
        'glib-honor-ExcludeSocketNotifiers-flag.diff'
        'disable-sslv3.patch'
        'l-qclipboard_fix_recursive.patch'
        'l-qclipboard_delay.patch'
        'qt4-gcc6.patch')
sha512sums=('f9f81a2e7205e1fd05c8d923dc73244f29aa33f951fa6b7c5c8193449328b37084796b9b71ad0c317e4e6fd00017c10ea5d67b1b2032551cde00548522218125'
            '4a8f828c79bde81ab1e39c9eaba4ef553582d85b62d6d182dda02820c4c8e046de6a25cc77d228955ed37fbc5b55f697a0a464af0bb3e171849851639e9ef4ee'
            'b4eced1fe34f09baa987be59fd21a02f4209551f491ae113c9d1cc3c44b00494a909808e22db306bcae0ee4c4f996097ce2c23994b2ac067cf9f599da5a5fc71'
            'c987f478e6da84e26ef5085c2a354cf085227e75af84d24b1497cfb046cfed89858bfed21850cf9dc0f5df2b66f9eed3ca8955a8c9df81cdddc9b98257231319'
            'fe70a3032164233107aa71ba076ca420be3e179225c9cfb3b7f3ff192abb0eecddebf8cec681461ab7c615191028415ff88f98047e383d7388fefe9e267e00a4'
            '6d5216e539d93352cd5f5ca98b5296feba702feba1f198f81de650c399076f0161d8ae712ecd79f1c2833b00b5ce7d4c390e33bbeb7e5542c6860a58a6785cab'
            '922919e5331b392f4a189e2745fd404c98baac797ba543a78c27e4fa7ec4067625f03c03b6c3c943327ee82cf077804ce3b8eb1684a2e265714b6188f8dbae74'
            'bd63961bcb695beebe8686142b84bff7702db4d85d737f5c2da927252b931700d03602f80048223cbbb05d85a5ddb9cb818321d756577f84843690b318f0c413'
            '0215f81fd0ed3483d1f79f46a53d9378f7462901410f4bc3f235325974c155454b0e75cba5222180e5ca62099cba7b80419b5fab86380ac6d951b9ae12714444'
            'efe8e1842882b784a14ba137bc6a8a579d5133e579f98c61674f5d3d9b79ff8e895775a79fcf757f7726377cd221396a678d181fa069416b0760a5241d39845a')

prepare() {
  cd $_pkgfqn

  # (FS#28381) (KDEBUG#180051)
  patch -p1 -i "${srcdir}"/improve-cups-support.patch

  # QTBUG#22829
  patch -p1 -i "${srcdir}"/moc-boost-workaround.patch

  # http://blog.martin-graesslin.com/blog/2014/06/where-are-my-systray-icons/
  patch -p1 -i "${srcdir}"/kubuntu_14_systemtrayicon.diff

  # FS#45106
  patch -p0 -i "${srcdir}"/kde4-settings.patch

  # fixes for LibreOffice from the upstream Qt bug tracker FS#46436, FS#41648, FS#39819
  # https://bugreports.qt.io/browse/QTBUG-37380
  patch -p1 -i "${srcdir}"/glib-honor-ExcludeSocketNotifiers-flag.diff
  # https://bugreports.qt.io/browse/QTBUG-34614
  patch -p0 -i "${srcdir}"/l-qclipboard_fix_recursive.patch
  # https://bugreports.qt.io/browse/QTBUG-38585
  patch -p0 -i "${srcdir}"/l-qclipboard_delay.patch

  # React to OpenSSL's OPENSSL_NO_SSL3 define
  patch -p1 -i "${srcdir}"/disable-sslv3.patch

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

  sed -i "/^QMAKE_LINK\s/s|g++|g++ -m32|g" mkspecs/common/g++-base.conf
  sed -i "s|-Wl,-O1|-m32 -Wl,-O1|" mkspecs/common/g++-unix.conf
  sed -e "s|-O2|$CXXFLAGS -m32|" \
      -e "/^QMAKE_RPATH/s| -Wl,-rpath,||g" \
      -e "/^QMAKE_LINK\s/s|g++|g++ -m32|g" \
      -e "/^QMAKE_LFLAGS\s/s|+=|+= $LDFLAGS|g" \
      -i mkspecs/common/g++.conf

  cp mkspecs/common/linux{,32}.conf
  sed -i "/^QMAKE_LIBDIR\s/s|=|= /usr/lib32|g" mkspecs/common/linux32.conf
  sed -i "s|common/linux.conf|common/linux32.conf|" mkspecs/linux-g++-32/qmake.conf

  # Fix build with GCC6 (Fedora)
  patch -p1 -i "$srcdir"/qt4-gcc6.patch
}

build() {
  cd $_pkgfqn
  export QT4DIR=${srcdir}/${_pkgfqn}
  export LD_LIBRARY_PATH=${QT4DIR}/lib:${LD_LIBRARY_PATH}
  export CXXFLAGS+=" -std=gnu++98" # Fix build with GCC 6
  export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
#  export PKG_CONFIG_LIBDIR='/usr/lib32/pkgconfig'
  
  ./configure -confirm-license -opensource -platform linux-g++-32 \
    -prefix /usr \
    -bindir /usr/lib/qt4/bin \
    -headerdir /usr/include/qt4 \
    -libdir /usr/lib32 \
    -plugindir /usr/lib32/qt4/plugins \
    -importdir /usr/lib32/qt4/imports \
    -datadir /usr/share/qt4 \
    -translationdir /usr/share/qt4/translations \
    -sysconfdir /etc/xdg \
    -system-sqlite \
    -no-phonon \
    -no-phonon-backend \
    -no-webkit \
    -graphicssystem raster \
    -openssl-linked \
    -nomake demos \
    -nomake examples \
    -nomake docs \
    -silent \
    -no-rpath \
    -optimized-qmake \
    -no-reduce-relocations \
    -dbus-linked \
    -no-openvg
  make
}

package() {
  cd $_pkgfqn
  make INSTALL_ROOT="${pkgdir}" install

  # Remove conflicting files.
  rm -rf "${pkgdir}"/usr/{bin,include,lib,share}

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

  # Fix wrong libs path in pkgconfig files
  find "${pkgdir}/usr/lib32/pkgconfig" -type f -name '*.pc' \
    -exec perl -pi -e "s, -L${srcdir}/?\S+,,g" {} \;

  # Fix wrong bins path in pkgconfig files
  find "${pkgdir}/usr/lib32/pkgconfig" -type f -name '*.pc' \
    -exec sed -i 's|/usr/bin/|/usr/lib/qt4/bin/|g' {} \;

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

  # The TGA plugin is broken (FS#33568)
  rm "${pkgdir}"/usr/lib32/qt4/plugins/imageformats/libqtga.so
}