Le Tan 1 год назад
Родитель
Сommit
b0428dd0de
2 измененных файлов с 27 добавлено и 127 удалено
  1. 14 63
      en_us/docs/Developers/Build VNote.md
  2. 13 64
      zh_cn/docs/开发者/构建VNote.md

+ 14 - 63
en_us/docs/Developers/Build VNote.md

@@ -1,5 +1,5 @@
 # Build VNote
-You need **Qt 5.15** and above to build VNote from source.
+You need **Qt 6.5** and above, and CMake to build VNote from source.
 
 ## Get the Source Code of VNote
 VNote's source code is available on [GitHub](https://github.com/vnotex/vnote). You could download the ZIP archive of the code. Please be aware of that VNote depends on some submodules, so you should also download the source codes of these modules.
@@ -12,97 +12,48 @@ cd vnote.git
 git submodule update --init --recursive
 ```
 
-## Get Qt 5.15
-You could get the standalone Qt SDK from [Qt Downloads](http://info.qt.io/download-qt-for-application-development). For users in China, you could speed up the download via the [TUNA Mirrors](https://mirrors4.tuna.tsinghua.edu.cn/qt/official_releases/qt/5.15/).
+## Get Qt6
+You could get the standalone Qt SDK from [Qt Downloads](http://info.qt.io/download-qt-for-application-development).
 
 ## Windows
-On Windows, you need **Visual Studio 2015** or above to compile VNote (Mingw is **not** supported).
+On Windows, you need **Visual Studio 2019** or above to compile VNote (Mingw is **not** supported).
 
-Open **Qt Creator** and open `vnote.git\vnote.pro` as project. Now you are ready to tune and compile VNote!
+Open **Qt Creator** and open `vnote.git\CMakeLists.txt` as project. Now you are ready to tune and compile VNote!
 
 ## Linux
-In Ubuntu, you could get Qt 5.15 from PPA like this:
-
-```sh
-sudo add-apt-repository ppa:beineri/opt-qt-5.15.10-bionic -y
-sudo apt-get update -qq
-sudo apt-get -y install qt512base qt512webengine
-sudo apt-get -y install qt512webchannel qt512svg qt512location qt512tools qt512translations
-source /opt/qt*/bin/qt*-env.sh
-```
-
-Then compile and install VNote like this:
+For detailed steps, please refer to the [CI script](https://github.com/vnotex/vnote/blob/master/.github/workflows/ci-linux.yml).
 
 ```sh
 cd vnote.git
 mkdir build
 cd build
-qmake ../vnote.pro
-make
+cmake ..
+cmake --build .
 sudo make install
 ```
 
-### Fcitx
-If you use **Fcitx** as the input method, you need to copy the missing library `libfcitxplatforminputcontextplugin.so` to Qt's plugin directory.
-
-To find the place of `libfcitxplatforminputcontextplugin.so`, you could execute:
-
-```sh
-fcitx-diagnose | grep libfcitxplatforminputcontextplugin.so
-```
-
-If there is no such lib, you may need to install and configure Fcitx for Qt5 correctly before continue.
-
-Then you need to copy the lib to Qt's plugin directory:
-
-```
-<path_to_Qt_installation_directory>/5.15.2/gcc_64/plugins/platforminputcontexts/
-```
-
-### OpenSSL
-After the installation of openSSL, you could find two lib files:
-
-```
-/usr/lib/libcrypto.so.1.0.0
-/usr/lib/libssl.so.1.0.0
-```
-
-Copy these two files to Qt's library directory:
-
-```
-<path_to_Qt_installation_directory>/5.15.2/gcc_64/lib/
-```
-
-In Qt's library directory, create symlinks for these two files:
-
-```sh
-ln -s libcrypto.so.1.0.0 libcrypto.so
-ln -s libssl.so.1.0.0 libssl.so
-```
-
 ## MacOS
 If you prefer command line on macOS, you could follow these steps.
 
 1. Install Xcode and Homebrew;
-2. Install Qt 5.15.2 via Homebrew:
+2. Install Qt6 via Homebrew:
 
     ```
-    brew install qt@5.15.2
+    brew install [email protected]
     ```
 
 3. In the project directory, create `build_macos.sh` like this:
 
     ```sh
-    QTDIR="/usr/local/opt/qt@5.15.2"
+    QTDIR="/usr/local/opt/[email protected]"
     PATH="$QTDIR/bin:$PATH"
     LDFLAGS=-L$QTDIR/lib
     CPPFLAGS=-I$QTDIR/include
 
     mkdir -p build
     cd build
-    qmake -v
-    qmake CONFIG-=debug CONFIG+=release ../vnote.pro
-    make -j2
+    cmake ..
+    cmake --build . --target pack
     ```
 
 4. Make `build_macos.sh` executable and run it:
@@ -112,4 +63,4 @@ If you prefer command line on macOS, you could follow these steps.
     ./build_macos.sh
     ```
 
-5. Now you got the bundle `path/to/project/build/src/vnote.app`.
+5. Now you got the bundle `path/to/project/build/src/VNote.dmg`.

