chore(linter compliance): qt related packages

[no ci]
This commit is contained in:
TomIO 2024-04-23 00:20:34 +02:00 committed by TomIO
parent 2970a00200
commit c78ebc083c
15 changed files with 586 additions and 586 deletions

View File

@ -15,32 +15,32 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
# -r to force Makefile generations for all subdirs at this step so process_stub can be patched # -r to force Makefile generations for all subdirs at this step so process_stub can be patched
# Disable QML Designer plugin which requires OpenGL # Disable QML Designer plugin which requires OpenGL
# Disable clang refactoring plugin which has odd linking issues at the moment # Disable clang refactoring plugin which has odd linking issues at the moment
export QTC_DO_NOT_BUILD_QMLDESIGNER=1 export QTC_DO_NOT_BUILD_QMLDESIGNER=1
export QTC_DISABLE_CLANG_REFACTORING=1 export QTC_DISABLE_CLANG_REFACTORING=1
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" -r \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" -r \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_post_configure() { termux_step_post_configure() {
# process_stub's Makefile has the incorrect LINK executable (it should've been QMAKE_CXX) # process_stub's Makefile has the incorrect LINK executable (it should've been QMAKE_CXX)
sed -i "s|^LINK = clang|LINK = ${CXX}|" \ sed -i "s|^LINK = clang|LINK = ${CXX}|" \
${TERMUX_PKG_SRCDIR}/src/libs/utils/Makefile.process_stub ${TERMUX_PKG_SRCDIR}/src/libs/utils/Makefile.process_stub
# clangbackend's Makefile lacks -lc++_shared to link against libc++ on x86_64 # clangbackend's Makefile lacks -lc++_shared to link against libc++ on x86_64
sed -i -e 's|^LIBS = $(SUBLIBS)|LIBS = $(SUBLIBS) -lc++_shared|' \ sed -i -e 's|^LIBS = $(SUBLIBS)|LIBS = $(SUBLIBS) -lc++_shared|' \
-e 's|-Wl,-rpath,'${TERMUX_COMMON_CACHEDIR//./\\.}'/android-r[0-9][^/]*/lib64||g' \ -e 's|-Wl,-rpath,'${TERMUX_COMMON_CACHEDIR//./\\.}'/android-r[0-9][^/]*/lib64||g' \
-e 's|-L'${TERMUX_COMMON_CACHEDIR//./\\.}'/android-r[0-9][^/]*/lib64||g' \ -e 's|-L'${TERMUX_COMMON_CACHEDIR//./\\.}'/android-r[0-9][^/]*/lib64||g' \
${TERMUX_PKG_SRCDIR}/src/tools/clangbackend/Makefile ${TERMUX_PKG_SRCDIR}/src/tools/clangbackend/Makefile
# make sure clangtools link against libc++_shared on x86_64 # make sure clangtools link against libc++_shared on x86_64
sed -i -e 's|^LIBS = $(SUBLIBS)|LIBS = $(SUBLIBS) -lc++_shared|' \ sed -i -e 's|^LIBS = $(SUBLIBS)|LIBS = $(SUBLIBS) -lc++_shared|' \
-e 's|-Wl,-rpath,'${TERMUX_COMMON_CACHEDIR//./\\.}'/android-r[0-9][^/]*/lib64||g' \ -e 's|-Wl,-rpath,'${TERMUX_COMMON_CACHEDIR//./\\.}'/android-r[0-9][^/]*/lib64||g' \
-e 's|-L'${TERMUX_COMMON_CACHEDIR//./\\.}'/android-r[0-9][^/]*/lib64||g' \ -e 's|-L'${TERMUX_COMMON_CACHEDIR//./\\.}'/android-r[0-9][^/]*/lib64||g' \
${TERMUX_PKG_SRCDIR}/src/plugins/clangtools/Makefile ${TERMUX_PKG_SRCDIR}/src/plugins/clangtools/Makefile
# required by make install, otherwise it installs to '/' # required by make install, otherwise it installs to '/'
export INSTALL_ROOT="${TERMUX_PREFIX}" export INSTALL_ROOT="${TERMUX_PREFIX}"
} }

View File

@ -23,188 +23,188 @@ TERMUX_PKG_REPLACES="qt5-base"
TERMUX_PKG_BREAKS="qt5-x11extras, qt5-tools, qt5-declarative" TERMUX_PKG_BREAKS="qt5-x11extras, qt5-tools, qt5-declarative"
termux_step_pre_configure () { termux_step_pre_configure () {
if [ "${TERMUX_ARCH}" = "arm" ]; then if [ "${TERMUX_ARCH}" = "arm" ]; then
## -mfpu=neon causes build failure on ARM. ## -mfpu=neon causes build failure on ARM.
CFLAGS="${CFLAGS/-mfpu=neon/} -mfpu=vfp" CFLAGS="${CFLAGS/-mfpu=neon/} -mfpu=vfp"
CXXFLAGS="${CXXFLAGS/-mfpu=neon/} -mfpu=vfp" CXXFLAGS="${CXXFLAGS/-mfpu=neon/} -mfpu=vfp"
fi fi
# This is needed for some packages depends on qt5-qtbase, such # This is needed for some packages depends on qt5-qtbase, such
# as qt5-qtwebengine # as qt5-qtwebengine
# https://github.com/termux/termux-packages/issues/18810 # https://github.com/termux/termux-packages/issues/18810
export LDFLAGS+=" -Wl,--undefined-version" export LDFLAGS+=" -Wl,--undefined-version"
## Create qmake.conf suitable for cross-compiling. ## Create qmake.conf suitable for cross-compiling.
sed \ sed \
-e "s|@TERMUX_PREFIX@|${TERMUX_PREFIX}|g" \ -e "s|@TERMUX_PREFIX@|${TERMUX_PREFIX}|g" \
-e "s|@TERMUX_CC@|${TERMUX_HOST_PLATFORM}-clang|" \ -e "s|@TERMUX_CC@|${TERMUX_HOST_PLATFORM}-clang|" \
-e "s|@TERMUX_CXX@|${TERMUX_HOST_PLATFORM}-clang++|" \ -e "s|@TERMUX_CXX@|${TERMUX_HOST_PLATFORM}-clang++|" \
-e "s|@TERMUX_AR@|llvm-ar|" \ -e "s|@TERMUX_AR@|llvm-ar|" \
-e "s|@TERMUX_NM@|llvm-nm|" \ -e "s|@TERMUX_NM@|llvm-nm|" \
-e "s|@TERMUX_OBJCOPY@|llvm-objcopy|" \ -e "s|@TERMUX_OBJCOPY@|llvm-objcopy|" \
-e "s|@TERMUX_PKGCONFIG@|${TERMUX_HOST_PLATFORM}-pkg-config|" \ -e "s|@TERMUX_PKGCONFIG@|${TERMUX_HOST_PLATFORM}-pkg-config|" \
-e "s|@TERMUX_STRIP@|llvm-strip|" \ -e "s|@TERMUX_STRIP@|llvm-strip|" \
-e "s|@TERMUX_CFLAGS@|${CPPFLAGS} ${CFLAGS}|" \ -e "s|@TERMUX_CFLAGS@|${CPPFLAGS} ${CFLAGS}|" \
-e "s|@TERMUX_CXXFLAGS@|${CPPFLAGS} ${CXXFLAGS}|" \ -e "s|@TERMUX_CXXFLAGS@|${CPPFLAGS} ${CXXFLAGS}|" \
-e "s|@TERMUX_LDFLAGS@|${LDFLAGS}|" \ -e "s|@TERMUX_LDFLAGS@|${LDFLAGS}|" \
"${TERMUX_PKG_BUILDER_DIR}/qmake.conf" > "${TERMUX_PKG_SRCDIR}/mkspecs/termux-cross/qmake.conf" "${TERMUX_PKG_BUILDER_DIR}/qmake.conf" > "${TERMUX_PKG_SRCDIR}/mkspecs/termux-cross/qmake.conf"
} }
termux_step_configure () { termux_step_configure () {
unset CC CXX LD CFLAGS LDFLAGS PKG_CONFIG_PATH unset CC CXX LD CFLAGS LDFLAGS PKG_CONFIG_PATH
"${TERMUX_PKG_SRCDIR}"/configure -v \ "${TERMUX_PKG_SRCDIR}"/configure -v \
-opensource \ -opensource \
-confirm-license \ -confirm-license \
-release \ -release \
-optimized-tools \ -optimized-tools \
-xplatform termux-cross \ -xplatform termux-cross \
-shared \ -shared \
-no-rpath \ -no-rpath \
-no-use-gold-linker \ -no-use-gold-linker \
-prefix "${TERMUX_PREFIX}" \ -prefix "${TERMUX_PREFIX}" \
-docdir "${TERMUX_PREFIX}/share/doc/qt" \ -docdir "${TERMUX_PREFIX}/share/doc/qt" \
-archdatadir "${TERMUX_PREFIX}/lib/qt" \ -archdatadir "${TERMUX_PREFIX}/lib/qt" \
-datadir "${TERMUX_PREFIX}/share/qt" \ -datadir "${TERMUX_PREFIX}/share/qt" \
-plugindir "${TERMUX_PREFIX}/libexec/qt" \ -plugindir "${TERMUX_PREFIX}/libexec/qt" \
-hostbindir "${TERMUX_PREFIX}/opt/qt/cross/bin" \ -hostbindir "${TERMUX_PREFIX}/opt/qt/cross/bin" \
-hostlibdir "${TERMUX_PREFIX}/opt/qt/cross/lib" \ -hostlibdir "${TERMUX_PREFIX}/opt/qt/cross/lib" \
-I "${TERMUX_PREFIX}/include" \ -I "${TERMUX_PREFIX}/include" \
-I "${TERMUX_PREFIX}/include/glib-2.0" \ -I "${TERMUX_PREFIX}/include/glib-2.0" \
-I "${TERMUX_PREFIX}/lib/glib-2.0/include" \ -I "${TERMUX_PREFIX}/lib/glib-2.0/include" \
-I "${TERMUX_PREFIX}/include/gio-unix-2.0" \ -I "${TERMUX_PREFIX}/include/gio-unix-2.0" \
-I "${TERMUX_PREFIX}/include/cairo" \ -I "${TERMUX_PREFIX}/include/cairo" \
-I "${TERMUX_PREFIX}/include/pango-1.0" \ -I "${TERMUX_PREFIX}/include/pango-1.0" \
-I "${TERMUX_PREFIX}/include/fribidi" \ -I "${TERMUX_PREFIX}/include/fribidi" \
-I "${TERMUX_PREFIX}/include/harfbuzz" \ -I "${TERMUX_PREFIX}/include/harfbuzz" \
-I "${TERMUX_PREFIX}/include/atk-1.0" \ -I "${TERMUX_PREFIX}/include/atk-1.0" \
-I "${TERMUX_PREFIX}/include/pixman-1" \ -I "${TERMUX_PREFIX}/include/pixman-1" \
-I "${TERMUX_PREFIX}/include/uuid" \ -I "${TERMUX_PREFIX}/include/uuid" \
-I "${TERMUX_PREFIX}/include/libxml2" \ -I "${TERMUX_PREFIX}/include/libxml2" \
-I "${TERMUX_PREFIX}/include/freetype2" \ -I "${TERMUX_PREFIX}/include/freetype2" \
-I "${TERMUX_PREFIX}/include/gdk-pixbuf-2.0" \ -I "${TERMUX_PREFIX}/include/gdk-pixbuf-2.0" \
-I "${TERMUX_PREFIX}/include/gtk-3.0" \ -I "${TERMUX_PREFIX}/include/gtk-3.0" \
-L "${TERMUX_PREFIX}/lib" \ -L "${TERMUX_PREFIX}/lib" \
-nomake examples \ -nomake examples \
-no-pch \ -no-pch \
-no-accessibility \ -no-accessibility \
-glib \ -glib \
-gtk \ -gtk \
-icu \ -icu \
-system-doubleconversion \ -system-doubleconversion \
-system-pcre \ -system-pcre \
-system-zlib \ -system-zlib \
-system-freetype \ -system-freetype \
-ssl \ -ssl \
-openssl-linked \ -openssl-linked \
-no-system-proxies \ -no-system-proxies \
-no-cups \ -no-cups \
-system-harfbuzz \ -system-harfbuzz \
-no-opengl \ -no-opengl \
-no-vulkan \ -no-vulkan \
-qpa xcb \ -qpa xcb \
-no-eglfs \ -no-eglfs \
-no-gbm \ -no-gbm \
-no-kms \ -no-kms \
-no-linuxfb \ -no-linuxfb \
-no-libudev \ -no-libudev \
-no-evdev \ -no-evdev \
-no-libinput \ -no-libinput \
-no-mtdev \ -no-mtdev \
-no-tslib \ -no-tslib \
-xcb \ -xcb \
-xcb-xlib \ -xcb-xlib \
-gif \ -gif \
-system-libpng \ -system-libpng \
-system-libjpeg \ -system-libjpeg \
-system-sqlite \ -system-sqlite \
-sql-sqlite \ -sql-sqlite \
-posix-ipc -posix-ipc
} }
termux_step_post_make_install() { termux_step_post_make_install() {
####################################################### #######################################################
## ##
## Compiling necessary libraries for target. ## Compiling necessary libraries for target.
## ##
####################################################### #######################################################
cd "${TERMUX_PKG_SRCDIR}/src/tools/bootstrap" && { cd "${TERMUX_PKG_SRCDIR}/src/tools/bootstrap" && {
make clean make clean
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PKG_SRCDIR}/mkspecs/termux-cross" \ -spec "${TERMUX_PKG_SRCDIR}/mkspecs/termux-cross" \
DEFINES+="QT_POSIX_IPC" DEFINES+="QT_POSIX_IPC"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm644 ../../../lib/libQt5Bootstrap.a "${TERMUX_PREFIX}/lib/libQt5Bootstrap.a" install -Dm644 ../../../lib/libQt5Bootstrap.a "${TERMUX_PREFIX}/lib/libQt5Bootstrap.a"
install -Dm644 ../../../lib/libQt5Bootstrap.prl "${TERMUX_PREFIX}/lib/libQt5Bootstrap.prl" install -Dm644 ../../../lib/libQt5Bootstrap.prl "${TERMUX_PREFIX}/lib/libQt5Bootstrap.prl"
} }
cd "${TERMUX_PKG_SRCDIR}/src/tools/bootstrap-dbus" && { cd "${TERMUX_PKG_SRCDIR}/src/tools/bootstrap-dbus" && {
# create the dbus bootstrap archieve but we don't need to install this # create the dbus bootstrap archieve but we don't need to install this
make clean make clean
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PKG_SRCDIR}/mkspecs/termux-cross" -spec "${TERMUX_PKG_SRCDIR}/mkspecs/termux-cross"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
} }
####################################################### #######################################################
## ##
## Compiling necessary programs for target. ## Compiling necessary programs for target.
## ##
####################################################### #######################################################
## Note: qmake can be built only on host so it is omitted here. ## Note: qmake can be built only on host so it is omitted here.
for i in moc qlalr qvkgen rcc uic qdbuscpp2xml qdbusxml2cpp; do for i in moc qlalr qvkgen rcc uic qdbuscpp2xml qdbusxml2cpp; do
cd "${TERMUX_PKG_SRCDIR}/src/tools/${i}" && { cd "${TERMUX_PKG_SRCDIR}/src/tools/${i}" && {
make clean make clean
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PKG_SRCDIR}/mkspecs/termux-cross" -spec "${TERMUX_PKG_SRCDIR}/mkspecs/termux-cross"
## Fix build failure on at least 'i686'. ## Fix build failure on at least 'i686'.
sed \ sed \
-i 's@$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)@$(LINK) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) $(LFLAGS) -lz@g' \ -i 's@$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)@$(LINK) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) $(LFLAGS) -lz@g' \
Makefile Makefile
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm700 "../../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}" install -Dm700 "../../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}"
} }
done done
unset i unset i
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
# Limit the scope, otherwise it'll touch other Qt files in a dirty host env # Limit the scope, otherwise it'll touch other Qt files in a dirty host env
for i in Bootstrap Concurrent Core DBus DeviceDiscoverySupport EdidSupport EventDispatcherSupport FbSupport FontDatabaseSupport Gui InputSupport Network PrintSupport ServiceSupport Sql Test ThemeSupport Widget XcbQpa XkbCommonSupport Xml Zlib; do for i in Bootstrap Concurrent Core DBus DeviceDiscoverySupport EdidSupport EventDispatcherSupport FbSupport FontDatabaseSupport Gui InputSupport Network PrintSupport ServiceSupport Sql Test ThemeSupport Widget XcbQpa XkbCommonSupport Xml Zlib; do
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5${i}.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5${i}.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
done done
unset i unset i
sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.prl" sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.prl"
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
find "${TERMUX_PREFIX}/opt/qt/cross/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/opt/qt/cross/lib" -iname \*.la -delete
## Create qmake.conf suitable for compiling host tools (for other modules) ## Create qmake.conf suitable for compiling host tools (for other modules)
install -Dm644 \ install -Dm644 \
"${TERMUX_PKG_BUILDER_DIR}/qplatformdefs.host.h" \ "${TERMUX_PKG_BUILDER_DIR}/qplatformdefs.host.h" \
"${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host/qplatformdefs.h" "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host/qplatformdefs.h"
sed \ sed \
-e "s|@TERMUX_PREFIX@|${TERMUX_PREFIX}|g" \ -e "s|@TERMUX_PREFIX@|${TERMUX_PREFIX}|g" \
"${TERMUX_PKG_BUILDER_DIR}/qmake.host.conf" > "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host/qmake.conf" "${TERMUX_PKG_BUILDER_DIR}/qmake.host.conf" > "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host/qmake.conf"
} }
termux_step_create_debscripts() { termux_step_create_debscripts() {
# Some clean-up is happening via `postinst` # Some clean-up is happening via `postinst`
# Because we're using this package in both host (Ubuntu glibc) and device (Termux) # Because we're using this package in both host (Ubuntu glibc) and device (Termux)
cp -f "${TERMUX_PKG_BUILDER_DIR}/postinst" ./ cp -f "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
sed -i "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" ./postinst sed -i "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" ./postinst
} }

View File

@ -19,145 +19,145 @@ opt/qt/cross/lib/libQt5Bootstrap.*
TERMUX_PKG_REPLACES="qt5-declarative" TERMUX_PKG_REPLACES="qt5-declarative"
termux_step_pre_configure () { termux_step_pre_configure () {
pushd "${TERMUX_PKG_SRCDIR}/src/qmltyperegistrar" pushd "${TERMUX_PKG_SRCDIR}/src/qmltyperegistrar"
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
popd popd
####################################################### #######################################################
## ##
## Hijack the bootstrap library for cross building ## Hijack the bootstrap library for cross building
## ##
####################################################### #######################################################
for i in a prl; do for i in a prl; do
cp -p "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}" \ cp -p "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}" \
"${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}.bak" "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}.bak"
ln -s -f "${TERMUX_PREFIX}/lib/libQt5Bootstrap.${i}" \ ln -s -f "${TERMUX_PREFIX}/lib/libQt5Bootstrap.${i}" \
"${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}" "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}"
done done
unset i unset i
} }
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_post_make_install () { termux_step_post_make_install () {
####################################################### #######################################################
## ##
## Compiling necessary binaries for target. ## Compiling necessary binaries for target.
## ##
####################################################### #######################################################
## Qt Declarative utilities. ## Qt Declarative utilities.
for i in qmlcachegen qmlformat qmlimportscanner qmllint qmlmin; do for i in qmlcachegen qmlformat qmlimportscanner qmllint qmlmin; do
cd "${TERMUX_PKG_SRCDIR}/tools/${i}" && { cd "${TERMUX_PKG_SRCDIR}/tools/${i}" && {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}" install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}"
} }
done done
for i in qmltyperegistrar; do for i in qmltyperegistrar; do
cd "${TERMUX_PKG_SRCDIR}/src/${i}" && { cd "${TERMUX_PKG_SRCDIR}/src/${i}" && {
make clean make clean
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}" install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}"
} }
done done
# Install the QmlDevTools for target (needed by some packages such as qttools) # Install the QmlDevTools for target (needed by some packages such as qttools)
install -Dm644 ${TERMUX_PKG_SRCDIR}/lib/libQt5QmlDevTools.a "${TERMUX_PREFIX}/lib/libQt5QmlDevTools.a" install -Dm644 ${TERMUX_PKG_SRCDIR}/lib/libQt5QmlDevTools.a "${TERMUX_PREFIX}/lib/libQt5QmlDevTools.a"
install -Dm644 ${TERMUX_PKG_SRCDIR}/lib/libQt5QmlDevTools.prl "${TERMUX_PREFIX}/lib/libQt5QmlDevTools.prl" install -Dm644 ${TERMUX_PKG_SRCDIR}/lib/libQt5QmlDevTools.prl "${TERMUX_PREFIX}/lib/libQt5QmlDevTools.prl"
sed -i 's|/opt/qt/cross/|/|g' "${TERMUX_PREFIX}/lib/libQt5QmlDevTools.prl" sed -i 's|/opt/qt/cross/|/|g' "${TERMUX_PREFIX}/lib/libQt5QmlDevTools.prl"
####################################################### #######################################################
## ##
## Restore the bootstrap library ## Restore the bootstrap library
## ##
####################################################### #######################################################
for i in a prl; do for i in a prl; do
rm -f "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}" rm -f "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}"
cp -p "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}.bak" \ cp -p "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}.bak" \
"${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}" "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}"
rm -f "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}.bak" rm -f "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5Bootstrap.${i}.bak"
done done
unset i unset i
####################################################### #######################################################
## ##
## Compiling necessary binaries for the host ## Compiling necessary binaries for the host
## ##
####################################################### #######################################################
## libQt5QmlDevTools.a (qt5-declarative) ## libQt5QmlDevTools.a (qt5-declarative)
cd "${TERMUX_PKG_SRCDIR}/src/qmldevtools" && { cd "${TERMUX_PKG_SRCDIR}/src/qmldevtools" && {
make clean make clean
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm644 ../../lib/libQt5QmlDevTools.a "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5QmlDevTools.a" install -Dm644 ../../lib/libQt5QmlDevTools.a "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5QmlDevTools.a"
install -Dm644 ../../lib/libQt5QmlDevTools.prl "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5QmlDevTools.prl" install -Dm644 ../../lib/libQt5QmlDevTools.prl "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5QmlDevTools.prl"
} }
## Qt Declarative utilities. ## Qt Declarative utilities.
for i in qmlcachegen qmlformat qmlimportscanner qmllint qmlmin; do for i in qmlcachegen qmlformat qmlimportscanner qmllint qmlmin; do
cd "${TERMUX_PKG_SRCDIR}/tools/${i}" && { cd "${TERMUX_PKG_SRCDIR}/tools/${i}" && {
make clean make clean
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/opt/qt/cross/bin/${i}" install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/opt/qt/cross/bin/${i}"
} }
done done
for i in qmltyperegistrar; do for i in qmltyperegistrar; do
cd "${TERMUX_PKG_SRCDIR}/src/${i}" && { cd "${TERMUX_PKG_SRCDIR}/src/${i}" && {
make clean make clean
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/opt/qt/cross/bin/${i}" install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/opt/qt/cross/bin/${i}"
} }
done done
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
# Limit the scope, otherwise it'll touch qtbase files # Limit the scope, otherwise it'll touch qtbase files
for pref in Qml Quick Packet; do for pref in Qml Quick Packet; do
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5${pref}*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5${pref}*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
done done
unset pref unset pref
sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5QmlDevTools.prl" sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5QmlDevTools.prl"
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
find "${TERMUX_PREFIX}/opt/qt/cross/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/opt/qt/cross/lib" -iname \*.la -delete
} }
termux_step_create_debscripts() { termux_step_create_debscripts() {
# Some clean-up is happening via `postinst` # Some clean-up is happening via `postinst`
# Because we're using this package in both host (Ubuntu glibc) and device (Termux) # Because we're using this package in both host (Ubuntu glibc) and device (Termux)
cp -f "${TERMUX_PKG_BUILDER_DIR}/postinst" ./ cp -f "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
sed -i "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" ./postinst sed -i "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" ./postinst
} }

