2022-04-12 06:43:15 +02:00
|
|
|
|
---
|
|
|
|
|
title: Linux
|
|
|
|
|
weight: 10
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 依賴
|
|
|
|
|
|
|
|
|
|
桌面版本界面使用[sciter](https://sciter.com/), 請自行下載。
|
|
|
|
|
|
|
|
|
|
[Windows](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.win/x64/sciter.dll) |
|
|
|
|
|
[Linux](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so) |
|
|
|
|
|
[macOS](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.osx/libsciter.dylib)
|
|
|
|
|
|
|
|
|
|
## 基本構建步驟
|
|
|
|
|
|
|
|
|
|
- 請準備好 Rust 開發環境和 C++編譯環境
|
|
|
|
|
|
|
|
|
|
- 安裝[vcpkg](https://github.com/microsoft/vcpkg), 正確設置`VCPKG_ROOT`環境變量
|
|
|
|
|
|
2023-05-21 12:56:24 +02:00
|
|
|
|
- Windows: vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static aom:x64-windows-static
|
|
|
|
|
- Linux/Osx: vcpkg install libvpx libyuv opus aom
|
2022-04-12 06:43:15 +02:00
|
|
|
|
|
|
|
|
|
- 運行 `cargo run`
|
|
|
|
|
|
|
|
|
|
## 在 Linux 上編譯
|
|
|
|
|
|
|
|
|
|
### Ubuntu 18 (Debian 10)
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
sudo apt install -y g++ gcc git curl wget nasm yasm libgtk-3-dev clang libxcb-randr0-dev libxdo-dev libxfixes-dev libxcb-shape0-dev libxcb-xfixes0-dev libasound2-dev libpulse-dev cmake
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Fedora 28 (CentOS 8)
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
sudo yum -y install gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel cmake alsa-lib-devel
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Arch (Manjaro)
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
sudo pacman -Syu --needed unzip git cmake gcc curl wget yasm nasm zip make pkg-config clang gtk3 xdotool libxcb libxfixes alsa-lib pulseaudio
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 安裝 vcpkg
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
git clone https://github.com/microsoft/vcpkg
|
|
|
|
|
cd vcpkg
|
2023-05-21 12:56:24 +02:00
|
|
|
|
git checkout 2023.04.15
|
2022-04-12 06:43:15 +02:00
|
|
|
|
cd ..
|
|
|
|
|
vcpkg/bootstrap-vcpkg.sh
|
|
|
|
|
export VCPKG_ROOT=$HOME/vcpkg
|
2023-05-21 12:56:24 +02:00
|
|
|
|
vcpkg/vcpkg install libvpx libyuv opus aom
|
2022-04-12 06:43:15 +02:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 修復 libvpx (僅僅針對 Fedora)
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
cd vcpkg/buildtrees/libvpx/src
|
|
|
|
|
cd *
|
|
|
|
|
./configure
|
|
|
|
|
sed -i 's/CFLAGS+=-I/CFLAGS+=-fPIC -I/g' Makefile
|
|
|
|
|
sed -i 's/CXXFLAGS+=-I/CXXFLAGS+=-fPIC -I/g' Makefile
|
|
|
|
|
make
|
|
|
|
|
cp libvpx.a $HOME/vcpkg/installed/x64-linux/lib/
|
|
|
|
|
cd
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 構建
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
|
|
|
source $HOME/.cargo/env
|
|
|
|
|
git clone https://github.com/rustdesk/rustdesk
|
|
|
|
|
cd rustdesk
|
|
|
|
|
mkdir -p target/debug
|
|
|
|
|
wget https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so
|
|
|
|
|
mv libsciter-gtk.so target/debug
|
|
|
|
|
cargo run
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 把 Wayland 修改成 X11 (Xorg)
|
|
|
|
|
|
|
|
|
|
RustDesk 暫時不支持 Wayland,不過正在積極開發中.
|
|
|
|
|
請查看[this](https://docs.fedoraproject.org/en-US/quick-docs/configuring-xorg-as-default-gnome-session/)配置 X11.
|