Skip to content

Commit cf773f5

Browse files
committed
Script: add to support termux
1 parent d98ec4f commit cf773f5

7 files changed

Lines changed: 462 additions & 16 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ https://github.com/user-attachments/assets/11951698-762a-4771-b4c7-c669788bdc25
7575
- [x] Windows 7 SP1 and later
7676
- [x] Unix/Linux
7777
- [x] [Android](https://doc.qt.io/qt-6/android.html)
78+
- [x] [termux](https://github.com/termux)
7879
- [x] macOS
7980

8081
See: [Qt5](https://doc.qt.io/qt-5/supported-platforms.html),
@@ -306,6 +307,7 @@ Contact me:
306307
- [Compiling for Windows](docs/Compile/Windows.md)
307308
- [Compiling for macOS](docs/Compile/macOS.md)
308309
- [Compiling for Android](docs/Compile/Android_zh_CN.md)
310+
- [Compiling for termux](docs/Compile/Termux.md)
309311

310312
## [License Agreement](License.md "License.md")
311313

‎README_zh_CN.md‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ https://github.com/user-attachments/assets/9ebdc7e6-ed7a-4813-afcf-7a04cd6f889b
7474
- [x] Windows 7 SP1 及以后
7575
- [x] Unix/Linux
7676
- [x] [Android](https://doc.qt.io/qt-6/android.html)
77+
- [x] [termux](https://github.com/termux)
7778
- [x] macOS
7879

7980
详见:[Qt5 支持平台](https://doc.qt.io/qt-5/supported-platforms.html)、
@@ -86,12 +87,12 @@ https://github.com/user-attachments/assets/9ebdc7e6-ed7a-4813-afcf-7a04cd6f889b
8687

8788
- 远程桌面
8889

89-
| |Windows|Unix/Linux|Android|macOS|
90-
|--------|-------|----------|-------|-----|
91-
|vnc |✓ |✓ |✓ |✓ |
92-
|RDP |✓ |✓ |✓ |✓ |
93-
|Spice | | | | |
94-
|Scrcpy | | | | |
90+
| |Windows|Unix/Linux|Android|termux|macOS|
91+
|--------|-------|----------|-------|------|-----|
92+
|vnc |✓ |✓ |✓ |✓ |✓ |
93+
|RDP |✓ |✓ |✓ |✓ |✓ |
94+
|Spice | | | | | |
95+
|Scrcpy | | | | | |
9596

9697
- 终端
9798

@@ -304,6 +305,7 @@ https://github.com/user-attachments/assets/9ebdc7e6-ed7a-4813-afcf-7a04cd6f889b
304305
- [为 Windows 编译](docs/Compile/Windows_zh_CN.md)
305306
- [为 macOS 编译 (English)](docs/Compile/macOS.md)
306307
- [为 Android 编译](docs/Compile/Android_zh_CN.md)
308+
- [为 termux 编译](docs/Compile/Termux_zh_CN.md)
307309

308310
## [许可协议](License.md "License.md")
309311

‎Script/build_depend.sh‎

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,16 @@ if [ -n "$PACKAGE" ]; then
556556
package_install $PACKAGE
557557
fi
558558

559-
if [ $BASE_LIBS -eq 1 ]; then
559+
install_base() {
560560
echo_status "Install base libraries ......"
561+
if is_termux; then
562+
package_install wget curl git cmake build-essential freerdp libvncserver libcurl
563+
#package_install mesa-dev glu glew glfw libglvnd-dev libglvnd
564+
package_install qt6-qttools qt6-qtbase qt6-qttranslations qt6-qt5compat qt6-qtimageformats qt6-qtmultimedia \
565+
qt6-qtscxml qt6-qtsvg qt6-qtwayland qt6-qtwebchannel qt6-qtwebengine qt6-qtwebsockets qt6-qtpositioning qt6-qtbase-gtk-platformtheme qt6ct
566+
return 0
567+
fi
568+
561569
if [ "$PACKAGE_TOOL" = "apt" ]; then
562570
# Build tools
563571
package_install build-essential devscripts equivs debhelper \
@@ -655,6 +663,10 @@ if [ $BASE_LIBS -eq 1 ]; then
655663
if [ $MACOS -eq 1 ]; then
656664
package_install nasm autoconf automake libtool pkg-config doxygen zstd curl
657665
fi
666+
}
667+
668+
if [ $BASE_LIBS -eq 1 ]; then
669+
install_base
658670
fi
659671

660672
if [ $DEFAULT_LIBS -eq 1 ]; then
@@ -718,6 +730,9 @@ if [ $RabbitCommon -eq 1 ]; then
718730
fi
719731
fi
720732

733+
if [ is_termux ]; then
734+
CMAKE_PARA="-DCMAKE_SYSTEM_NAME=Linux"
735+
fi
721736
if [ $LIBSSH -eq 1 ]; then
722737
echo_status "Install libssh ......"
723738
pushd "$SOURCE_DIR"
@@ -732,7 +747,7 @@ if [ $LIBSSH -eq 1 ]; then
732747
fi
733748
cmake -E make_directory $BUILD_DEPEND_DIR/libssh
734749
pushd $BUILD_DEPEND_DIR/libssh
735-
cmake -S $SOURCE_DIR/libssh -DCMAKE_BUILD_TYPE=Release \
750+
cmake -S $SOURCE_DIR/libssh -DCMAKE_BUILD_TYPE=Release $CMAKE_PARA \
736751
-DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE} \
737752
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
738753
-DWITH_EXAMPLES=OFF
@@ -752,7 +767,7 @@ if [ $FREERDP -eq 1 ]; then
752767
fi
753768
cmake -E make_directory $BUILD_DEPEND_DIR/FreeRDP
754769
pushd $BUILD_DEPEND_DIR/FreeRDP
755-
cmake -S $SOURCE_DIR/FreeRDP \
770+
cmake -S $SOURCE_DIR/FreeRDP $CMAKE_PARA \
756771
-DCMAKE_BUILD_TYPE=Release \
757772
-DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE} \
758773
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
@@ -781,7 +796,7 @@ if [ $TIGERVNC -eq 1 ]; then
781796
fi
782797
cmake -E make_directory $BUILD_DEPEND_DIR/tigervnc
783798
pushd $BUILD_DEPEND_DIR/tigervnc
784-
cmake -S $SOURCE_DIR/tigervnc -DCMAKE_BUILD_TYPE=Release \
799+
cmake -S $SOURCE_DIR/tigervnc -DCMAKE_BUILD_TYPE=Release $CMAKE_PARA \
785800
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
786801
-DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE} \
787802
-DBUILD_TESTS=OFF -DBUILD_VIEWER=OFF -DENABLE_NLS=OFF \
@@ -802,7 +817,7 @@ if [ $PCAPPLUSPLUS -eq 1 ]; then
802817
fi
803818
cmake -E make_directory $BUILD_DEPEND_DIR/PcapPlusPlus
804819
pushd $BUILD_DEPEND_DIR/PcapPlusPlus
805-
cmake -S $SOURCE_DIR/PcapPlusPlus -DCMAKE_BUILD_TYPE=Release \
820+
cmake -S $SOURCE_DIR/PcapPlusPlus -DCMAKE_BUILD_TYPE=Release $CMAKE_PARA \
806821
-DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE} \
807822
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
808823
-DPCAPPP_BUILD_EXAMPLES=OFF \
@@ -826,7 +841,7 @@ if [ $libdatachannel -eq 1 ]; then
826841
git submodule update --init --recursive
827842
cmake -E make_directory $BUILD_DEPEND_DIR/libdatachannel
828843
pushd $BUILD_DEPEND_DIR/libdatachannel
829-
cmake -S $SOURCE_DIR/libdatachannel -DCMAKE_BUILD_TYPE=Release \
844+
cmake -S $SOURCE_DIR/libdatachannel -DCMAKE_BUILD_TYPE=Release $CMAKE_PARA \
830845
-DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE} \
831846
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
832847
cmake --build . --config Release --parallel $(nproc)
@@ -847,7 +862,7 @@ if [ $QtService -eq 1 ]; then
847862
git submodule update --init --recursive
848863
cmake -E make_directory $BUILD_DEPEND_DIR/qtservice
849864
pushd $BUILD_DEPEND_DIR/qtservice
850-
cmake -S $SOURCE_DIR/qtservice -DCMAKE_BUILD_TYPE=Release \
865+
cmake -S $SOURCE_DIR/qtservice -DCMAKE_BUILD_TYPE=Release $CMAKE_PARA \
851866
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
852867
-DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE}
853868
cmake --build . --config Release --parallel $(nproc)
@@ -874,7 +889,7 @@ if [ $QTERMWIDGET -eq 1 ]; then
874889
popd
875890
cmake -E make_directory $BUILD_DEPEND_DIR/lxqt-build-tools
876891
pushd $BUILD_DEPEND_DIR/lxqt-build-tools
877-
cmake -S $SOURCE_DIR/lxqt-build-tools -DCMAKE_BUILD_TYPE=Release \
892+
cmake -S $SOURCE_DIR/lxqt-build-tools -DCMAKE_BUILD_TYPE=Release $CMAKE_PARA \
878893
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
879894
-DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE}
880895
cmake --build . --config Release --parallel $(nproc)
@@ -909,7 +924,7 @@ if [ $QTKEYCHAIN -eq 1 ]; then
909924
fi
910925
cmake -E make_directory $BUILD_DEPEND_DIR/qtkeychain
911926
pushd $BUILD_DEPEND_DIR/qtkeychain
912-
cmake -S $SOURCE_DIR/qtkeychain -DCMAKE_BUILD_TYPE=Release \
927+
cmake -S $SOURCE_DIR/qtkeychain -DCMAKE_BUILD_TYPE=Release $CMAKE_PARA \
913928
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
914929
-DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE} \
915930
-DBUILD_WITH_QT6:BOOL=ON
@@ -929,7 +944,7 @@ if [ $QFtpServer -eq 1 ]; then
929944
fi
930945
cmake -E make_directory $BUILD_DEPEND_DIR/QFtpServer
931946
pushd $BUILD_DEPEND_DIR/QFtpServer
932-
cmake -S $SOURCE_DIR/QFtpServer -DCMAKE_BUILD_TYPE=Release \
947+
cmake -S $SOURCE_DIR/QFtpServer -DCMAKE_BUILD_TYPE=Release $CMAKE_PARA \
933948
-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
934949
-DCMAKE_VERBOSE_MAKEFILE=${BUILD_VERBOSE} \
935950
-DWITH_APP=OFF