View File

@ -11,24 +11,24 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_post_make_install() { termux_step_post_make_install() {
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5Location*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5Location*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5Position*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5Position*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
} }

View File

@ -12,28 +12,28 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" \ -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" \
GST_VERSION=1.0 \ GST_VERSION=1.0 \
INCLUDEPATH+="${TERMUX_PREFIX}/include/gstreamer-1.0/" \ INCLUDEPATH+="${TERMUX_PREFIX}/include/gstreamer-1.0/" \
INCLUDEPATH+="${TERMUX_PREFIX}/include/glib-2.0/" \ INCLUDEPATH+="${TERMUX_PREFIX}/include/glib-2.0/" \
INCLUDEPATH+="${TERMUX_PREFIX}/lib/glib-2.0/include" INCLUDEPATH+="${TERMUX_PREFIX}/lib/glib-2.0/include"
} }
termux_step_make_install() { termux_step_make_install() {
make install make install
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5Multimedia*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5Multimedia*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
} }

View File

@ -11,18 +11,18 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_post_make_install() { termux_step_post_make_install() {
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
} }

View File

@ -11,24 +11,24 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_post_make_install() { termux_step_post_make_install() {
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5QuickControls2*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5QuickControls2*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5QuickTemplates2*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5QuickTemplates2*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
} }

