wok-next view qt5/receipt @ rev 20514

ardour, gdal, icu, js, jsoncpp, libvpx, llvm, mesa, minetest, opencv, qt5, scilab, webkit2gtk, webkitgtk, xalan-c: remove std.patch, use `fix math`.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Mar 21 16:15:19 2018 +0200 (2018-03-21)
parents d43bf7aae921
children 30967bd5b948
line source
1 # SliTaz package receipt v2.
3 PACKAGE="qt5"
4 VERSION="5.9.1"
5 CATEGORY="meta"
6 SHORT_DESC="Cross-platform application framework"
7 MAINTAINER="al.bobylev@gmail.com"
8 LICENSE="LGPL3 GPL3"
9 WEB_SITE="https://www.qt.io/"
10 LFS="http://www.linuxfromscratch.org/blfs/view/stable/x/qt5.html"
12 TARBALL="qt-everywhere-opensource-src-$VERSION.tar.xz"
13 WGET_URL="https://download.qt.io/archive/qt/${VERSION%.*}/$VERSION/single/$TARBALL"
15 PATCH="Do-not-make-lack-of-SSE2-support-on-x86-32-fatal.patch"
16 PATCH_URL="https://anonscm.debian.org/cgit/pkg-kde/qt/qtdeclarative.git/plain/debian/patches/"
18 BUILD_DEPENDS="dbus-dev eudev-dev zlib-dev glib-dev icu-dev pcre-dev \
19 openssl-dev sqlite3-dev xorg-libxcb-dev mesa-dev freetype-dev fontconfig-dev \
20 libinput-dev harfbuzz-dev libjpeg-turbo-dev libpng16-dev tslib-dev \
21 xorg-libX11-dev libxkbcommon-dev xorg-libXrender-dev cups-dev \
22 xorg-libXcomposite-dev alsa-lib-dev gst1-plugins-base-dev gtk+3-dev"
23 # Name split packages according to sources structure, for example:
24 # $src/qtgamepad/ -> qt5-gamepad
25 SPLIT="qt5-3d qt5-base qt5-base-gtk3 \
26 qt5-canvas3d qt5-charts qt5-connectivity \
27 qt5-datavis3d qt5-declarative qt5-gamepad \
28 qt5-graphicaleffects qt5-imageformats qt5-location \
29 qt5-multimedia qt5-networkauth qt5-purchasing \
30 qt5-quickcontrols qt5-quickcontrols2 qt5-remoteobjects \
31 qt5-script qt5-scxml qt5-sensors \
32 qt5-serialbus qt5-serialport qt5-speech \
33 qt5-svg qt5-tools qt5-virtualkeyboard \
34 qt5-wayland qt5-webchannel qt5-websockets \
35 qt5-x11extras qt5-xmlpatterns qt5-base-egl \
36 \
37 qt5-locale-ar qt5-locale-ca qt5-locale-cs qt5-locale-da \
38 qt5-locale-de qt5-locale-en qt5-locale-es qt5-locale-fa \
39 qt5-locale-fi qt5-locale-fr qt5-locale-gl qt5-locale-he \
40 qt5-locale-hu qt5-locale-it qt5-locale-ja qt5-locale-ko \
41 qt5-locale-lt qt5-locale-lv qt5-locale-pl qt5-locale-pt \
42 qt5-locale-ru qt5-locale-sk qt5-locale-sl qt5-locale-sv \
43 qt5-locale-uk qt5-locale-zh_CN qt5-locale-zh_TW \
44 \
45 qt5-doc qt5-dev"
47 compile_rules() {
48 fix math
49 export QT5PREFIX=/usr # or /opt/qt5
50 if [ "$QT5PREFIX" == '/usr' ]; then
51 QT5OPTS="\
52 -archdatadir /usr/lib/qt5 \
53 -bindir /usr/bin \
54 -plugindir /usr/lib/qt5/plugins \
55 -importdir /usr/lib/qt5/imports \
56 -headerdir /usr/include/qt5 \
57 -datadir /usr/share/qt5 \
58 -docdir /usr/share/doc/qt5 \
59 -translationdir /usr/share/qt5/translations \
60 -examplesdir /usr/share/doc/qt5/examples \
61 "
62 fi
64 echo "INCLUDEPATH += /usr/include/openssl-1.0" >> qtbase/src/network/network.pro
65 export OPENSSL_LIBS='-L/usr/lib/openssl-1.0 -lssl -lcrypto'
67 [ -s $SRC/$PATCH ] || wget -O $SRC/$PATCH $PATCH_URL$PATCH
68 cd $src/qtdeclarative
69 cp $SRC/$PATCH ./$PATCH
70 patch -p1 -i $PATCH
71 cd ..
73 # Build qmake (and all following things with it) using existing CFLAGS and LDFLAGS
74 sed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 $CFLAGS -DQT_MATH_H_DEFINES_MACROS=1|" \
75 qtbase/mkspecs/common/gcc-base.conf
76 sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 $LDFLAGS|" \
77 qtbase/mkspecs/common/g++-unix.conf
79 # Fix missing private includes https://bugreports.qt.io/browse/QTBUG-37417
80 sed -e '/CMAKE_NO_PRIVATE_INCLUDES\ \=\ true/d' -i \
81 qtbase/mkspecs/features/create_cmake.prf
83 ./configure \
84 -prefix $QT5PREFIX \
85 $QT5OPTS \
86 -sysconfdir /etc/xdg \
87 -confirm-license \
88 -opensource \
89 -dbus-linked \
90 -openssl-linked \
91 -system-harfbuzz \
92 -system-sqlite \
93 -nomake examples \
94 -no-rpath \
95 -no-sse2 \
96 -skip qtwebengine &&
97 make &&
98 make INSTALL_ROOT=$install install || exit 1
100 # find $install$QT5PREFIX/lib/pkgconfig -name '*.pc' \
101 # -exec perl -pi -e "s, -L$PWD/?\S+,,g" {} \; &&
102 # find $install$QT5PREFIX/ -name qt_lib_bootstrap_private.pri \
103 # -exec sed -i -e "s:$PWD/qtbase:/$QT5PREFIX/lib/:g" {} \; &&
104 find $install$QT5PREFIX/ -name '*.prl' \
105 -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' '{}' \;
107 QT5BINDIR=$QT5PREFIX/bin
109 install -v -dm755 $install/usr/share/pixmaps/
111 install -v -Dm644 qttools/src/assistant/assistant/images/assistant-128.png $install/usr/share/pixmaps/assistant-qt5.png
112 install -v -Dm644 qttools/src/designer/src/designer/images/designer.png $install/usr/share/pixmaps/designer-qt5.png
113 install -v -Dm644 qttools/src/linguist/linguist/images/icons/linguist-128-32.png $install/usr/share/pixmaps/linguist-qt5.png
114 install -v -Dm644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer-128.png $install/usr/share/pixmaps/qdbusviewer-qt5.png
116 mkdir -p $install/usr/share/applications
117 for i in $stuff/apps/*.desktop.in; do
118 sed "s|@QT5BINDIR@|$QT5BINDIR|" $i > $install/usr/share/applications/$(basename $i .in)
119 done
121 for file in moc uic rcc qmake lconvert lrelease lupdate; do
122 if [ "$QT5BINDIR" == '/usr/bin' ]; then
123 ln -sfvn $file $install/usr/bin/$file-qt5
124 else
125 ln -sfvn $QT5BINDIR/$file $install/usr/bin/$file-qt5
126 fi
127 done
129 # tweak permissions
130 find $install -type f -perm 664 -exec chmod 644 '{}' \;
131 find $install -type f -perm 775 -exec chmod 755 '{}' \;
132 }
134 genpkg_rules() {
135 # How to split Qt5?
136 # It contains: 41 executables in bin/, 61 different libraries in lib/,
137 # 27 folders in plugins/, 27 languages in translations/.
138 # 156 packages for Qt5? It's a bit too much, isn't it?
139 #
140 # Let's deep into $src...
141 # Each folder here is a module (with rare exceptions). 41 pieces.
142 # Let use these folders as a landmark to make Qt5 packages.
143 # Each folder may contain: executables (examine bin/ subfolder), libraries
144 # (lib/), plugins (plugins/), and qml (not sure what is it, but examine
145 # qml/ subfolder). Note, some qml directories may be shared across different
146 # Qt5 packages, so add only sub(-sub(-sub))-folders that contain "qmldir"
147 # inside it.
148 #
149 # Let's begin.
150 #
151 case $PACKAGE in
152 qt5)
153 COOKOPTS="!pixmaps !menus"
154 DEPENDS="$SPLIT";;
155 qt5-locale-*)
156 la=${PACKAGE#qt5-locale-}
157 copy *_$la.qm
158 case $la in
159 ar) lo='Arabic';; ca) lo='Catalan';;
160 cs) lo='Czech';; da) lo='Danish';;
161 de) lo='German';; en) lo='English';;
162 es) lo='Spanish';; fa) lo='Persian';;
163 fi) lo='Finnish';; fr) lo='French';;
164 gl) lo='Galician';; he) lo='Hebrew';;
165 hu) lo='Hungarian';; it) lo='Italian';;
166 ja) lo='Japanese';; ko) lo='Korean';;
167 lt) lo='Lithuanian';; lv) lo='Latvian';;
168 pl) lo='Polish';; pt) lo='Portuguese';;
169 ru) lo='Russian';; sk) lo='Slovak';;
170 sl) lo='Slovenian';; sv) lo='Swedish';;
171 uk) lo='Ukrainian';; zh_CN) lo='Chinese simplified';;
172 zh_TW) lo='Chinese traditional';;
173 esac
174 CAT="localization|$lo locale"
175 DEPENDS=" ";;
176 qt5-doc)
177 copy doc/
178 CAT="docs|documentation"
179 DEPENDS="qt5-base";;
180 qt5-dev)
181 copy @dev qt5/include/ mkspecs/ *.cmake *.prl qmake.conf
182 # Binaries from qt5-base:
183 copy fixqt4headers.pl moc moc-qt5 qdbuscpp2xml qdbusxml2cpp qlalr \
184 qmake qmake-qt5 rcc rcc-qt5 syncqt.pl uic uic-qt5 \
185 builtins.qmltypes
186 DEPENDS="qt5";;
187 qt5-base-gtk3)
188 copy libqgtk3.so
189 CAT="development|GTK+3 theme support"
190 DEPENDS="qt5-base atk cairo gdk-pixbuf glib gtk+3 mesa pango \
191 xorg-libX11 xorg-libXext";;
192 qt5-base-egl)
193 copy libQt5Egl*so*
194 CAT="development|EGL libs"
195 DEPENDS="qt5-base mesa mesa-libegl mesa-libgbm" ;;
196 *)
197 # examine folders in $src to understand what we need to copy from $install
198 examine="$src/qt${PACKAGE#qt5-}"
200 unset binaries libraries plugins qml
202 # output "base names" of files found in bin/ subfolder
203 [ -d "$examine/bin" ] &&
204 binaries=$(find $examine/bin -type f | awk -F/ '{print $NF}')
206 # the same thing with lib/
207 [ -d "$examine/lib" ] &&
208 libraries=$(find $examine/lib -name '*.so' | awk -F/ '{print $NF}')
210 # libraries in plugins/ sub-folder
211 [ -d "$examine/plugins" ] &&
212 plugins=$(find $examine/plugins -name '*.so' | awk -F/ '{print $NF}')
214 # libraries in qml/ sub-folder
215 [ -d "$examine/qml" ] &&
216 qml=$(cd $examine; find ./qml -name 'qmldir' | sed 's|^./||; s|qmldir$||')
218 copy $binaries $plugins $(
219 for i in $libraries; do echo "$i*"; done
220 for i in $qml; do echo $i; done)
221 ;;
222 esac
223 case $PACKAGE in
224 qt5-3d)
225 CAT="development|3D module"
226 DEPENDS="qt5-base qt5-declarative qt5-gamepad mesa zlib";;
228 qt5-base)
229 # Move binaries (that required for compiling the packages) to qt5-dev
230 rm -r $fs/usr/bin
232 # Move to qt5-base-gtk3 because only it depends on GTK3 and friends
233 rm $fs/usr/lib/qt5/plugins/platformthemes/libqgtk3.so
235 # Move to qt5-base-egl
236 rm -f $fs/usr/lib/libQt5Egl*
238 CAT="development|Base module"
239 DEPENDS="dbus eudev fontconfig freetype glib icu openssl libcups \
240 libdrm libharfbuzz libicu libinput libjpeg-turbo libpng16 \
241 libsqlite3 libxkbcommon libxkbcommon-x11 mesa \
242 mtdev tslib xorg-libICE xorg-libSM xorg-libX11 xorg-libXext \
243 xorg-libXi xorg-libxcb zlib libatomic";;
244 qt5-canvas3d)
245 CAT="development|Canvas3D module"
246 DEPENDS="qt5-base qt5-declarative mesa";;
247 qt5-charts)
248 CAT="development|Charts module"
249 DEPENDS="qt5-base qt5-declarative mesa";;
250 qt5-connectivity)
251 CAT="development|Connectivity module"
252 DEPENDS="qt5-base qt5-declarative mesa";;
253 qt5-datavis3d)
254 CAT="development|DataVisualization module"
255 DEPENDS="qt5-base qt5-declarative mesa";;
256 qt5-declarative)
257 CAT="development|Declarative module"
258 DEPENDS="qt5-base qt5-remoteobjects qt5-xmlpatterns mesa";;
259 qt5-gamepad)
260 CAT="development|Gamepad module"
261 DEPENDS="qt5-base qt5-declarative eudev mesa";;
262 qt5-graphicaleffects)
263 CAT="development|GraphicalEffects module"
264 DEPENDS="qt5-base qt5-declarative mesa";;
265 qt5-imageformats)
266 CAT="development|imageformats module"
267 DEPENDS="qt5-base mesa tiff";;
268 qt5-location)
269 CAT="development|Location module"
270 DEPENDS="qt5-base qt5-declarative icu openssl libicu openssl \
271 mesa zlib";;
272 qt5-multimedia)
273 CAT="development|Multimedia module"
274 DEPENDS="qt5-base qt5-declarative alsa-lib glib gst1-plugins-base \
275 gstreamer1 mesa";;
276 qt5-networkauth)
277 CAT="development|NetworkAuth module"
278 DEPENDS="qt5-base mesa";;
279 qt5-purchasing)
280 CAT="development|Purchasing module"
281 DEPENDS="qt5-base qt5-declarative mesa";;
282 qt5-quickcontrols)
283 CAT="development|QuickControls module"
284 DEPENDS="qt5-base qt5-declarative mesa";;
285 qt5-quickcontrols2)
286 CAT="development|QuickControls2 module"
287 DEPENDS="qt5-base qt5-declarative mesa";;
288 qt5-remoteobjects)
289 rm -r $fs/usr/lib/qt5/ # interception with qt5-declarative
290 CAT="development|RemoteObjects module"
291 DEPENDS="qt5-base";;
292 qt5-script)
293 CAT="development|Script module"
294 DEPENDS="qt5-base mesa";;
295 qt5-scxml)
296 CAT="development|SCXML module"
297 DEPENDS="qt5-base qt5-declarative";;
298 qt5-sensors)
299 CAT="development|Sensors module"
300 DEPENDS="qt5-base qt5-declarative mesa";;
301 qt5-serialbus)
302 CAT="development|SerialBus module"
303 DEPENDS="qt5-base qt5-serialport";;
304 qt5-serialport)
305 CAT="development|SerialPort module"
306 DEPENDS="qt5-base eudev";;
307 qt5-speech)
308 CAT="development|Speech module"
309 DEPENDS="qt5-base";;
310 qt5-svg)
311 CAT="development|SVG module"
312 DEPENDS="qt5-base mesa zlib";;
313 qt5-tools)
314 copy applications/ pixmaps/ phrasebooks/ lconvert-qt5 lrelease-qt5 \
315 lupdate-qt5
316 CAT="development|Tools module"
317 DEPENDS="qt5-base qt5-declarative mesa";;
318 qt5-virtualkeyboard)
319 CAT="development|VirtualKeyboard module"
320 DEPENDS="qt5-base qt5-declarative qt5-svg mesa xorg-libxcb";;
321 qt5-wayland)
322 CAT="development|Wayland module"
323 DEPENDS="qt5-base qt5-declarative fontconfig freetype glib \
324 libxkbcommon mesa mesa-libegl mesa-libwayland-egl wayland \
325 xorg-libX11 xorg-libXcomposite xorg-libXext";;
326 qt5-webchannel)
327 CAT="development|WebChannel module"
328 DEPENDS="qt5-base qt5-declarative mesa";;
329 qt5-websockets)
330 CAT="development|WebSockets module"
331 DEPENDS="qt5-base qt5-declarative";;
332 qt5-x11extras)
333 CAT="development|X11Extras module"
334 DEPENDS="qt5-base mesa";;
335 qt5-xmlpatterns)
336 CAT="development|XmlPatterns module"
337 DEPENDS="qt5-base";;
338 esac
339 }