mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2024-12-28 01:49:26 +01:00
Update _index.en.md
This commit is contained in:
parent
2439c84df3
commit
bff3543bbd
@ -5,19 +5,19 @@ weight: 21
|
||||
|
||||
There are multiple ways to do this, this guide assumes that `Xcode`, `Git` and `Homebrew` are already installed.
|
||||
|
||||
The biggest challenge is probably to find versions of all the tools that work together, especially since parts of the toolchain like Xcode and LLVM are dictated by your macOS version. The versions used in this guide probably aren't what you should use. As a start to figure what versions to use is to look in the [GitHub build workflow](https://github.com/rustdesk/rustdesk/blob/master/.github/workflows/flutter-build.yml) for the RustDesk version you want to build (choose the tag for which to see the file in the upper left of the page), but that won't necessarily work because the macOS tools that comes with the GitHub runner might not be the same versions as those on your local system.
|
||||
The biggest challenge is probably to find versions of all the tools that work together, especially since parts of the toolchain like Xcode and LLVM are dictated by your macOS version. The versions used in this guide probably aren't what you should use. As a start to figure what versions to use is to look in the [GitHub build workflow](https://github.com/rustdesk/rustdesk/blob/master/.github/workflows/flutter-build.yml) for the RustDesk version you want to build. Choose the tag for which to see the file in the upper left of the page. But that won't necessarily work because the macOS tools that comes with the GitHub runner might not be the same versions as those on your local system.
|
||||
|
||||
#### Exports
|
||||
`export` is used to set various environmental variables. When you run `export`, that variable is set for the current terminal session only, and these must therefore be repeated for every new terminal window you want to use to build RustDesk, now and in the future. Generally, it's preferable to add all `export`s to a script that is executed automatically for every terminal that is opened, for example `~/.bash_profile`. The full `export` commands listed here can simply be appended to the file, but must also be run in the current terminal because the file isn't read until a *new* terminal is opened.
|
||||
#### Export
|
||||
`export` is used to set various environmental variables. When you run `export`, that variable is set for the current terminal session only, and these must therefore be repeated for every new terminal window you want to use to build RustDesk, now or in the future. Generally, it's preferable to add all `export`s to a script that is executed automatically for every terminal that is opened, for example `~/.bash_profile`. The full `export` commands listed here can simply be appended to the file, but must also be run in the current terminal because the file isn't read until a *new* terminal is opened.
|
||||
|
||||
### Install the tools we're going to use from Homebrew
|
||||
|
||||
```bash
|
||||
```sh
|
||||
brew install python3 create-dmg nasm cmake ggc wget ninja pkg-config wget rustup
|
||||
```
|
||||
Some of the installations might fail because some of the target folders don't exist on our system. In that case, create the folder, set owner and permissions and run the `brew` command again. Example if `/usr/local/include` doesn't exist:
|
||||
|
||||
```bash
|
||||
Some of the installations might fail because some of the target folders don't exist on our system. In that case, create the folder, set owner and permissions and run the `brew` command again. Example if `/usr/local/include` doesn't exist:
|
||||
```sh
|
||||
sudo mkdir /usr/local/include
|
||||
sudo chown <username>:admin /usr/local/include
|
||||
sudo chmod 775 /usr/local/include
|
||||
@ -26,7 +26,7 @@ sudo chmod 775 /usr/local/include
|
||||
### Install vcpkg
|
||||
Vcpkg is used to manage the C/C++ dependencies used by RustDesk. Decide where you want the installation and run the following from the folder in which you want the `vcpkg` folder to reside. In this example `/Users/<username>/repos/` is used as the location, and the tag `2023.04.15` is used as the version.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git clone https://github.com/microsoft/vcpkg
|
||||
cd vcpkg
|
||||
git checkout 2023.04.15
|
||||
@ -38,7 +38,7 @@ export VCPKG_ROOT=~/repos/vcpkg
|
||||
### Install and configure Rust
|
||||
We use `rustup` to manage Rust, which was already installed above using Homebrew. But, it still needs to be configured. Follow the instructions and make sure both `rustup` and `rustc` are on the `PATH`. In this example we use Rust version `1.75.0`, but you might need to use a different version. You can install and manage multiple versions of Rust with `rustup`.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
rustup-init
|
||||
rustup default 1.75.0
|
||||
rustup component add rustfmt
|
||||
@ -49,25 +49,26 @@ For an overview over installed and default Rust toolchains, run `rustup show`.
|
||||
|
||||
Decide where you want the RustDesk source files and run the following from the folder in which you want the `rustdesk` folder to reside. In this example `/Users/<username>/repos/` is used as the location.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git clone https://github.com/rustdesk/rustdesk
|
||||
cd rustdesk/libs/portable/
|
||||
python3 -m pip install --upgrade pip
|
||||
pip3 install -r requirements.txt
|
||||
```
|
||||
If `python3` or `pip` is unknown, add them to the `PATH` with something like (use your actual folder names):
|
||||
|
||||
```bash
|
||||
If `python3` or `pip` is unknown, add them to the `PATH` with something like (use your actual folder names):
|
||||
```sh
|
||||
export PATH=~/Library/Python/3.9/bin:$PATH
|
||||
```
|
||||
Once that's done (remember to also edit `~/.bash_profile`), run the failed command(s) again.
|
||||
Once that's done, run the failed command(s) again. Remember to also edit `~/.bash_profile`.
|
||||
|
||||
### Install user interface components
|
||||
RustDesk can be built both using [Sciter](https://sciter.com/) and [Flutter](https://flutter.dev/). Both of these need additional components, so follow the steps for the relevant version, or both.
|
||||
|
||||
#### Sciter
|
||||
|
||||
From the `rustdesk` folder, run:
|
||||
```bash
|
||||
```sh
|
||||
wget https://github.com/c-smile/sciter-sdk/raw/master/bin.osx/libsciter.dylib
|
||||
```
|
||||
|
||||
@ -75,33 +76,33 @@ wget https://github.com/c-smile/sciter-sdk/raw/master/bin.osx/libsciter.dylib
|
||||
|
||||
[FVM](https://fvm.app/) lets you manage which version of Flutter is used, and is probably the easiest way to be able to easily try different Flutter versions.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
brew tap leoafarias/fvm
|
||||
brew install fvm cocoapods
|
||||
```
|
||||
Install and use, for example Flutter `3.16.9`, with:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
fvm global 3.16.9
|
||||
```
|
||||
FVM is meant to use a more complex setup where it can provide different Flutter versions for different projects, but that's beyond the scope of this guide. Instead, simply add the location of the default Flutter provided by FVM to your `PATH` manually, which means that you must use `fvm global` to switch Flutter version:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
export PATH=$HOME/fvm/default/bin:$PATH
|
||||
```
|
||||
|
||||
Once that is done, you should disable telemetry and check if everything is OK:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
flutter --disable-analytics
|
||||
dart --disable-analytics
|
||||
flutter doctor -v
|
||||
```
|
||||
It doesn't matter if some of the checks fail, they usually will, what's important is that the check for the environment you intend to use is OK, namely "Xcode". If there are problems reported, address them before moving forward.
|
||||
It doesn't matter if some of the checks fail, they usually will, what's important is that the check for the environment you intend to use is OK, namely `Xcode`. If there are problems reported, address them before moving forward.
|
||||
|
||||
Once Flutter is up and running, it's time to install the "bridge" that binds Rust and Flutter together. Here is another one of the versions that much work together with everything else, in this example we use `1.80.1`:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
cargo install flutter_rust_bridge_codegen --version "1.80.1" --features "uuid"
|
||||
```
|
||||
|
||||
@ -109,13 +110,13 @@ cargo install flutter_rust_bridge_codegen --version "1.80.1" --features "uuid"
|
||||
|
||||
Build from the `rustdesk` folder. Build the Sciter version with:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
python3 ./build.py
|
||||
```
|
||||
|
||||
Build the Flutter version with:
|
||||
```bash
|
||||
```sh
|
||||
flutter_rust_bridge_codegen --rust-input ./src/flutter_ffi.rs --dart-output ./flutter/lib/generated_bridge.dart --c-output ./flutter/macos/Runner/bridge_generated.h
|
||||
python3 ./build.py --flutter
|
||||
```
|
||||
If everything goes well, you should now have a `dmg`file ready to install in your `rustdesk` folder.
|
||||
If everything goes well, you should now have a `dmg` file ready to install in your `rustdesk` folder.
|
||||
|
Loading…
Reference in New Issue
Block a user