View File

@ -11,22 +11,22 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_post_make_install() { termux_step_post_make_install() {
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5Sensors*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5Sensors*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
} }

View File

@ -11,24 +11,24 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_make_install() { termux_step_make_install() {
make install make install
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5Svg*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5Svg*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
} }

View File

@ -20,213 +20,213 @@ opt/qt/cross/lib/libQt5QmlDevTools.*
TERMUX_PKG_REPLACES="qt5-tools" TERMUX_PKG_REPLACES="qt5-tools"
termux_step_pre_configure () { termux_step_pre_configure () {
####################################################### #######################################################
## ##
## Hijack the bootstrap library ## Hijack the bootstrap library
## ##
####################################################### #######################################################
for i in Bootstrap QmlDevTools; do for i in Bootstrap QmlDevTools; do
cp -p "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.a" \ cp -p "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.a" \
"${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.a.bak" "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.a.bak"
ln -s -f "${TERMUX_PREFIX}/lib/libQt5${i}.a" \ ln -s -f "${TERMUX_PREFIX}/lib/libQt5${i}.a" \
"${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.a" "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.a"
cp -p "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.prl" \ cp -p "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.prl" \
"${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.prl.bak" "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.prl.bak"
ln -s -f "${TERMUX_PREFIX}/lib/libQt5${i}.prl" \ ln -s -f "${TERMUX_PREFIX}/lib/libQt5${i}.prl" \
"${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.prl" "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.prl"
done done
unset i unset i
} }
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_post_make_install() { termux_step_post_make_install() {
####################################################### #######################################################
## ##
## Compiling necessary programs for target. ## Compiling necessary programs for target.
## ##
####################################################### #######################################################
## Some top-level tools ## Some top-level tools
# FIXME: qdoc cannot be built at the moment because qmake couldn't find libclang when built with -I # FIXME: qdoc cannot be built at the moment because qmake couldn't find libclang when built with -I
for i in makeqpf pixeltool qev qtattributionsscanner; do for i in makeqpf pixeltool qev qtattributionsscanner; do
cd "${TERMUX_PKG_SRCDIR}/src/${i}" && { cd "${TERMUX_PKG_SRCDIR}/src/${i}" && {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}" install -Dm700 "../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}"
} }
done done
unset i unset i
# QDbusViewer desktop file (the binary would be installed already) # QDbusViewer desktop file (the binary would be installed already)
install -D -m644 \ install -D -m644 \
"${TERMUX_PKG_SRCDIR}/src/qdbus/qdbusviewer/images/qdbusviewer.png" \ "${TERMUX_PKG_SRCDIR}/src/qdbus/qdbusviewer/images/qdbusviewer.png" \
"${TERMUX_PREFIX}/share/icons/hicolor/32x32/apps/qdbusviewer.png" "${TERMUX_PREFIX}/share/icons/hicolor/32x32/apps/qdbusviewer.png"
install -D -m644 \ install -D -m644 \
"${TERMUX_PKG_SRCDIR}/src/qdbus/qdbusviewer/images/qdbusviewer-128.png" \ "${TERMUX_PKG_SRCDIR}/src/qdbus/qdbusviewer/images/qdbusviewer-128.png" \
"${TERMUX_PREFIX}/share/icons/hicolor/128x128/apps/qdbusviewer.png" "${TERMUX_PREFIX}/share/icons/hicolor/128x128/apps/qdbusviewer.png"
install -D -m644 \ install -D -m644 \
"${TERMUX_PKG_BUILDER_DIR}/qdbusviewer.desktop" \ "${TERMUX_PKG_BUILDER_DIR}/qdbusviewer.desktop" \
"${TERMUX_PREFIX}/share/applications/qdbusviewer.desktop" "${TERMUX_PREFIX}/share/applications/qdbusviewer.desktop"
# qdistancefieldgenerator (it has a different directory name but supports make install) # qdistancefieldgenerator (it has a different directory name but supports make install)
cd "${TERMUX_PKG_SRCDIR}/src/distancefieldgenerator" && { cd "${TERMUX_PKG_SRCDIR}/src/distancefieldgenerator" && {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
make install make install
} }
####################################################### #######################################################
## ##
## Qt Linguist ## Qt Linguist
## ##
####################################################### #######################################################
# Install the linguist utilities to the correct path # Install the linguist utilities to the correct path
for i in lconvert lprodump lrelease{,-pro} lupdate{,-pro}; do for i in lconvert lprodump lrelease{,-pro} lupdate{,-pro}; do
install -Dm700 "${TERMUX_PKG_SRCDIR}/bin/${i}" "${TERMUX_PREFIX}/bin/${i}" install -Dm700 "${TERMUX_PKG_SRCDIR}/bin/${i}" "${TERMUX_PREFIX}/bin/${i}"
done done
# Build and install linguist program # Build and install linguist program
cd "${TERMUX_PKG_SRCDIR}/src/linguist/linguist" && { cd "${TERMUX_PKG_SRCDIR}/src/linguist/linguist" && {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
make install make install
} }
# Install the linguist desktop file # Install the linguist desktop file
install -Dm644 \ install -Dm644 \
"${TERMUX_PKG_SRCDIR}/src/linguist/linguist/images/icons/linguist-32-32.png" \ "${TERMUX_PKG_SRCDIR}/src/linguist/linguist/images/icons/linguist-32-32.png" \
"${TERMUX_PREFIX}/share/icons/hicolor/32x32/apps/linguist.png" "${TERMUX_PREFIX}/share/icons/hicolor/32x32/apps/linguist.png"
install -Dm644 \ install -Dm644 \
"${TERMUX_PKG_SRCDIR}/src/linguist/linguist/images/icons/linguist-128-32.png" \ "${TERMUX_PKG_SRCDIR}/src/linguist/linguist/images/icons/linguist-128-32.png" \
"${TERMUX_PREFIX}/share/icons/hicolor/128x128/apps/linguist.png" "${TERMUX_PREFIX}/share/icons/hicolor/128x128/apps/linguist.png"
install -Dm644 \ install -Dm644 \
"${TERMUX_PKG_BUILDER_DIR}/linguist.desktop" \ "${TERMUX_PKG_BUILDER_DIR}/linguist.desktop" \
"${TERMUX_PREFIX}/share/applications/linguist.desktop" "${TERMUX_PREFIX}/share/applications/linguist.desktop"
####################################################### #######################################################
## ##
## Qt Assistant ## Qt Assistant
## ##
####################################################### #######################################################
for i in qcollectiongenerator qhelpgenerator assistant; do for i in qcollectiongenerator qhelpgenerator assistant; do
cd "${TERMUX_PKG_SRCDIR}/src/assistant/${i}" && { cd "${TERMUX_PKG_SRCDIR}/src/assistant/${i}" && {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm700 "../../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}" install -Dm700 "../../../bin/${i}" "${TERMUX_PREFIX}/bin/${i}"
} }
done done
install -Dm644 \ install -Dm644 \
"${TERMUX_PKG_SRCDIR}/src/assistant/assistant/images/assistant.png" \ "${TERMUX_PKG_SRCDIR}/src/assistant/assistant/images/assistant.png" \
"${TERMUX_PREFIX}/share/icons/hicolor/32x32/apps/assistant.png" "${TERMUX_PREFIX}/share/icons/hicolor/32x32/apps/assistant.png"
install -Dm644 \ install -Dm644 \
"${TERMUX_PKG_SRCDIR}/src/assistant/assistant/images/assistant-128.png" \ "${TERMUX_PKG_SRCDIR}/src/assistant/assistant/images/assistant-128.png" \
"${TERMUX_PREFIX}/share/icons/hicolor/128x128/apps/assistant.png" "${TERMUX_PREFIX}/share/icons/hicolor/128x128/apps/assistant.png"
install -Dm644 \ install -Dm644 \
"${TERMUX_PKG_BUILDER_DIR}/assistant.desktop" \ "${TERMUX_PKG_BUILDER_DIR}/assistant.desktop" \
"${TERMUX_PREFIX}/share/applications/assistant.desktop" "${TERMUX_PREFIX}/share/applications/assistant.desktop"
####################################################### #######################################################
## ##
## Qt Designer ## Qt Designer
## ##
####################################################### #######################################################
for i in lib components designer plugins; do for i in lib components designer plugins; do
cd "${TERMUX_PKG_SRCDIR}/src/designer/src/${i}" && { cd "${TERMUX_PKG_SRCDIR}/src/designer/src/${i}" && {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
make install make install
} }
done done
install -Dm644 \ install -Dm644 \
"${TERMUX_PKG_SRCDIR}/src/designer/src/designer/images/designer.png" \ "${TERMUX_PKG_SRCDIR}/src/designer/src/designer/images/designer.png" \
"${TERMUX_PREFIX}/share/icons/hicolor/128x128/apps/designer.png" "${TERMUX_PREFIX}/share/icons/hicolor/128x128/apps/designer.png"
install -Dm644 \ install -Dm644 \
"${TERMUX_PKG_BUILDER_DIR}/designer.desktop" \ "${TERMUX_PKG_BUILDER_DIR}/designer.desktop" \
"${TERMUX_PREFIX}/share/applications/designer.desktop" "${TERMUX_PREFIX}/share/applications/designer.desktop"
####################################################### #######################################################
## ##
## Restore the bootstrap library ## Restore the bootstrap library
## ##
####################################################### #######################################################
for i in Bootstrap QmlDevTools; do for i in Bootstrap QmlDevTools; do
mv "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.a.bak" \ mv "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.a.bak" \
"${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.a" "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.a"
mv "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.prl.bak" \ mv "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.prl.bak" \
"${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.prl" "${TERMUX_PREFIX}/opt/qt/cross/lib/libQt5${i}.prl"
done done
####################################################### #######################################################
## ##
## Compiling necessary programs for host ## Compiling necessary programs for host
## ##
####################################################### #######################################################
# These programs were built and linked for the target # These programs were built and linked for the target
# We need to build them again but for the host # We need to build them again but for the host
cd "${TERMUX_PKG_SRCDIR}/src/qtattributionsscanner" && { cd "${TERMUX_PKG_SRCDIR}/src/qtattributionsscanner" && {
make clean make clean
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm700 \ install -Dm700 \
"../../bin/qtattributionsscanner" \ "../../bin/qtattributionsscanner" \
"${TERMUX_PREFIX}/opt/qt/cross/bin/qtattributionsscanner" "${TERMUX_PREFIX}/opt/qt/cross/bin/qtattributionsscanner"
} }
for i in lconvert lprodump lrelease{,-pro} lupdate{,-pro}; do for i in lconvert lprodump lrelease{,-pro} lupdate{,-pro}; do
cd "${TERMUX_PKG_SRCDIR}/src/linguist/${i}" && { cd "${TERMUX_PKG_SRCDIR}/src/linguist/${i}" && {
make clean make clean
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-host"
make -j "${TERMUX_MAKE_PROCESSES}" make -j "${TERMUX_MAKE_PROCESSES}"
install -Dm700 "../../../bin/${i}" "${TERMUX_PREFIX}/opt/qt/cross/bin/${i}" install -Dm700 "../../../bin/${i}" "${TERMUX_PREFIX}/opt/qt/cross/bin/${i}"
} }
done done
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
# Limit the scope, otherwise it'll touch qtbase files # Limit the scope, otherwise it'll touch qtbase files
for pref in Designer Help UiTools UiPlugin; do for pref in Designer Help UiTools UiPlugin; do
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5${pref}*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5${pref}*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
done done
unset pref unset pref
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
find "${TERMUX_PREFIX}/opt/qt/cross/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/opt/qt/cross/lib" -iname \*.la -delete
} }
termux_step_create_debscripts() { termux_step_create_debscripts() {
# Some clean-up is happening via `postinst` # Some clean-up is happening via `postinst`
# Because we're using this package in both host (Ubuntu glibc) and device (Termux) # Because we're using this package in both host (Ubuntu glibc) and device (Termux)
cp -f "${TERMUX_PKG_BUILDER_DIR}/postinst" ./ cp -f "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
sed -i "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" ./postinst sed -i "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" ./postinst
} }

