summaryrefslogtreecommitdiff
path: root/qt5/Pkgfile
blob: a2823a27f1f724717208608e892f205b2dbca594 (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-rpath \
   72 		-no-strip \
   73 		-no-reduce-relocations \
   74 		-opengl desktop \
   75 		-skip qtwebengine \
   76 		-silent
   77 
   78 	make
   79 	make -j1 INSTALL_ROOT=$PKG install
   80 
   81 	# Fix paths
   82 	find "$PKG/usr/lib" -type f -name '*.prl' \
   83 		-exec sed -e '/^QMAKE_PRL_BUILD_DIR/d' -i {} \;
   84 
   85 	sed -e "s|$PWD/qtbase|/usr/lib/qt5|g" \
   86 		-i $PKG/usr/lib/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri
   87 
   88 	rm -r $PKG/usr/share/doc
   89 
   90 	# Install useful symlinks
   91 	install -d $PKG/usr/bin
   92 	for file in $PKG/usr/lib/qt5/bin/*; do
   93 		ln -s ../lib/qt5/bin/$(basename $file) $PKG/usr/bin/$(basename $file)-qt5
   94 		ln -s ../lib/qt5/bin/$(basename $file) $PKG/usr/bin/$(basename $file)
   95 	done
   96 
   97 	# Add menu entries for all those hidden but great Qt applications:
   98 	# # Qt5 logo:
   99 	install -d $PKG/usr/share/icons/hicolor/48x48/apps
  100 	# requires imagemagick
  101 	#convert qtdoc/doc/src/images/qt-logo.png  -resize 48x48 $PKG/usr/share/icons/hicolor/48x48/apps/qt5-logo.png
  102 	install -m 0644 $SRC/qt5-logo.png $PKG/usr/share/icons/hicolor/48x48/apps/qt5-logo.png
  103 
  104 	# Assistant icons
  105 	install -m 0644 -D qttools/src/assistant/assistant/images/assistant.png \
  106 		$PKG/usr/share/icons/hicolor/32x32/apps/qt5-assistant.png
  107 	install -m 0644 -D qttools/src/assistant/assistant/images/assistant-128.png \
  108 		$PKG/usr/share/icons/hicolor/128x128/apps/qt5-assistant.png
  109 
  110 	# Designer icon
  111 	install -m 0644 -D qttools/src/designer/src/designer/images/designer.png \
  112 		$PKG/usr/share/icons/hicolor/128x128/apps/qt5-designer.png
  113 
  114 	# QDbusViewer icons
  115 	install -m 0644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer.png \
  116 		$PKG/usr/share/icons/hicolor/32x32/apps/qt5-qdbusviewer.png
  117 	install -m 0644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer-128.png \
  118 		$PKG/usr/share/icons/hicolor/128x128/apps/qt5-qdbusviewer.png
  119 
  120 	# Linguist icons
  121 	for icon in qttools/src/linguist/linguist/images/icons/linguist-*-32.png ; do
  122 		size=$(echo $(basename ${icon}) | cut -d- -f2)
  123 		install -m 0644 -D ${icon} $PKG/usr/share/icons/hicolor/${size}x${size}/apps/qt5-linguist.png
  124 	done
  125 
  126 	# And the .desktop files too:
  127 	install -d $PKG/usr/share/applications
  128 	cat <<EOF > $PKG/usr/share/applications/qt5-designer.desktop
  129 [Desktop Entry]
  130 Name=Qt5 Designer
  131 GenericName=Interface Designer
  132 Comment=Design GUIs for Qt5 applications
  133 Exec=designer-qt5 -qt=5
  134 Icon=qt5-designer
  135 MimeType=application/x-designer;
  136 Terminal=false
  137 Encoding=UTF-8
  138 Type=Application
  139 Categories=Qt;Development;
  140 EOF
  141 	cat <<EOF > $PKG/usr/share/applications/qt5-assistant.desktop
  142 [Desktop Entry]
  143 Name=Qt5 Assistant
  144 Comment=Shows Qt5 documentation and examples
  145 Exec=assistant-qt5 -qt=5
  146 Icon=qt5-assistant
  147 Terminal=false
  148 Encoding=UTF-8
  149 Type=Application
  150 Categories=Qt;Development;Documentation;
  151 EOF
  152 	cat <<EOF > $PKG/usr/share/applications/qt5-linguist.desktop
  153 [Desktop Entry]
  154 Name=Qt5 Linguist
  155 Comment=Add translations to Qt5 applications
  156 Exec=linguist-qt5 -qt=5
  157 Icon=qt5-linguist
  158 MimeType=text/vnd.trolltech.linguist;application/x-linguist;
  159 Terminal=false
  160 Encoding=UTF-8
  161 Type=Application
  162 Categories=Qt;Development;
  163 EOF
  164 	cat <<EOF > $PKG/usr/share/applications/qt5-qdbusviewer.desktop
  165 [Desktop Entry]
  166 Name=Qt5 QDbusViewer
  167 GenericName=Qt5 D-Bus Debugger
  168 Comment=Debug D-Bus applications
  169 Exec=qdbusviewer-qt5
  170 Icon=qt5-qdbusviewer
  171 Terminal=false
  172 Type=Application
  173 Categories=Qt;Development;Debugger;
  174 EOF
  175 }

Generated by cgit