doc.rustdesk.com/content/dev/build/linux/_index.en.md

89 lines
2.6 KiB
Markdown
Raw Normal View History

2022-04-12 06:43:15 +02:00
---
title: Linux
weight: 10
---
2023-10-21 21:46:08 +02:00
### Dependencies
2022-04-12 06:43:15 +02:00
2023-07-15 21:50:12 +02:00
Desktop versions use [Sciter](https://sciter.com/) for GUI, please download Sciter dynamic library yourself.
2022-04-12 06:43:15 +02:00
[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) |
2023-07-14 15:14:05 +02:00
[macOS](https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.osx/libsciter.dylib)
2022-04-12 06:43:15 +02:00
2023-10-21 21:46:08 +02:00
### Raw steps to build
2022-04-12 06:43:15 +02:00
- Prepare your Rust development env and C++ build env
2023-10-21 21:46:08 +02:00
- Install [vcpkg](https://github.com/microsoft/vcpkg) and set `VCPKG_ROOT` env variable correctly
2022-04-12 06:43:15 +02:00
2023-08-31 21:53:25 +02:00
- Windows: `vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static opus:x64-windows-static aom:x64-windows-static`
- Linux/macOS: `vcpkg install libvpx libyuv opus aom`
2022-04-12 06:43:15 +02:00
2023-08-31 21:53:25 +02:00
- Run `cargo run`
2022-04-12 06:43:15 +02:00
2023-10-21 21:46:08 +02:00
### How to build on Linux
2022-04-12 06:43:15 +02:00
2023-10-21 21:46:08 +02:00
#### Ubuntu 18 (Debian 10)
2022-04-12 06:43:15 +02:00
```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
```
2023-10-21 21:46:08 +02:00
#### Fedora 28 (CentOS 8)
2022-04-12 06:43:15 +02:00
```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
```
2023-10-23 22:01:24 +02:00
#### Arch Linux (Manjaro)
2022-04-12 06:43:15 +02:00
```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
```
2023-10-21 21:46:08 +02:00
#### Install vcpkg
2022-04-12 06:43:15 +02:00
```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
```
2023-10-21 21:46:08 +02:00
#### Fix libvpx (for Fedora)
2022-04-12 06:43:15 +02:00
```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
```
2023-10-21 21:46:08 +02:00
#### Build
2022-04-12 06:43:15 +02:00
```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
VCPKG_ROOT=$HOME/vcpkg cargo run
```
2023-10-21 21:46:08 +02:00
#### Change Wayland to X11 (Xorg)
2022-04-12 06:43:15 +02:00
2023-09-04 23:57:47 +02:00
~~RustDesk does not support Wayland.~~ Check this [guide](https://docs.fedoraproject.org/en-US/quick-docs/configuring-xorg-as-default-gnome-session/) to configuring Xorg as the default GNOME session.
RustDesk now has experimental Wayland support. You may need to download the [nightly version](https://github.com/rustdesk/rustdesk/releases/tag/nightly) to enable this feature.
2023-10-21 21:46:08 +02:00