View File

@ -11,22 +11,22 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_post_make_install() { termux_step_post_make_install() {
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5WebChannel*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5WebChannel*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
} }

View File

@ -11,21 +11,21 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_post_make_install() { termux_step_post_make_install() {
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "${TERMUX_PREFIX}/lib/libQt5WebSockets.prl" sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "${TERMUX_PREFIX}/lib/libQt5WebSockets.prl"
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
} }

View File

@ -14,24 +14,24 @@ TERMUX_PKG_NO_STATICSPLIT=true
TERMUX_PKG_REPLACES="qt5-x11extras" TERMUX_PKG_REPLACES="qt5-x11extras"
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_make_install() { termux_step_make_install() {
make install make install
####################################################### #######################################################
## ##
## Fixes & cleanup. ## Fixes & cleanup.
## ##
####################################################### #######################################################
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5X11*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5X11*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
} }

View File

@ -11,16 +11,16 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross"
} }
termux_step_post_make_install() { termux_step_post_make_install() {
## Drop QMAKE_PRL_BUILD_DIR because reference the build dir. ## Drop QMAKE_PRL_BUILD_DIR because reference the build dir.
find "${TERMUX_PREFIX}/lib" -type f -name "libQt5XmlPatterns*.prl" \ find "${TERMUX_PREFIX}/lib" -type f -name "libQt5XmlPatterns*.prl" \
-exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \; -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' "{}" \;
## Remove *.la files. ## Remove *.la files.
find "${TERMUX_PREFIX}/lib" -iname \*.la -delete find "${TERMUX_PREFIX}/lib" -iname \*.la -delete
} }

View File

@ -12,7 +12,7 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true TERMUX_PKG_NO_STATICSPLIT=true
termux_step_configure () { termux_step_configure () {
"${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \ "${TERMUX_PREFIX}/opt/qt/cross/bin/qmake" \
-spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" \ -spec "${TERMUX_PREFIX}/lib/qt/mkspecs/termux-cross" \
PREFIX="${TERMUX_PREFIX}" PREFIX="${TERMUX_PREFIX}"
} }