Kylin-Feiteng Kylin-V4 desktop arm64 system statically compiles QT

1. System specific version:

 

2. Because the source of this version is very old, you need to modify the source of the version to update various software normally, otherwise, you will not even be able to open the Kylin Store.

sudo vi /etc/apt/sources.list

Select the source address of the corresponding version of your system: 

#4.0.2桌面版本:
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 4.0.2-desktop main restricted universe multiverse

#4.0.2-sp1桌面版本:
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 4.0.2sp1-desktop main restricted universe multiverse

#4.0.2-sp2桌面版本:
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 4.0.2sp2-desktop main restricted universe multiverse

#4.0.2服务器版本:
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 4.0.2-server main restricted universe multiverse

#4.0.2-sp1服务器版本:
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 4.0.2sp1-server main restricted universe multiverse

#4.0.2-sp2服务器版本:
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 4.0.2sp2-server main restricted universe multiverse

#4.0.2-sp2 FT2000+服务器版本:
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 4.0.2sp2-server-ft2000 main restricted universe multiverse

#4.0.2-sp3桌面版本:
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 4.0.2sp3-desktop main restricted universe multiverse

After changing: 

 Then restart the computer.

3. Compile the QT source code:

Before compiling, because qt will use openssl. We need to determine the version of openssl:

Type openssl version

openssl version

 

If your version is not above 1.1.0, you need to upgrade the openssl version:

Uninstall the original version first:

sudo apt-get remove openssl

 

 Download the openssl source code:

wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1d.tar.gz

Unzip the compressed package:

tar -zxvf openssl-1.1.1d.tar.gz

 Go to the folder:

cd openssl-1.1.1d

Execute compilation:

sudo ./config

 

Then execute compilation:

sudo make && make install

 Wait for compilation to complete.

Enter openssl version to view the version

Qt source code download address: https://download.qt.io/archive/qt/

I downloaded version 5.12.10: https://download.qt.io/archive/qt/5.12/5.12.10/single/qt-everywhere-src-5.12.10.tar.xz https://download. qt.io/archive/qt/5.12/5.12.10/single/qt-everywhere-src-5.12.10.tar.xz

First install the necessary dependencies:

sudo apt-get install bison build-essential gperf flex ruby python libasound2-dev libbz2-dev libcap-dev libcups2-dev libdrm-dev libegl1-mesa-dev libnss3-dev libpci-dev libpulse-dev libudev-dev libxtst-dev gyp ninja-build libglu1-mesa-dev libfontconfig1-dev libx11-xcb-dev libicu-dev libxkbcommon-x11-dev python3 libxcb-xfixes0-dev libqt5serialport5 libqt5serialport5-dev libgl1-mesa-dev freeglut3-dev aptitude -y

download:

wget https://download.qt.io/archive/qt/5.12/5.12.10/single/qt-everywhere-src-5.12.10.tar.xz 

Execute decompression:

tar -xvf qt-everywhere-src-5.12.10.tar.xz

Go to the folder:

cd qt-everywhere-src-5.12.10

 Create the file autoConfigure.sh

vim autoConfigure.sh

Then there are basic commands for manipulating text under linux, press i to change to insert state and paste the following code:

#! /bin/bash
 
QT_INSTALL_PATH="-prefix /root/qt/qt_5.12.10"     #你的Qt保存路径(自己修改)
QT_COMPLIER+="-platform linux-aarch64-gnu-g++"  #编译器-这里选择arm编译
 
CONFIG_PARAM+="-static "               #静态编译
CONFIG_PARAM+="-release "              #编译release
CONFIG_PARAM+="-nomake examples "      #不编译examples
CONFIG_PARAM+="-nomake tests "         #不编译tests
 
CONFIG_PARAM+="-qt-xcb "
 
#选择Qt版本(开源, 商业), 并自动确认许可认证
CONFIG_PARAM+="-opensource "           #编译开源版本, -commercial商业版本
CONFIG_PARAM+="-confirm-license "      #自动确认许可认证
 
echo "./configure $CONFIG_PARAM $QT_COMPLIER $QT_INSTALL_PATH"
 
./configure $CONFIG_PARAM $QT_COMPLIER $QT_INSTALL_PATH

Press ESC to exit the editing state, and enter :wq to save the file.

Then modify the file permissions :

sudo chmod -R 777 autoConfigure.sh

Execute the script file:

sudo ./autoConfigure.sh

Wait for execution to complete, success if no Error, warnings can be ignored.

If ERR is generated, copy the error message and Baidu search to solve it.

After the configuration is complete, execute sudo make -j4 to start compiling (the -j4 parameter can be modified or removed), and wait for the compilation to complete.

sudo make -j4

After the compilation is complete, execute sudo make install to install:

sudo make install

If no exception occurs, the generated static compilation file is in:

QT_INSTALL_PATH="-prefix  /xxxxxxx/xxxxx " #Your Qt save path (modify yourself)

under this path.

5. After starting qtcreator, configure the compilation environment: 3-Select the static path /xxxxxxx/xxxxx you saved 

 

After adding, remember to click the Apply button to save the configuration.

Then you can open your project to compile, just select the package you added.

Guess you like

Origin blog.csdn.net/u012402739/article/details/131675469