+ 13 - 64
zh_cn/docs/开发者/构建VNote.md

@@ -1,5 +1,5 @@
 # 构建VNote
-您需要**Qt 5.15**或以上版本才能从源代码创建VNote。
+您需要**Qt 6.5**或以上版本才能从源代码创建VNote。
 
 ## 获取VNote的源代码
 VNote的源代码可在[GitHub](https://github.com/vnotex/vnote)上获取。您可以下载代码的ZIP存档。请注意,VNote依赖于某些子模块,因此您还应该下载这些模块的源代码。
@@ -12,76 +12,26 @@ cd vnote.git
 git submodule update --init --recursive
 ```
 
-## 获取Qt 5.15
-您可以从[Qt Downloads](http://info.qt.io/download-qt-for-application-development)获取完整的Qt SDK。对于中国大陆用户,您可以通过[TUNA镜像](https://mirrors4.tuna.tsinghua.edu.cn/qt/official_releases/qt/5.15/)加快下载速度。
+## 获取Qt6
+您可以从[Qt Downloads](http://info.qt.io/download-qt-for-application-development)获取完整的Qt SDK。
 
 ## Windows
-在Windows上,您需要**Visual Studio 2015**或更高版本来编译VNote(Mingw**不**受支持)。
+在Windows上,您需要**Visual Studio 2019**或更高版本来编译VNote(Mingw**不**受支持)。
 
-打开**Qt Creator**并打开`vnote.git\vnote.pro`作为项目。现在您已准备好调整和编译VNote!
+打开**Qt Creator**并打开`vnote.git\CMakeLists.txt`作为项目。现在您已准备好调整和编译VNote!
 
 ## Linux
-在Ubuntu中,你可以像这样从PPA获得Qt 5.15:
-
-```sh
-sudo add-apt-repository ppa:beineri/opt-qt5.15.2-bionic -y
-sudo apt-get update -qq
-sudo apt-get -y install qt512base qt512webengine
-sudo apt-get -y install qt512webchannel qt512svg qt512location qt512tools qt512translations
-source /opt/qt*/bin/qt*-env.sh
-```
-
-然后像这样编译和安装VNote:
+详细步骤,请参考[持续构建脚本](https://github.com/vnotex/vnote/blob/master/.github/workflows/ci-linux.yml)。
 
 ```sh
 cd vnote.git
 mkdir build
 cd build
-qmake ../vnote.pro
-make
+cmake ..
+cmake --build .
 sudo make install
 ```
 
-### Fcitx
-如果您使用**Fcitx**作为输入方式,则需要将缺少的库`libfcitxplatforminputcontextplugin.so`复制到Qt的插件目录。
-
-要找到`libfcitxplatforminputcontextplugin.so`的位置,您可以执行:
-
-```sh
-fcitx-diagnose | grep libfcitxplatforminputcontextplugin.so
-```
-
-如果没有这样的库,您可能需要在继续之前为Qt5正确安装和配置Fcitx。
-
-然后您需要将库文件复制到Qt的插件目录:
-
-```
-<path_to_Qt_installation_directory>/5.15.2/gcc_64/plugins/platforminputcontexts/
-```
-
-### OpenSSL
-VNote需要**openSSL 1.0**以实现联网。
-
-安装openSSL后,您可以找到两个库文件:
-
-```
-/usr/lib/libcrypto.so.1.0.0
-/usr/lib/libssl.so.1.0.0
-```
-
-将这两个文件复制到Qt的库目录中:
-
-```
-<path_to_Qt_installation_directory>/5.15.2/gcc_64/lib/
-```
-
-在Qt的库目录中,为这两个文件创建符号链接:
-
-```sh
-ln -s libcrypto.so.1.0.0 libcrypto.so
-ln -s libssl.so.1.0.0 libssl.so
-```
-
 ## MacOS
 如果您更喜欢macOS上的命令行操作方式,则可以按照以下步骤操作。
 
@@ -89,22 +39,21 @@ ln -s libssl.so.1.0.0 libssl.so
 2. 通过Homebrew安装Qt:
 
     ```
-    brew install qt@5.15.2
+    brew install qt@6.5.3
     ```
 
 3. 在项目目录中,像下面那样创建`build_macos.sh`:
 
     ```sh
-    QTDIR="/usr/local/opt/qt@5.15.2"
+    QTDIR="/usr/local/opt/qt@6.5.3"
     PATH="$QTDIR/bin:$PATH"
     LDFLAGS=-L$QTDIR/lib
     CPPFLAGS=-I$QTDIR/include
 
     mkdir -p build
     cd build
-    qmake -v
-    qmake CONFIG-=debug CONFIG+=release ../vnote.pro
-    make -j2
+    cmake ..
+    cmake --build . --target pack
     ```
 
 4. 使`build_macos.sh`可执行并运行它:
@@ -114,4 +63,4 @@ ln -s libssl.so.1.0.0 libssl.so
     ./build_macos.sh
     ```
 
-5. 现在你得到了bundle路径`path/to/project/build/src/vnote.app`。
+5. 现在你得到了bundle `path/to/project/build/src/VNote.dmg`。