blob: e56d73b29955472970db265b7290be5cd768d3e9 (
plain)
1 # Description: Qt Free Edition, version 5.x.
2 # URL: http://www.qt.io/
3 # Maintainer: Danny Rawlins, crux at romster dot me
4 # Depends on: dbus gdk-pixbuf gst-plugins-base libepoxy libmng libxkbcommon xorg-libxcomposite xorg-libxcursor xorg-libxi xorg-libxinerama xorg-xcb-util-image xorg-xcb-util-keysyms xorg-xcb-util-wm xorg-xcb-util-renderutil
5 # Optional: icu
6
7 name=qt5
8 version=5.15.4
9 release=1
10 source=(https://download.qt.io/archive/qt/5.15/5.15.4/single/qt-everywhere-opensource-src-5.15.4.tar.xz
11 https://www.linuxfromscratch.org/patches/blfs/svn/qt-everywhere-opensource-src-5.15.4-kf5-1.patch
12 qt5-cflags.patch
13 qt5-logo.png
14 qtbase-everywhere-src-5.11.1-python3.patch
15 qtbase-everywhere-src-5.14.2-no_relocatable.patch
16 qtbase-everywhere-src-5.15.2-libglvnd.patch
17 qtbase-use-wayland-on-gnome.patch)
18
19 build() {
20 cd qt-everywhere-src-$version
21
22 patch -p1 -i $SRC/qt-everywhere-opensource-src-5.15.4-kf5-1.patch
23 patch -d qtbase -p1 -i $SRC/qt5-cflags.patch
24 patch -d qtbase -p1 -i $SRC/qtbase-everywhere-src-5.11.1-python3.patch
25 patch -d qtbase -p1 -i $SRC/qtbase-everywhere-src-5.14.2-no_relocatable.patch
26 patch -d qtbase -p1 -i $SRC/qtbase-everywhere-src-5.15.2-libglvnd.patch
27 patch -d qtbase -p1 -i $SRC/qtbase-use-wayland-on-gnome.patch
28
29 export PYTHON='/usr/bin/python3'
30 mkdir $SRC/bin
31 ln -s /usr/bin/python3 $SRC/bin/python
32 export PATH="$SRC/bin:$PATH"
33
34 export QTDIR="$PWD"
35 export LD_LIBRARY_PATH="$QTDIR/qtbase/lib:$QTDIR/qttools/lib:$LD_LIBRARY_PATH"
36 export QT_PLUGIN_PATH="$QTDIR/qtbase/plugins"
37
38 prt-get isinst ccache && PKGMK_QT5+=' -ccache' && \
39 PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"
40 prt-get isinst assimp && PKGMK_QT5+=' -system-assimp'
41 prt-get isinst clang && PKGMK_QT5+=' -platform linux-clang'
42 prt-get isinst clang lld && PKGMK_QT5+=' -linker lld' || PKGMK_QT5+=' -linker gold'
43
44 sed -i '/utility/a #include <limits>' qtbase/src/corelib/global/qglobal.h
45 sed -i '/string/a #include <limits>' qtbase/src/corelib/global/qfloat16.h
46 sed -i '/qbytearray/a #include <limits>' qtbase/src/corelib/text/qbytearraymatcher.h
47 sed -i '/type_traits/a #include <limits>' qtdeclarative/src/qmldebug/qqmlprofilerevent_p.h
48
49 ./configure $PKGMK_QT5 \
50 -prefix /usr/ \
51 -archdatadir /usr/lib/qt5 \
52 -bindir /usr/lib/qt5/bin \
53 -plugindir /usr/lib/qt5/plugins \
54 -importdir /usr/lib/qt5/imports \
55 -datadir /usr/share/qt5 \
56 -docdir /usr/share/doc/qt5 \
57 -translationdir /usr/share/qt5/translations \
58 -examplesdir /usr/share/doc/qt5/examples \
59 -headerdir /usr/include/qt5 \
60 -libdir /usr/lib \
61 -sysconfdir /etc/xdg \
62 -confirm-license \
63 -opensource \
64 -release \
65 -system-sqlite \
66 -system-harfbuzz \
67 -openssl-linked \
68 -dbus-linked \
69 -nomake examples \
70 -no-mimetype-database \
71 -no-use-gold-linker \
72 -no-rpath \
73 -no-strip \
74 -no-reduce-relocations \
75 -opengl desktop \
76 -skip qtwebengine \
77 -silent
78
79 make
80 make -j1 INSTALL_ROOT=$PKG install
81
82 # Fix paths
83 find "$PKG/usr/lib" -type f -name '*.prl' \
84 -exec sed -e '/^QMAKE_PRL_BUILD_DIR/d' -i {} \;
85
86 sed -e "s|$PWD/qtbase|/usr/lib/qt5|g" \
87 -i $PKG/usr/lib/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri
88
89 rm -r $PKG/usr/share/doc
90
91 # Install useful symlinks
92 install -d $PKG/usr/bin
93 for file in $PKG/usr/lib/qt5/bin/*; do
94 ln -s ../lib/qt5/bin/$(basename $file) $PKG/usr/bin/$(basename $file)-qt5
95 ln -s ../lib/qt5/bin/$(basename $file) $PKG/usr/bin/$(basename $file)
96 done
97
98 # Add menu entries for all those hidden but great Qt applications:
99 # # Qt5 logo:
100 install -d $PKG/usr/share/icons/hicolor/48x48/apps
101 # requires imagemagick
102 #convert qtdoc/doc/src/images/qt-logo.png -resize 48x48 $PKG/usr/share/icons/hicolor/48x48/apps/qt5-logo.png
103 install -m 0644 $SRC/qt5-logo.png $PKG/usr/share/icons/hicolor/48x48/apps/qt5-logo.png
104
105 # Assistant icons
106 install -m 0644 -D qttools/src/assistant/assistant/images/assistant.png \
107 $PKG/usr/share/icons/hicolor/32x32/apps/qt5-assistant.png
108 install -m 0644 -D qttools/src/assistant/assistant/images/assistant-128.png \
109 $PKG/usr/share/icons/hicolor/128x128/apps/qt5-assistant.png
110
111 # Designer icon
112 install -m 0644 -D qttools/src/designer/src/designer/images/designer.png \
113 $PKG/usr/share/icons/hicolor/128x128/apps/qt5-designer.png
114
115 # QDbusViewer icons
116 install -m 0644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer.png \
117 $PKG/usr/share/icons/hicolor/32x32/apps/qt5-qdbusviewer.png
118 install -m 0644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer-128.png \
119 $PKG/usr/share/icons/hicolor/128x128/apps/qt5-qdbusviewer.png
120
121 # Linguist icons
122 for icon in qttools/src/linguist/linguist/images/icons/linguist-*-32.png ; do
123 size=$(echo $(basename ${icon}) | cut -d- -f2)
124 install -m 0644 -D ${icon} $PKG/usr/share/icons/hicolor/${size}x${size}/apps/qt5-linguist.png
125 done
126
127 # And the .desktop files too:
128 install -d $PKG/usr/share/applications
129 cat <<EOF > $PKG/usr/share/applications/qt5-designer.desktop
130 [Desktop Entry]
131 Name=Qt5 Designer
132 GenericName=Interface Designer
133 Comment=Design GUIs for Qt5 applications
134 Exec=designer-qt5 -qt=5
135 Icon=qt5-designer
136 MimeType=application/x-designer;
137 Terminal=false
138 Encoding=UTF-8
139 Type=Application
140 Categories=Qt;Development;
141 EOF
142 cat <<EOF > $PKG/usr/share/applications/qt5-assistant.desktop
143 [Desktop Entry]
144 Name=Qt5 Assistant
145 Comment=Shows Qt5 documentation and examples
146 Exec=assistant-qt5 -qt=5
147 Icon=qt5-assistant
148 Terminal=false
149 Encoding=UTF-8
150 Type=Application
151 Categories=Qt;Development;Documentation;
152 EOF
153 cat <<EOF > $PKG/usr/share/applications/qt5-linguist.desktop
154 [Desktop Entry]
155 Name=Qt5 Linguist
156 Comment=Add translations to Qt5 applications
157 Exec=linguist-qt5 -qt=5
158 Icon=qt5-linguist
159 MimeType=text/vnd.trolltech.linguist;application/x-linguist;
160 Terminal=false
161 Encoding=UTF-8
162 Type=Application
163 Categories=Qt;Development;
164 EOF
165 cat <<EOF > $PKG/usr/share/applications/qt5-qdbusviewer.desktop
166 [Desktop Entry]
167 Name=Qt5 QDbusViewer
168 GenericName=Qt5 D-Bus Debugger
169 Comment=Debug D-Bus applications
170 Exec=qdbusviewer-qt5
171 Icon=qt5-qdbusviewer
172 Terminal=false
173 Type=Application
174 Categories=Qt;Development;Debugger;
175 EOF
176 }
|