2018-11-29 13:00:47 +01:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://qt-project.org/
|
2018-09-13 01:45:54 +02:00
|
|
|
TERMUX_PKG_DESCRIPTION="A cross-platform application and UI framework"
|
2019-01-21 17:50:21 +01:00
|
|
|
TERMUX_PKG_LICENSE="LGPL-3.0"
|
2019-05-17 00:18:48 +02:00
|
|
|
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
|
2019-07-19 16:46:06 +02:00
|
|
|
TERMUX_PKG_VERSION=5.11.3
|
2019-10-10 17:12:45 +02:00
|
|
|
TERMUX_PKG_REVISION=4
|
2019-07-19 16:46:06 +02:00
|
|
|
TERMUX_PKG_SRCURL="http://master.qt.io/archive/qt/${TERMUX_PKG_VERSION%.*}/${TERMUX_PKG_VERSION}/single/qt-everywhere-src-${TERMUX_PKG_VERSION}.tar.xz"
|
2019-07-19 16:44:57 +02:00
|
|
|
TERMUX_PKG_SHA256=859417642713cee2493ee3646a7fee782c9f1db39e41d7bb1322bba0c5f0ff4d
|
2019-04-20 19:10:50 +02:00
|
|
|
TERMUX_PKG_DEPENDS="harfbuzz, libandroid-shmem, libc++, libice, libicu, libjpeg-turbo, libpng, libsm, libuuid, libx11, libxcb, libxi, libxkbcommon, openssl, pcre2, ttf-dejavu, xcb-util-image, xcb-util-keysyms, xcb-util-renderutil, xcb-util-wm, zlib"
|
2018-09-13 01:45:54 +02:00
|
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
2018-09-20 22:59:26 +02:00
|
|
|
|
|
|
|
TERMUX_PKG_RM_AFTER_INSTALL="
|
|
|
|
bin/fixqt4headers.pl
|
|
|
|
bin/syncqt.pl
|
2018-09-21 17:15:40 +02:00
|
|
|
lib/qt/mkspecs/termux-cross
|
2018-09-20 22:59:26 +02:00
|
|
|
"
|
|
|
|
|
2018-09-13 01:45:54 +02:00
|
|
|
termux_step_pre_configure () {
|
2018-09-20 22:59:26 +02:00
|
|
|
if [ "${TERMUX_ARCH}" = "arm" ]; then
|
|
|
|
## -mfpu=neon causes build failure on ARM.
|
|
|
|
CFLAGS="${CFLAGS/-mfpu=neon/} -mfpu=vfp"
|
|
|
|
CXXFLAGS="${CXXFLAGS/-mfpu=neon/} -mfpu=vfp"
|
|
|
|
fi
|
2018-09-20 21:32:37 +02:00
|
|
|
|
2018-09-21 17:15:40 +02:00
|
|
|
## Create qmake.conf suitable for cross-compiling.
|
2018-09-20 02:28:06 +02:00
|
|
|
sed \
|
|
|
|
-e "s|@TERMUX_CC@|${TERMUX_HOST_PLATFORM}-clang|" \
|
|
|
|
-e "s|@TERMUX_CXX@|${TERMUX_HOST_PLATFORM}-clang++|" \
|
|
|
|
-e "s|@TERMUX_AR@|${TERMUX_HOST_PLATFORM}-ar|" \
|
|
|
|
-e "s|@TERMUX_NM@|${TERMUX_HOST_PLATFORM}-nm|" \
|
|
|
|
-e "s|@TERMUX_OBJCOPY@|${TERMUX_HOST_PLATFORM}-objcopy|" \
|
|
|
|
-e "s|@TERMUX_PKGCONFIG@|${TERMUX_HOST_PLATFORM}-pkg-config|" \
|
|
|
|
-e "s|@TERMUX_STRIP@|${TERMUX_HOST_PLATFORM}-strip|" \
|
|
|
|
-e "s|@TERMUX_CFLAGS@|${CPPFLAGS} ${CFLAGS}|" \
|
|
|
|
-e "s|@TERMUX_CXXFLAGS@|${CPPFLAGS} ${CXXFLAGS}|" \
|
|
|
|
-e "s|@TERMUX_LDFLAGS@|${LDFLAGS}|" \
|
2018-09-21 17:15:40 +02:00
|
|
|
"${TERMUX_PKG_BUILDER_DIR}/qmake.conf" > "${TERMUX_PKG_SRCDIR}/qtbase/mkspecs/termux-cross/qmake.conf"
|
2018-09-13 01:45:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_configure () {
|
|
|
|
export PKG_CONFIG_SYSROOT_DIR="${TERMUX_PREFIX}"
|
2018-09-20 02:28:06 +02:00
|
|
|
unset CC CXX LD CFLAGS LDFLAGS
|
2018-09-13 01:45:54 +02:00
|
|
|
|
2018-09-14 02:17:01 +02:00
|
|
|
"${TERMUX_PKG_SRCDIR}"/configure -v \
|
2018-09-20 02:28:06 +02:00
|
|
|
-opensource \
|
|
|
|
-confirm-license \
|
|
|
|
-release \
|
2018-09-21 17:15:40 +02:00
|
|
|
-xplatform termux-cross \
|
2018-09-20 02:28:06 +02:00
|
|
|
-optimized-qmake \
|
|
|
|
-no-rpath \
|
|
|
|
-no-use-gold-linker \
|
2018-09-13 01:45:54 +02:00
|
|
|
-prefix "${TERMUX_PREFIX}" \
|
2018-09-14 02:17:01 +02:00
|
|
|
-docdir "${TERMUX_PREFIX}/share/doc/qt" \
|
|
|
|
-headerdir "${TERMUX_PREFIX}/include/qt" \
|
|
|
|
-archdatadir "${TERMUX_PREFIX}/lib/qt" \
|
|
|
|
-datadir "${TERMUX_PREFIX}/share/qt" \
|
|
|
|
-sysconfdir "${TERMUX_PREFIX}/etc/xdg" \
|
|
|
|
-examplesdir "${TERMUX_PREFIX}/share/doc/qt/examples" \
|
|
|
|
-plugindir "$TERMUX_PREFIX/libexec/qt" \
|
|
|
|
-nomake examples \
|
2018-09-20 02:28:06 +02:00
|
|
|
-skip qt3d \
|
|
|
|
-skip qtactiveqt \
|
|
|
|
-skip qtandroidextras \
|
|
|
|
-skip qtcanvas3d \
|
|
|
|
-skip qtcharts \
|
|
|
|
-skip qtconnectivity \
|
|
|
|
-skip qtdatavis3d \
|
|
|
|
-skip qtdoc \
|
|
|
|
-skip qtgamepad \
|
|
|
|
-skip qtgraphicaleffects \
|
|
|
|
-skip qtimageformats \
|
|
|
|
-skip qtlocation \
|
|
|
|
-skip qtmacextras \
|
|
|
|
-skip qtmultimedia \
|
|
|
|
-skip qtnetworkauth \
|
|
|
|
-skip qtpurchasing \
|
|
|
|
-skip qtquickcontrols \
|
|
|
|
-skip qtquickcontrols2 \
|
|
|
|
-skip qtremoteobjects \
|
|
|
|
-skip qtscript \
|
|
|
|
-skip qtscxml \
|
|
|
|
-skip qtsensors \
|
|
|
|
-skip qtserialbus \
|
|
|
|
-skip qtserialport \
|
|
|
|
-skip qtspeech \
|
|
|
|
-skip qtsvg \
|
|
|
|
-skip qttranslations \
|
|
|
|
-skip qtvirtualkeyboard \
|
|
|
|
-skip qtwayland \
|
|
|
|
-skip qtwebchannel \
|
|
|
|
-skip qtwebengine \
|
|
|
|
-skip qtwebglplugin \
|
|
|
|
-skip qtwebsockets \
|
|
|
|
-skip qtwebview \
|
|
|
|
-skip qtwinextras \
|
|
|
|
-skip qtxmlpatterns \
|
2018-09-13 01:45:54 +02:00
|
|
|
-no-dbus \
|
|
|
|
-no-accessibility \
|
|
|
|
-no-glib \
|
|
|
|
-no-eventfd \
|
|
|
|
-no-inotify \
|
2018-09-16 14:03:12 +02:00
|
|
|
-icu \
|
|
|
|
-system-pcre \
|
|
|
|
-system-zlib \
|
2018-09-15 23:12:27 +02:00
|
|
|
-ssl \
|
|
|
|
-openssl-linked \
|
2018-09-13 01:45:54 +02:00
|
|
|
-no-system-proxies \
|
|
|
|
-no-cups \
|
2018-09-16 14:03:12 +02:00
|
|
|
-system-harfbuzz \
|
2018-09-13 01:45:54 +02:00
|
|
|
-no-opengl \
|
2018-09-13 23:05:58 +02:00
|
|
|
-no-vulkan \
|
2018-09-13 01:45:54 +02:00
|
|
|
-qpa xcb \
|
|
|
|
-no-eglfs \
|
|
|
|
-no-gbm \
|
|
|
|
-no-kms \
|
|
|
|
-no-linuxfb \
|
|
|
|
-no-mirclient \
|
2018-09-16 14:03:12 +02:00
|
|
|
-system-xcb \
|
2018-09-13 01:45:54 +02:00
|
|
|
-no-libudev \
|
|
|
|
-no-evdev \
|
|
|
|
-no-libinput \
|
|
|
|
-no-mtdev \
|
|
|
|
-no-tslib \
|
2018-09-16 14:03:12 +02:00
|
|
|
-system-xkbcommon-x11 \
|
|
|
|
-no-xkbcommon-evdev \
|
2018-09-13 01:45:54 +02:00
|
|
|
-gif \
|
|
|
|
-ico \
|
|
|
|
-system-libpng \
|
|
|
|
-system-libjpeg \
|
|
|
|
-sql-sqlite \
|
2018-09-13 17:03:03 +02:00
|
|
|
-no-feature-dnslookup
|
2018-09-13 01:45:54 +02:00
|
|
|
}
|
|
|
|
|
2018-09-13 23:05:58 +02:00
|
|
|
termux_step_make() {
|
2018-09-20 02:28:06 +02:00
|
|
|
make -j "${TERMUX_MAKE_PROCESSES}"
|
2018-09-13 23:05:58 +02:00
|
|
|
}
|
2018-09-13 01:45:54 +02:00
|
|
|
|
2018-09-13 23:05:58 +02:00
|
|
|
termux_step_make_install() {
|
2018-09-20 02:28:06 +02:00
|
|
|
make install
|
2018-09-15 21:10:26 +02:00
|
|
|
|
2018-11-28 14:52:25 +01:00
|
|
|
#######################################################
|
|
|
|
##
|
|
|
|
## Save host-compiled Qt dev tools for
|
|
|
|
## later use (e.g. cross-compiling Qt application).
|
|
|
|
##
|
|
|
|
#######################################################
|
|
|
|
|
2018-09-21 17:15:40 +02:00
|
|
|
cd "${TERMUX_PKG_SRCDIR}/qtbase" && {
|
|
|
|
cp -a bin bin.host
|
|
|
|
}
|
|
|
|
|
2018-11-28 14:52:25 +01:00
|
|
|
cd "${TERMUX_PKG_SRCDIR}/qttools" && {
|
|
|
|
mkdir -p bin.host
|
|
|
|
cp -a bin/{lconvert,lrelease,lupdate,qtattributionsscanner} bin.host/
|
|
|
|
}
|
|
|
|
|
|
|
|
#######################################################
|
|
|
|
##
|
|
|
|
## Compiling necessary libraries for target.
|
|
|
|
##
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
## libQt5Bootstrap.a (qt5-base)
|
2018-09-15 21:10:26 +02:00
|
|
|
cd "${TERMUX_PKG_SRCDIR}/qtbase/src/tools/bootstrap" && {
|
|
|
|
make clean
|
|
|
|
|
|
|
|
"${TERMUX_PKG_SRCDIR}/qtbase/bin/qmake" \
|
2018-09-21 17:15:40 +02:00
|
|
|
-spec "${TERMUX_PKG_SRCDIR}/qtbase/mkspecs/termux-cross"
|
2018-09-15 21:10:26 +02:00
|
|
|
|
|
|
|
make -j "${TERMUX_MAKE_PROCESSES}"
|
2018-11-13 21:09:21 +01:00
|
|
|
install -Dm644 ../../../lib/libQt5Bootstrap.a "${TERMUX_PREFIX}/lib/libQt5Bootstrap.a"
|
|
|
|
install -Dm644 ../../../lib/libQt5Bootstrap.prl "${TERMUX_PREFIX}/lib/libQt5Bootstrap.prl"
|
2018-09-15 21:10:26 +02:00
|
|
|
}
|
|
|
|
|
2018-11-28 14:52:25 +01:00
|
|
|
## libQt5QmlDevTools.a (qt5-declarative)
|
2018-11-13 21:09:21 +01:00
|
|
|
cd "${TERMUX_PKG_SRCDIR}/qtdeclarative/src/qmldevtools" && {
|
|
|
|
make clean
|
|
|
|
|
|
|
|
"${TERMUX_PKG_SRCDIR}/qtbase/bin/qmake" \
|
|
|
|
-spec "${TERMUX_PKG_SRCDIR}/qtbase/mkspecs/termux-cross"
|
|
|
|
|
|
|
|
make -j "${TERMUX_MAKE_PROCESSES}"
|
|
|
|
install -Dm644 ../../lib/libQt5QmlDevTools.a "${TERMUX_PREFIX}/lib/libQt5QmlDevTools.a"
|
|
|
|
install -Dm644 ../../lib/libQt5QmlDevTools.prl "${TERMUX_PREFIX}/lib/libQt5QmlDevTools.prl"
|
|
|
|
}
|
|
|
|
|
2018-11-28 14:52:25 +01:00
|
|
|
## libQt5PacketProtocol.a (qt5-declarative)
|
2018-11-13 21:09:21 +01:00
|
|
|
cd "${TERMUX_PKG_SRCDIR}/qtdeclarative/src/plugins/qmltooling/packetprotocol" && {
|
|
|
|
make clean
|
|
|
|
|
|
|
|
"${TERMUX_PKG_SRCDIR}/qtbase/bin/qmake" \
|
|
|
|
-spec "${TERMUX_PKG_SRCDIR}/qtbase/mkspecs/termux-cross"
|
|
|
|
|
|
|
|
make -j "${TERMUX_MAKE_PROCESSES}"
|
|
|
|
install -Dm644 ../../../../lib/libQt5PacketProtocol.a "${TERMUX_PREFIX}/lib/libQt5PacketProtocol.a"
|
|
|
|
install -Dm644 ../../../../lib/libQt5PacketProtocol.prl "${TERMUX_PREFIX}/lib/libQt5PacketProtocol.prl"
|
|
|
|
}
|
|
|
|
|
2018-11-28 14:52:25 +01:00
|
|
|
#######################################################
|
|
|
|
##
|
|
|
|
## Compiling necessary programs for target.
|
|
|
|
##
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
## Qt Declarative utilities.
|
2018-11-13 21:09:21 +01:00
|
|
|
for i in qmlcachegen qmlimportscanner qmllint qmlmin; do
|
|
|
|
cd "${TERMUX_PKG_SRCDIR}/qtdeclarative/tools/${i}" && {
|
|
|
|
make clean
|
|
|
|
|
|
|
|
"${TERMUX_PKG_SRCDIR}/qtbase/bin/qmake" \
|
|
|
|
-spec "${TERMUX_PKG_SRCDIR}/qtbase/mkspecs/termux-cross"
|
|
|
|
|
|
|
|
make -j "${TERMUX_MAKE_PROCESSES}"
|
|
|
|
install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}"
|
|
|
|
}
|
|
|
|
done
|
|
|
|
|
2018-11-28 14:52:25 +01:00
|
|
|
## Qt Linguist utilities (qt5-tools).
|
|
|
|
## Note: linguist application is not built !
|
|
|
|
for i in lconvert lrelease lupdate; do
|
|
|
|
cd "${TERMUX_PKG_SRCDIR}/qttools/src/linguist/${i}" && {
|
|
|
|
make clean
|
|
|
|
|
|
|
|
"${TERMUX_PKG_SRCDIR}/qtbase/bin/qmake" \
|
|
|
|
-spec "${TERMUX_PKG_SRCDIR}/qtbase/mkspecs/termux-cross"
|
|
|
|
|
|
|
|
make -j "${TERMUX_MAKE_PROCESSES}"
|
|
|
|
install -Dm700 "../../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}"
|
|
|
|
}
|
|
|
|
done
|
|
|
|
|
|
|
|
## qtattributionsscanner (part of qt5-tools).
|
|
|
|
cd "${TERMUX_PKG_SRCDIR}/qttools/src/qtattributionsscanner" && {
|
|
|
|
make clean
|
|
|
|
|
|
|
|
"${TERMUX_PKG_SRCDIR}/qtbase/bin/qmake" \
|
|
|
|
-spec "${TERMUX_PKG_SRCDIR}/qtbase/mkspecs/termux-cross"
|
|
|
|
|
|
|
|
make -j "${TERMUX_MAKE_PROCESSES}"
|
|
|
|
install -Dm700 "../../bin/qtattributionsscanner" "${TERMUX_PREFIX}/bin/qtattributionsscanner"
|
|
|
|
}
|
|
|
|
|
|
|
|
## Qt5 Base utilities.
|
|
|
|
## Note: qmake can be built only on host so it is omitted here.
|
2018-09-15 21:10:26 +02:00
|
|
|
for i in moc qlalr qvkgen rcc uic; do
|
|
|
|
cd "${TERMUX_PKG_SRCDIR}/qtbase/src/tools/${i}" && {
|
|
|
|
make clean
|
|
|
|
|
|
|
|
"${TERMUX_PKG_SRCDIR}/qtbase/bin/qmake" \
|
2018-09-21 17:15:40 +02:00
|
|
|
-spec "${TERMUX_PKG_SRCDIR}/qtbase/mkspecs/termux-cross"
|
2018-09-15 21:10:26 +02:00
|
|
|
|
2018-09-20 21:32:37 +02:00
|
|
|
## Ensure that no '-lpthread' specified in makefile.
|
2018-09-15 21:10:26 +02:00
|
|
|
sed \
|
|
|
|
-i 's@-lpthread@@g' \
|
|
|
|
"${TERMUX_PKG_SRCDIR}/qtbase/src/tools/${i}/Makefile"
|
|
|
|
|
2018-09-20 21:32:37 +02:00
|
|
|
## Fix build failure on at least 'i686'.
|
|
|
|
sed \
|
2019-04-23 23:52:23 +02:00
|
|
|
-i 's@$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)@$(LINK) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) $(LFLAGS) -lz@g' \
|
2018-09-20 21:32:37 +02:00
|
|
|
Makefile
|
|
|
|
|
2018-09-15 21:10:26 +02:00
|
|
|
make -j "${TERMUX_MAKE_PROCESSES}"
|
2018-11-13 21:09:21 +01:00
|
|
|
install -Dm700 "../../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}"
|
2018-09-15 21:10:26 +02:00
|
|
|
}
|
|
|
|
done
|
|
|
|
unset i
|
|
|
|
|
2018-11-28 14:52:25 +01:00
|
|
|
## Unpacking prebuilt qmake from archive.
|
2018-09-20 21:32:37 +02:00
|
|
|
cd "${TERMUX_PKG_SRCDIR}" && {
|
|
|
|
tar xf "${TERMUX_PKG_BUILDER_DIR}/termux-prebuilt-qmake.txz"
|
|
|
|
install \
|
|
|
|
-Dm700 "./termux-prebuilt-qmake/bin/termux-${TERMUX_HOST_PLATFORM}-qmake" \
|
|
|
|
"${TERMUX_PREFIX}/bin/qmake"
|
|
|
|
}
|
2018-09-20 22:59:26 +02:00
|
|
|
|
2018-11-28 14:52:25 +01:00
|
|
|
#######################################################
|
|
|
|
##
|
|
|
|
## Fixes & cleanup.
|
|
|
|
##
|
|
|
|
#######################################################
|
|
|
|
|
2018-11-13 21:09:21 +01:00
|
|
|
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
|
2018-09-20 22:59:26 +02:00
|
|
|
find "${TERMUX_PREFIX}/lib" -type f -name '*.prl' \
|
|
|
|
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
|
2018-11-13 21:09:21 +01:00
|
|
|
|
|
|
|
## Remove *.la files.
|
|
|
|
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
|
2018-11-27 14:03:18 +01:00
|
|
|
|
|
|
|
## Set qt spec path suitable for target.
|
|
|
|
sed -i \
|
|
|
|
's|/lib/qt//mkspecs/termux-cross"|/lib/qt/mkspecs/termux"|g' \
|
|
|
|
"${TERMUX_PREFIX}/lib/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake"
|
2018-09-13 01:45:54 +02:00
|
|
|
}
|
2018-09-21 00:09:35 +02:00
|
|
|
|
|
|
|
termux_step_create_debscripts() {
|
|
|
|
## FIXME: Qt should be built with fontconfig somehow instead
|
|
|
|
## of using direct path to fonts.
|
2018-09-21 17:15:40 +02:00
|
|
|
## Currently, using post-installation script to create symlink
|
|
|
|
## from /system/bin/fonts to $PREFIX/lib/fonts if possible.
|
2018-09-21 00:09:35 +02:00
|
|
|
cp -f "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
|
|
|
|
}
|
2018-09-21 17:15:40 +02:00
|
|
|
|
2018-09-21 18:24:47 +02:00
|
|
|
termux_step_post_massage() {
|
2018-11-28 14:52:25 +01:00
|
|
|
#######################################################
|
|
|
|
##
|
|
|
|
## Restoring utilities compiled for host.
|
|
|
|
##
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
## qt5-tools
|
|
|
|
for i in lconvert lrelease lupdate qtattributionsscanner; do
|
|
|
|
install \
|
|
|
|
-Dm755 "${TERMUX_PKG_SRCDIR}/qttools/bin.host/${i}" \
|
|
|
|
"${TERMUX_PREFIX}/bin/${i}"
|
|
|
|
done
|
|
|
|
|
|
|
|
## qt5-base
|
2018-09-23 20:27:09 +02:00
|
|
|
for i in moc qlalr qvkgen rcc uic; do
|
2018-09-21 18:24:47 +02:00
|
|
|
install \
|
|
|
|
-Dm755 "${TERMUX_PKG_SRCDIR}/qtbase/bin.host/${i}" \
|
|
|
|
"${TERMUX_PREFIX}/bin/${i}"
|
|
|
|
done
|
|
|
|
unset i
|
2018-09-23 20:27:09 +02:00
|
|
|
|
2018-11-28 14:52:25 +01:00
|
|
|
## qmake
|
2018-09-23 20:27:09 +02:00
|
|
|
install \
|
|
|
|
-Dm755 "${TERMUX_PKG_SRCDIR}/qtbase/qmake/qmake" \
|
|
|
|
"${TERMUX_PREFIX}/bin/qmake"
|
2018-11-27 14:03:18 +01:00
|
|
|
|
|
|
|
## Restore qt spec path used for cross compiling.
|
|
|
|
sed -i \
|
|
|
|
's|/lib/qt/mkspecs/termux"|/lib/qt/mkspecs/termux-cross"|g' \
|
|
|
|
"${TERMUX_PREFIX}/lib/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake"
|
2018-09-21 18:24:47 +02:00
|
|
|
}
|