Merge pull request #3998 from Kingtous/master
fix: move linux_headless to a new option
This commit is contained in:
commit
6eb7e09b1a
26
.github/workflows/flutter-build.yml
vendored
26
.github/workflows/flutter-build.yml
vendored
@ -545,19 +545,22 @@ jobs:
|
||||
arch: x86_64,
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-20.04,
|
||||
extra-build-features: "linux_headless",
|
||||
extra-build-features: "",
|
||||
enable-headless: true
|
||||
}
|
||||
- {
|
||||
arch: x86_64,
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-20.04,
|
||||
extra-build-features: "flatpak",
|
||||
enable-headless: false
|
||||
}
|
||||
- {
|
||||
arch: x86_64,
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-20.04,
|
||||
extra-build-features: "appimage",
|
||||
enable-headless: false
|
||||
}
|
||||
# - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
|
||||
steps:
|
||||
@ -681,7 +684,11 @@ jobs:
|
||||
x86_64)
|
||||
# no need mock on x86_64
|
||||
export VCPKG_ROOT=/opt/artifacts/vcpkg
|
||||
cargo build --lib --features hwcodec,flutter,flutter_texture_render,${{ matrix.job.extra-build-features }} --release
|
||||
export DEFAULT_FEAT=""
|
||||
if ${{ matrix.job.enable-headless }}; then
|
||||
export DEFAULT_FEAT=linux_headless
|
||||
fi
|
||||
cargo build --lib --features hwcodec,flutter,flutter_texture_render,${{ matrix.job.extra-build-features }},$DEFAULT_FEAT --release
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -706,6 +713,7 @@ jobs:
|
||||
os: ubuntu-20.04, # just for naming package, not running host
|
||||
use-cross: true,
|
||||
extra-build-features: "",
|
||||
enable-headless: true
|
||||
}
|
||||
- {
|
||||
arch: aarch64,
|
||||
@ -713,6 +721,7 @@ jobs:
|
||||
os: ubuntu-20.04, # just for naming package, not running host
|
||||
use-cross: true,
|
||||
extra-build-features: "appimage",
|
||||
enable-headless: false
|
||||
}
|
||||
# - { arch: aarch64, target: aarch64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true, extra-build-features: "flatpak" }
|
||||
# - {
|
||||
@ -839,7 +848,11 @@ jobs:
|
||||
# start build
|
||||
pushd /workspace
|
||||
export VCPKG_ROOT=/opt/artifacts/vcpkg
|
||||
cargo build --lib --features flutter,${{ matrix.job.extra-build-features }} --release
|
||||
export DEFAULT_FEAT=""
|
||||
if ${{ matrix.job.enable-headless }}; then
|
||||
export DEFAULT_FEAT=linux_headless
|
||||
fi
|
||||
cargo build --lib --features flutter,${{ matrix.job.extra-build-features }},$DEFAULT_FEAT --release
|
||||
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@master
|
||||
@ -863,6 +876,7 @@ jobs:
|
||||
os: ubuntu-latest,
|
||||
use-cross: true,
|
||||
extra-build-features: "",
|
||||
enable-headless: true
|
||||
}
|
||||
# - { arch: armv7, target: armv7-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true, extra-build-features: "appimage" }
|
||||
# - { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true }
|
||||
@ -968,7 +982,11 @@ jobs:
|
||||
python3 ./res/inline-sciter.py
|
||||
export VCPKG_ROOT=/opt/artifacts/vcpkg
|
||||
export ARCH=armhf
|
||||
cargo build --features inline --release --bins
|
||||
export DEFAULT_FEAT=""
|
||||
if ${{ matrix.job.enable-headless }}; then
|
||||
export DEFAULT_FEAT=linux_headless
|
||||
fi
|
||||
cargo build --features inline,${{ matrix.job.extra-build-features }},$DEFAULT_FEAT --release --bins
|
||||
# package
|
||||
mkdir -p ./Release
|
||||
mv ./target/release/rustdesk ./Release/rustdesk
|
||||
|
@ -7,7 +7,7 @@ arch=('x86_64')
|
||||
url=""
|
||||
license=('AGPL-3.0')
|
||||
groups=()
|
||||
depends=('gtk3' 'xdotool' 'libxcb' 'libxfixes' 'alsa-lib' 'curl' 'libva' 'libvdpau' 'libappindicator-gtk3', 'pam')
|
||||
depends=('gtk3' 'xdotool' 'libxcb' 'libxfixes' 'alsa-lib' 'curl' 'libva' 'libvdpau' 'libappindicator-gtk3' 'pam')
|
||||
makedepends=()
|
||||
checkdepends=()
|
||||
optdepends=()
|
||||
|
10
src/api.rs
10
src/api.rs
@ -1,8 +1,10 @@
|
||||
use std::ffi::c_char;
|
||||
|
||||
use crate::plugins::PLUGIN_REGISTRAR;
|
||||
|
||||
// API provided by RustDesk.
|
||||
pub type LoadPluginFunc = fn(*const i8) -> i32;
|
||||
pub type UnloadPluginFunc = fn(*const i8) -> i32;
|
||||
pub type LoadPluginFunc = fn(*const c_char) -> i32;
|
||||
pub type UnloadPluginFunc = fn(*const c_char) -> i32;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct RustDeskApiTable {
|
||||
@ -11,12 +13,12 @@ pub struct RustDeskApiTable {
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn load_plugin(path: *const i8) -> i32 {
|
||||
fn load_plugin(path: *const c_char) -> i32 {
|
||||
PLUGIN_REGISTRAR.load_plugin(path)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn unload_plugin(path: *const i8) -> i32 {
|
||||
fn unload_plugin(path: *const c_char) -> i32 {
|
||||
PLUGIN_REGISTRAR.unload_plugin(path)
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ pub struct PluginRegistar<P: Plugin> {
|
||||
}
|
||||
|
||||
impl<P: Plugin> PluginRegistar<P> {
|
||||
pub fn load_plugin(&self, path: *const i8) -> i32 {
|
||||
pub fn load_plugin(&self, path: *const c_char) -> i32 {
|
||||
let p = unsafe { CStr::from_ptr(path) };
|
||||
let lib_path = p.to_str().unwrap_or("").to_owned();
|
||||
let lib = unsafe { libloading::Library::new(lib_path.as_str()) };
|
||||
@ -100,7 +100,7 @@ impl<P: Plugin> PluginRegistar<P> {
|
||||
-1
|
||||
}
|
||||
|
||||
pub fn unload_plugin(&self, path: *const i8) -> i32 {
|
||||
pub fn unload_plugin(&self, path: *const c_char) -> i32 {
|
||||
let p = unsafe { CStr::from_ptr(path) };
|
||||
let lib_path = p.to_str().unwrap_or("").to_owned();
|
||||
match PLUGIN_REGISTRAR.plugins.write().unwrap().remove(&lib_path) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user