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