PKGBUILDs/extra/qt4/PKGBUILD

225 lines
8.8 KiB
Bash
Raw Normal View History

2015-04-10 18:44:52 +00:00
# $Id: PKGBUILD 179026 2013-03-01 17:55:20Z andrea $ Maintainer:
# Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
2013-03-02 01:37:30 +00:00
# Contributor: Pierre Schmitz <pierre@archlinux.de>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - Just say NO to x86 optimizations, and no neon
# - disabled distcc - bad things happen
# - added -fno-strict-volatile-bitfields to CXXFLAGS to fix ARM bug
# - no libfbclient/ibase, issues building on ARM
2015-07-14 03:09:00 +00:00
# - patch for AArch64, define platform as linux-g++, reduce concurrency
2013-03-02 01:37:30 +00:00
pkgname=qt4
2015-06-03 12:20:56 +00:00
pkgver=4.8.7
2017-04-29 16:18:50 +00:00
pkgrel=19
2013-03-02 01:37:30 +00:00
arch=('i686' 'x86_64')
url='http://qt-project.org/'
2013-08-28 00:35:40 +00:00
license=('GPL3' 'LGPL' 'FDL' 'custom')
2013-03-02 01:37:30 +00:00
pkgdesc='A cross-platform application and UI framework'
2016-10-04 12:27:47 +00:00
depends=('sqlite' 'ca-certificates' 'fontconfig' 'libgl' 'libxrandr' 'libxv' 'libxi' 'alsa-lib'
2017-04-24 18:56:13 +00:00
'xdg-utils' 'hicolor-icon-theme' 'desktop-file-utils' 'libmng' 'dbus' 'openssl-1.0')
2013-03-26 02:59:39 +00:00
makedepends=('postgresql-libs' 'mariadb' 'unixodbc' 'cups' 'gtk2'
2013-10-18 23:56:40 +00:00
'mesa')
2016-10-04 12:27:47 +00:00
optdepends=('postgresql-libs: PostgreSQL driver'
2013-03-25 21:11:59 +00:00
'libmariadbclient: MariaDB driver'
2013-03-02 01:37:30 +00:00
'unixodbc: ODBC driver'
'libxinerama: Xinerama support'
'libxcursor: Xcursor support'
'libxfixes: Xfixes support'
2014-12-14 18:50:54 +00:00
'icu: Unicode support'
'sni-qt: StatusNotifierItem (AppIndicators) support')
2013-10-22 13:36:25 +00:00
options=('!distcc')
2013-03-02 01:37:30 +00:00
replaces=('qt<=4.8.4')
conflicts=('qt')
_pkgfqn="qt-everywhere-opensource-src-${pkgver}"
2015-06-03 12:20:56 +00:00
source=("http://download.qt.io/official_releases/qt/4.8/${pkgver}/${_pkgfqn}.tar.gz"
2013-05-10 18:56:40 +00:00
'qtconfig-qt4.desktop' 'assistant-qt4.desktop' 'designer-qt4.desktop'
'linguist-qt4.desktop' 'qdbusviewer-qt4.desktop'
2013-08-28 00:35:40 +00:00
'improve-cups-support.patch'
2014-11-06 02:59:35 +00:00
'moc-boost-workaround.patch'
2015-05-06 12:43:40 +00:00
'kubuntu_14_systemtrayicon.diff'
2015-07-14 03:09:00 +00:00
'kde4-settings.patch'
2015-12-31 18:33:21 +00:00
'glib-honor-ExcludeSocketNotifiers-flag.diff'
2016-03-06 16:26:50 +00:00
'disable-sslv3.patch'
2015-12-31 18:33:21 +00:00
'l-qclipboard_fix_recursive.patch'
'l-qclipboard_delay.patch'
2017-04-29 16:18:50 +00:00
'qt4-gcc6.patch' 'qt4-glibc-2.25.patch' 'qt4-icu59.patch'
2015-07-14 03:09:00 +00:00
'qt-aarch64.patch')
2017-04-29 16:18:50 +00:00
sha256sums=('e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0'
'157eb47865f0b43e4717819783823c569127a2e9fc48309982ca0f2b753517a1'
'd63f22858174489068c30a12b9115d1b4e23ade00c31c117513212e9a225c1ce'
'c154de65da1b81564fa68f29c773b5f1751e0ee821e858ee8f0684b8d027da58'
'22bd69ee3ba986448a63e41f529a7d28d0f2e6d83d6114e763eba761db302e01'
'915a1cb0f7328840cac742c03f5121dc6e19498952c082b46c0bf7263bf6676d'
'3ccfefb432015e4a4ea967b030c51b10dcdfb1f63445557908ddae5e75012d33'
'876c681ef8fbcc25f28cd4ad6c697abf8a4165d540bae37433bc40256dbf9d62'
'9fad22674c5eec835613a7f16c11b865aa793b448e90974c0f804105284a548b'
'ce97da195445f145d9f82df8f8e5d8716128e869ec6632db66c7125be663d813'
'e7f8d1c906640b836454e8202a48602352609d8e44a33a3de05dc1d20f5b1a8a'
'829b02ba10f208c2beba8e8a0110b6d10c63932612dabc08d536f099b9f66101'
'5db36cbb0686b8a503941779c821febc4a0330dc260e51d603f7aa1e4d8860ad'
'af3648ddb2372333b0e428788fd2ffbcfe571653fb46f898a55ae5a202f7e242'
'51da49e41edac66559d3ec8dd0a152995a51a53e5d1f63f09fa089a8af7e3112'
'e6555f4a681227447e94e9f14e11626d50b7e5108aad06088311e87063bc0347'
'61d6bf45649c728dec5f8d22be5b496ed9d40f52c2c70102696d07133cd1750d'
'9269bd8552688b75be1468eaca6afdc0c054e644a73a9cffddb6855a96faf86f')
2013-03-02 01:37:30 +00:00
2013-07-02 13:44:25 +00:00
prepare() {
2013-03-02 01:37:30 +00:00
cd ${_pkgfqn}
2015-07-14 03:09:00 +00:00
# AArch64 support
patch -p1 -i "${srcdir}"/qt-aarch64.patch
2013-03-02 01:37:30 +00:00
# (FS#28381) (KDEBUG#180051)
patch -p1 -i "${srcdir}"/improve-cups-support.patch
2014-11-06 02:59:35 +00:00
# QTBUG#22829
patch -p1 -i "${srcdir}"/moc-boost-workaround.patch
2013-03-02 01:37:30 +00:00
2014-12-14 18:50:54 +00:00
# http://blog.martin-graesslin.com/blog/2014/06/where-are-my-systray-icons/
patch -p1 -i "${srcdir}"/kubuntu_14_systemtrayicon.diff
2013-03-02 01:37:30 +00:00
export CXXFLAGS="$CXXFLAGS -fno-strict-volatile-bitfields"
2015-06-03 12:20:56 +00:00
# FS#45106
patch -p0 -i "${srcdir}"/kde4-settings.patch
2015-05-06 12:43:40 +00:00
2015-12-31 18:33:21 +00:00
# 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
2016-03-06 16:26:50 +00:00
# React to OpenSSL's OPENSSL_NO_SSL3 define
patch -p1 -i "${srcdir}"/disable-sslv3.patch
2013-03-02 01:37:30 +00:00
sed -i "s|-O2|${CXXFLAGS}|" 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}|g" mkspecs/common/gcc-base.conf
2015-07-14 03:09:00 +00:00
2013-07-02 13:44:25 +00:00
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
2016-10-04 12:27:47 +00:00
# Fix build with GCC6 (Fedora)
patch -p1 -i "$srcdir"/qt4-gcc6.patch
2017-03-13 19:10:12 +00:00
# Fix build of Qt4 applications with glibc 2.25 (Fedora)
patch -p1 -i "$srcdir"/qt4-glibc-2.25.patch
2017-04-29 16:18:50 +00:00
# Fix build with ICU 59 (pld-linux)
patch -p1 -i "$srcdir"/qt4-icu59.patch
2013-07-02 13:44:25 +00:00
}
build() {
export QT4DIR="${srcdir}"/${_pkgfqn}
export LD_LIBRARY_PATH=${QT4DIR}/lib:${LD_LIBRARY_PATH}
2016-10-04 12:27:47 +00:00
export CXXFLAGS+=" -std=gnu++98" # Fix build with GCC 6
2017-04-24 18:56:13 +00:00
export OPENSSL_LIBS='-L/usr/lib/openssl-1.0 -lssl -lcrypto'
export CXXFLAGS+=" -I/usr/include/openssl-1.0"
2013-07-02 13:44:25 +00:00
2017-03-13 19:10:12 +00:00
cd ${_pkgfqn}
2015-07-14 03:09:00 +00:00
if [[ $CARCH == "aarch64" ]]; then
MAKEFLAGS="-j3"
CONFIG="-platform linux-g++"
fi
2013-03-02 01:37:30 +00:00
./configure -confirm-license -opensource \
-prefix /usr \
-bindir /usr/lib/qt4/bin \
-headerdir /usr/include/qt4 \
-docdir /usr/share/doc/qt4 \
-plugindir /usr/lib/qt4/plugins \
-importdir /usr/lib/qt4/imports \
-datadir /usr/share/qt4 \
-translationdir /usr/share/qt4/translations \
-sysconfdir /etc/xdg \
-examplesdir /usr/share/doc/qt4/examples \
-demosdir /usr/share/doc/qt4/demos \
-plugin-sql-{psql,mysql,sqlite,odbc} \
-system-sqlite \
-no-phonon \
-no-phonon-backend \
-no-webkit \
-graphicssystem raster \
-openssl-linked \
-nomake demos \
-nomake examples \
-nomake docs \
-silent \
-no-rpath \
-optimized-qmake \
2015-07-22 15:49:04 +00:00
-no-reduce-relocations \
2013-03-02 01:37:30 +00:00
-dbus-linked \
-no-openvg \
2013-03-02 02:59:27 +00:00
-no-mmx \
2013-03-02 01:37:30 +00:00
-no-3dnow \
-no-sse \
-no-sse2 \
-no-sse3 \
-no-ssse3 \
-no-sse4.1 \
-no-sse4.2 \
-no-avx \
2015-07-14 03:09:00 +00:00
-no-neon $CONFIG
2013-03-02 02:59:27 +00:00
2013-03-02 01:37:30 +00:00
make
}
package() {
cd ${_pkgfqn}
make INSTALL_ROOT="${pkgdir}" install
# install missing icons and desktop files
install -D -m644 src/gui/dialogs/images/qtlogo-64.png \
2013-05-10 18:56:40 +00:00
"${pkgdir}"/usr/share/icons/hicolor/64x64/apps/qt4logo.png
install -D -m644 tools/assistant/tools/assistant/images/assistant.png \
"${pkgdir}"/usr/share/icons/hicolor/32x32/apps/assistant-qt4.png
install -D -m644 tools/assistant/tools/assistant/images/assistant-128.png \
"${pkgdir}"/usr/share/icons/hicolor/128x128/apps/assistant-qt4.png
install -D -m644 tools/designer/src/designer/images/designer.png \
"${pkgdir}"/usr/share/icons/hicolor/128x128/apps/designer-qt4.png
for icon in tools/linguist/linguist/images/icons/linguist-*-32.png ; do
size=$(echo $(basename ${icon}) | cut -d- -f2)
install -D -m644 ${icon} \
"${pkgdir}"/usr/share/icons/hicolor/${size}x${size}/apps/linguist-qt4.png
done
install -D -m644 tools/qdbus/qdbusviewer/images/qdbusviewer.png \
"${pkgdir}"/usr/share/icons/hicolor/32x32/apps/qdbusviewer-qt4.png
install -D -m644 tools/qdbus/qdbusviewer/images/qdbusviewer-128.png \
"${pkgdir}"/usr/share/icons/hicolor/128x128/apps/qdusviewer-qt4.png
2013-03-02 01:37:30 +00:00
2013-03-25 21:11:59 +00:00
install -d "${pkgdir}"/usr/share/applications
2013-05-10 18:56:40 +00:00
install -m644 "${srcdir}"/{assistant,designer,linguist,qtconfig,qdbusviewer}-qt4.desktop \
"${pkgdir}"/usr/share/applications/
2013-03-02 01:37:30 +00:00
# Useful symlinks for cmake and configure scripts
install -d "${pkgdir}"/usr/bin
for b in "${pkgdir}"/usr/lib/qt4/bin/*; do
ln -s /usr/lib/qt4/bin/$(basename $b) "${pkgdir}"/usr/bin/$(basename $b)-qt4
done
# install license addition
install -D -m644 LGPL_EXCEPTION.txt \
${pkgdir}/usr/share/licenses/${pkgname}/LGPL_EXCEPTION.txt
# Fix wrong libs path in pkgconfig files
find "${pkgdir}/usr/lib/pkgconfig" -type f -name '*.pc' \
-exec perl -pi -e "s, -L${srcdir}/?\S+,,g" {} \;
# Fix wrong bins path in pkgconfig files
find "${pkgdir}/usr/lib/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/lib" -type f -name '*.prl' \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
2013-03-03 00:46:50 +00:00
# The TGA plugin is broken (FS#33568)
rm "${pkgdir}"/usr/lib/qt4/plugins/imageformats/libqtga.so
2013-03-02 01:37:30 +00:00
}