summaryrefslogtreecommitdiff
path: root/qt5/Pkgfile
blob: 7675f72d50b5d1d94fc11fcbfa8abe17dc61d71d (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.2
    9 release=2
   10 source=(https://download.qt.io/official_releases/qt/${version::4}/$version/single/qt-everywhere-src-$version.tar.xz
   11 	qt5-cflags.patch
   12 	qt5-logo.png
   13 	qtbase-everywhere-src-5.11.1-python3.patch
   14 	qtbase-everywhere-src-5.14.2-no_relocatable.patch
   15 	qtbase-everywhere-src-5.15.2-libglvnd.patch
   16 	qtbase-filechooser-portal-send-window-id-in-hex.patch
   17 	qtbase-use-wayland-on-gnome.patch
   18 	qt-everywhere-src-5.15.2-CVE-2021-3481-1.patch)
   19 
   20 build() {
   21 	cd qt-everywhere-src-$version
   22 
   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-filechooser-portal-send-window-id-in-hex.patch
   28 	patch -d qtbase -p1 -i $SRC/qtbase-use-wayland-on-gnome.patch
   29 	patch -p1 -i $SRC/qt-everywhere-src-5.15.2-CVE-2021-3481-1.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 
   43 	sed -i '/utility/a #include <limits>'     qtbase/src/corelib/global/qglobal.h
   44 	sed -i '/string/a #include <limits>'      qtbase/src/corelib/global/qfloat16.h
   45 	sed -i '/qbytearray/a #include <limits>'  qtbase/src/corelib/text/qbytearraymatcher.h
   46 	sed -i '/type_traits/a #include <limits>' qtdeclarative/src/qmldebug/qqmlprofilerevent_p.h
   47 
   48 	./configure $PKGMK_QT5 \
   49 		-prefix /usr/ \
   50 		-archdatadir /usr/lib/qt5 \
   51 		-bindir /usr/lib/qt5/bin \
   52 		-plugindir /usr/lib/qt5/plugins \
   53 		-importdir /usr/lib/qt5/imports \
   54 		-datadir /usr/share/qt5 \
   55 		-docdir /usr/share/doc/qt5 \
   56 		-translationdir /usr/share/qt5/translations \
   57 		-examplesdir /usr/share/doc/qt5/examples \
   58 		-headerdir /usr/include/qt5 \
   59 		-libdir /usr/lib \
   60 		-sysconfdir /usr/etc/xdg \
   61 		-confirm-license \
   62 		-dbus-linked \
   63 		-nomake examples \
   64 		-no-pch \
   65 		-no-rpath \
   66 		-no-separate-debug-info \
   67 		-no-strip \
   68 		-opengl desktop \
   69 		-opensource \
   70 		-openssl-linked \
   71 		-reduce-relocations \
   72 		-release \
   73 		-shared \
   74 		-plugin-sql-sqlite \
   75 		-system-sqlite \
   76 		-system-harfbuzz \
   77 		-skip qtwebengine \
   78 		-silent
   79 
   80 	make
   81 	make -j1 INSTALL_ROOT=$PKG install
   82 
   83 	# Fix paths
   84 	find "$PKG/usr/lib" -type f -name '*.prl' \
   85 		-exec sed -e '/^QMAKE_PRL_BUILD_DIR/d' -i {} \;
   86 
   87 	sed -e "s|$PWD/qtbase|/usr/lib/qt5|g" \
   88 		-i $PKG/usr/lib/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri
   89 
   90 	rm -r $PKG/usr/share/doc
   91 
   92 	# Install useful symlinks
   93 	install -d $PKG/usr/bin
   94 	for file in $PKG/usr/lib/qt5/bin/*; do
   95 		ln -s ../lib/qt5/bin/$(basename $file) $PKG/usr/bin/$(basename $file)-qt5
   96 		ln -s ../lib/qt5/bin/$(basename $file) $PKG/usr/bin/$(basename $file)
   97 	done
   98 
   99 	# Add menu entries for all those hidden but great Qt applications:
  100 	# # Qt5 logo:
  101 	install -d $PKG/usr/share/icons/hicolor/48x48/apps
  102 	# requires imagemagick
  103 	#convert qtdoc/doc/src/images/qt-logo.png  -resize 48x48 $PKG/usr/share/icons/hicolor/48x48/apps/qt5-logo.png
  104 	install -m 0644 $SRC/qt5-logo.png $PKG/usr/share/icons/hicolor/48x48/apps/qt5-logo.png
  105 
  106 	# Assistant icons
  107 	install -m 0644 -D qttools/src/assistant/assistant/images/assistant.png \
  108 		$PKG/usr/share/icons/hicolor/32x32/apps/qt5-assistant.png
  109 	install -m 0644 -D qttools/src/assistant/assistant/images/assistant-128.png \
  110 		$PKG/usr/share/icons/hicolor/128x128/apps/qt5-assistant.png
  111 
  112 	# Designer icon
  113 	install -m 0644 -D qttools/src/designer/src/designer/images/designer.png \
  114 		$PKG/usr/share/icons/hicolor/128x128/apps/qt5-designer.png
  115 
  116 	# QDbusViewer icons
  117 	install -m 0644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer.png \
  118 		$PKG/usr/share/icons/hicolor/32x32/apps/qt5-qdbusviewer.png
  119 	install -m 0644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer-128.png \
  120 		$PKG/usr/share/icons/hicolor/128x128/apps/qt5-qdbusviewer.png
  121 
  122 	# Linguist icons
  123 	for icon in qttools/src/linguist/linguist/images/icons/linguist-*-32.png ; do
  124 		size=$(echo $(basename ${icon}) | cut -d- -f2)
  125 		install -m 0644 -D ${icon} $PKG/usr/share/icons/hicolor/${size}x${size}/apps/qt5-linguist.png
  126 	done
  127 
  128 	# And the .desktop files too:
  129 	install -d $PKG/usr/share/applications
  130 	cat <<EOF > $PKG/usr/share/applications/qt5-designer.desktop
  131 [Desktop Entry]
  132 Name=Qt5 Designer
  133 GenericName=Interface Designer
  134 Comment=Design GUIs for Qt5 applications
  135 Exec=designer-qt5 -qt=5
  136 Icon=qt5-designer
  137 MimeType=application/x-designer;
  138 Terminal=false
  139 Encoding=UTF-8
  140 Type=Application
  141 Categories=Qt;Development;
  142 EOF
  143 	cat <<EOF > $PKG/usr/share/applications/qt5-assistant.desktop
  144 [Desktop Entry]
  145 Name=Qt5 Assistant
  146 Comment=Shows Qt5 documentation and examples
  147 Exec=assistant-qt5 -qt=5
  148 Icon=qt5-assistant
  149 Terminal=false
  150 Encoding=UTF-8
  151 Type=Application
  152 Categories=Qt;Development;Documentation;
  153 EOF
  154 	cat <<EOF > $PKG/usr/share/applications/qt5-linguist.desktop
  155 [Desktop Entry]
  156 Name=Qt5 Linguist
  157 Comment=Add translations to Qt5 applications
  158 Exec=linguist-qt5 -qt=5
  159 Icon=qt5-linguist
  160 MimeType=text/vnd.trolltech.linguist;application/x-linguist;
  161 Terminal=false
  162 Encoding=UTF-8
  163 Type=Application
  164 Categories=Qt;Development;
  165 EOF
  166 	cat <<EOF > $PKG/usr/share/applications/qt5-qdbusviewer.desktop
  167 [Desktop Entry]
  168 Name=Qt5 QDbusViewer
  169 GenericName=Qt5 D-Bus Debugger
  170 Comment=Debug D-Bus applications
  171 Exec=qdbusviewer-qt5
  172 Icon=qt5-qdbusviewer
  173 Terminal=false
  174 Type=Application
  175 Categories=Qt;Development;Debugger;
  176 EOF
  177 }

Generated by cgit