‎Script/build_linux.sh‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ Environment variables:
9191
BUILD_VERBOSE Set verbose mode (ON/OFF, default: $BUILD_VERBOSE)
9292
QT_VERSION Set Qt version (default: $QT_VERSION)
9393
EOF
94+
echo ""
95+
detect_os_info
9496
exit 0
9597
}
9698

@@ -694,4 +696,35 @@ if [ $LINT -eq 1 ]; then
694696
./build_lint_check.sh
695697
fi
696698

699+
if is_termux; then
700+
echo_status "build in termux ......"
701+
702+
./build_depend.sh --system_update --base \
703+
--install=${INSTALL_DIR} \
704+
--source=${SOURCE_DIR} \
705+
--tools=${TOOLS_DIR} \
706+
--verbose=${BUILD_VERBOSE}
707+
708+
if [ -z "$RabbitCommon_ROOT" ]; then
709+
export RabbitCommon_ROOT=${SOURCE_DIR}/RabbitCommon
710+
fi
711+
# Disable ci warn
712+
if [ $CI ]; then
713+
git config --global --add safe.directory $REPO_ROOT
714+
git config --global --add safe.directory $RabbitCommon_ROOT
715+
fi
716+
717+
./build_depend.sh ${depend_para} \
718+
--rabbitcommon \
719+
--install=${INSTALL_DIR} \
720+
--source=${SOURCE_DIR} \
721+
--tools=${TOOLS_DIR} \
722+
--verbose=${BUILD_VERBOSE}
723+
724+
./build_termux.sh --install=${INSTALL_DIR} \
725+
--source=${SOURCE_DIR} \
726+
--tools=${TOOLS_DIR} \
727+
--verbose=${BUILD_VERBOSE}
728+
fi
729+
697730
popd

0 commit comments

Comments
 (0)