blob: 6ffd8e22826c841f98dc123ad4fe2f18a70530ba (
plain)
1 # Description: Qt Free Edition, version 5.x
2 # URL: http://qt-project.org/
3 # Maintainer: Danny Rawlins, crux at romster dot me
4 # Packager: predrag ivanovic, predivan at open dot telekom dot rs
5 # Depends on: dbus gst-plugins-base gst-plugins-base-compat libmng mesa3d xorg-libxcursor xorg-libxi xorg-libxinerama xorg-libxrandr xorg-xcb-util-image xorg-xcb-util-wm xorg-xcb-util-keysyms
6
7 name=qt5
8 version=5.4.2
9 release=1
10 source=(http://download.qt.io/official_releases/qt/${version%.*}/$version/single/qt-everywhere-opensource-src-$version.tar.xz
11 keypad-shortcuts.patch
12 avoid-calling-potentially-pure-virtual-method.patch
13 ibus-get-display-number-when-screen-number-is-omitted.patch)
14
15 build() {
16 cd qt-everywhere-opensource-src-$version
17
18 # https://bugs.archlinux.org/task/44676
19 patch -d qtbase -p1 -i $SRC/keypad-shortcuts.patch
20
21 # https://bugs.archlinux.org/task/43986
22 patch -d qtdeclarative -p1 -i $SRC/avoid-calling-potentially-pure-virtual-method.patch
23
24 # https://bugs.archlinux.org/task/45180
25 patch -d qtbase -p1 -i $SRC/ibus-get-display-number-when-screen-number-is-omitted.patch
26
27 # Respect system CXX
28 [ "$CXX" ] || CXX=g++
29 sed -i "/^QMAKE_CXX\s/s|=.*|= $CXX|" qtbase/mkspecs/common/g++-base.conf
30
31 # Remove obsolete xorg path
32 sed -i 's|X11R6/||g' qtbase/mkspecs/*/*.conf
33
34 # Respect system CXXFLAGS
35 sed -i "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${CXXFLAGS}|" qtbase/mkspecs/common/gcc-base.conf
36 #sed -i "s|-O2|$CXXFLAGS|" qtbase/mkspecs/common/g++-unix.conf
37 #sed -i "s|-O2|${CXXFLAGS}|" qtbase/mkspecs/common/{g++,gcc}-base.conf
38
39 # Respect system LDFLAGS
40 sed -i "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${LDFLAGS}|" qtbase/mkspecs/common/g++-unix.conf
41 #sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS}|g" qtbase/mkspecs/common/gcc-base.conf
42
43 # Fix quoting bug
44 sed -i 's|"$COMPILER" -c|$COMPILER -c|' qtbase/config.tests/unix/fvisibility.test
45
46 export QTDIR="$PWD"
47 export LD_LIBRARY_PATH="$QTDIR/qtbase/lib:$QTDIR/qttools/lib:$LD_LIBRARY_PATH"
48 export QT_PLUGIN_PATH="$QTDIR/qtbase/plugins"
49
50 ./configure -prefix /usr/share/qt5 \
51 -bindir /usr/share/qt5/bin \
52 -headerdir /usr/share/qt5/include \
53 -libdir /usr/share/qt5/lib \
54 -libexecdir /usr/share/qt5/lib \
55 -plugindir /usr/share/qt5/plugins \
56 -sysconfdir /usr/etc/xdg \
57 -openssl-linked -dbus-linked \
58 -system-lib{png,jpeg} -system-{zlib,sqlite} \
59 -no-cups -optimized-qmake \
60 -x{cursor,inerama,kb,randr,render} \
61 -nomake examples \
62 -no-separate-debug-info -no-strip -shared -no-rpath \
63 -opensource -confirm-license -release -reduce-relocations
64
65 make
66 make INSTALL_ROOT=$PKG install
67
68 # Fix paths
69 find $PKG/usr/share/qt5/lib -type f -name '*.prl' \
70 -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \;
71
72 sed -e "s|$PWD/qtbase|/usr/share/qt5/lib|g" \
73 -i $PKG/usr/share/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri
74
75 # Remove unnecessary files
76 rm -rf $(find $PKG/usr/share/qt5/mkspecs/* | \
77 egrep -v '(linux-g++|common|modules|pri|features)')
78
79 rm -f $PKG/usr/share/qt5/mkspecs/linux-g++/linux-g++
80 rm -rf $PKG/usr/share/qt5/mkspecs/features/{mac,win32}
81 rm -rf $PKG/usr/share/qt5/mkspecs/common/mac*
82 rm -rf $PKG/usr/share/qt5/{phrasebooks,translations}
83
84 # Install linker config
85 install -d $PKG/{etc/ld.so.conf.d,usr/{bin,lib,include}}
86 echo "/usr/share/qt5/lib" > $PKG/etc/ld.so.conf.d/qt5.conf
87
88 ln -s ../share/qt5/include $PKG/usr/include/qt5
89 ln -s ../share/qt5/lib $PKG/usr/lib/qt5
90 ln -s linux-g++ $PKG/usr/share/qt5/mkspecs/default
91
92 # Install pkg config
93 mv $PKG/usr/share/qt5/lib/pkgconfig $PKG/usr/lib
94
95 # Fix paths
96 sed \
97 -e "s|-L$SRC/qt-everywhere-opensource-src-$version/lib ||g" \
98 -e "s|$SRC/qt-everywhere-opensource-src-$version/bin|/usr/share/qt5/bin|g" \
99 -i $PKG/usr/lib/pkgconfig/*.pc
100
101 # Install useful symlinks
102 install -d $PKG/usr/bin
103 for b in $PKG/usr/share/qt5/bin/*; do
104 ln -s /usr/share/qt5/bin/$(basename $b) $PKG/usr/bin/$(basename $b)-qt5
105 done
106 }
|