feat: flatpak and flutter build

This commit is contained in:
Kingtous 2022-09-08 18:21:17 +08:00
parent 1c170366e7
commit 2d93460873
9 changed files with 96 additions and 4 deletions

11
.gitignore vendored
View File

@ -21,7 +21,18 @@ sciter.dll
src/bridge_generated.rs
*deb
rustdesk
*.cache
# appimage
appimage/AppDir
appimage/*.AppImage
appimage/appimage-build
# flutter
flutter/linux/build/**
flutter/linux/cmake-build-debug/**
# flatpak
flatpak/.flatpak-builder/**
flatpak/ccache/**
flatpak/.flatpak-builder/build/**
flatpak/.flatpak-builder/shared-modules/**
flatpak/.flatpak-builder/shared-modules/*.tar.xz
flatpak/.flatpak-builder/debian-binary

2
Cargo.lock generated
View File

@ -4201,7 +4201,7 @@ dependencies = [
[[package]]
name = "rustdesk"
version = "1.1.10"
version = "1.2.0"
dependencies = [
"android_logger 0.11.1",
"arboard",

View File

@ -105,6 +105,7 @@ fn main() {
// there is problem with cfg(target_os) in build.rs, so use our workaround
// let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
// if target_os == "android" || target_os == "ios" {
#[cfg(feature = "flutter")]
gen_flutter_rust_bridge();
// return;
// }

31
flatpak/rustdesk.yml Normal file
View File

@ -0,0 +1,31 @@
app-id: org.rustdesk.rustdesk
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
command: rustdesk
modules:
# install appindicator
- shared-modules/libappindicator/libappindicator-gtk3-12.10.json
- name: rustdesk
buildsystem: simple
build-commands:
- bsdtar -zxvf rustdesk-1.2.0.deb
- tar -xvf ./data.tar.xz
- cp -r ./usr /app/
- rm /app/usr/bin/rustdesk
- mkdir -p /app/bin && ln -s /app/usr/lib/rustdesk/flutter_hbb /app/bin/rustdesk
sources:
# Note: replace to deb files with url
- type: file
path: ../rustdesk-1.2.0.deb
finish-args:
# X11 + XShm access
- --share=ipc
- --socket=x11
# Wayland access
- --socket=wayland
# Needs to talk to the network:
- --share=network
# Needs to save files locally
- --filesystem=xdg-documents

@ -0,0 +1 @@
Subproject commit cecc93886ce839ec49b0041f072a573327acdf08

33
flutter/PKGBUILD Normal file
View File

@ -0,0 +1,33 @@
pkgname=rustdesk
pkgver=1.2.0
pkgrel=0
epoch=
pkgdesc=""
arch=('x86_64')
url=""
license=('GPL-3.0')
groups=()
depends=('gtk3' 'xdotool' 'libxcb' 'libxfixes' 'alsa-lib' 'pulseaudio' 'ttf-arphic-uming' 'python-pip' 'curl' 'libappindicator-gtk3')
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=../pacman_install
changelog=
noextract=()
md5sums=() #generate with 'makepkg -g'
package() {
mkdir -p "${pkgdir}/usr/lib/rustdesk" && cp -r ${HBB}/build/linux/x64/release/bundle/* -t "${pkgdir}/usr/lib/rustdesk"
cp ${HBB}/build/linux/x64/release/liblibrustdesk.so "${pkgdir}/usr/lib/rustdesk/librustdesk.so"
mkdir -p "${pkgdir}/usr/bin"
pushd ${pkgdir} && ln -s /usr/lib/rustdesk/flutter_hbb usr/bin/rustdesk && popd
install -Dm 644 $HBB/rustdesk.service -t "${pkgdir}/usr/share/rustdesk/files"
install -Dm 644 $HBB/rustdesk.desktop -t "${pkgdir}/usr/share/rustdesk/files"
# install -Dm 644 $HBB/../pynput_service.py -t "${pkgdir}/usr/share/rustdesk/files"
install -Dm 644 $HBB/../128x128@2x.png "${pkgdir}/usr/share/rustdesk/files/rustdesk.png"
}

View File

@ -0,0 +1,15 @@
[Unit]
Description=RustDesk user service (--server)
[Service]
Type=simple
ExecStart=/usr/lib/rustdesk/flutter_hbb --server
PIDFile=/run/rustdesk.user.pid
KillMode=mixed
TimeoutStopSec=30
LimitNOFILE=100000
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target

View File

@ -39,7 +39,7 @@ use crate::ui_interface::{
mod cm;
#[cfg(feature = "inline")]
mod inline;
pub mod inline;
#[cfg(target_os = "macos")]
mod macos;
pub mod remote;

View File

@ -680,7 +680,7 @@ impl<T: InvokeUiSession> Session<T> {
pub fn get_chatbox(&self) -> String {
#[cfg(feature = "inline")]
return super::inline::get_chatbox();
return crate::ui::inline::get_chatbox();
#[cfg(not(feature = "inline"))]
return "".to_owned();
}