mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-11 10:26:19 +02:00
fix one flatpak feature missing
This commit is contained in:
parent
d18810b612
commit
b5f6a9c91a
4 changed files with 16 additions and 30 deletions
|
@ -20,8 +20,6 @@ path = "src/naming.rs"
|
||||||
inline = []
|
inline = []
|
||||||
cli = []
|
cli = []
|
||||||
flutter_texture_render = []
|
flutter_texture_render = []
|
||||||
appimage = []
|
|
||||||
flatpak = []
|
|
||||||
use_samplerate = ["samplerate"]
|
use_samplerate = ["samplerate"]
|
||||||
use_rubato = ["rubato"]
|
use_rubato = ["rubato"]
|
||||||
use_dasp = ["dasp"]
|
use_dasp = ["dasp"]
|
||||||
|
|
14
build.py
14
build.py
|
@ -134,16 +134,6 @@ def make_parser():
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='Build with unix file copy paste feature'
|
help='Build with unix file copy paste feature'
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
|
||||||
'--flatpak',
|
|
||||||
action='store_true',
|
|
||||||
help='Build rustdesk libs with the flatpak feature enabled'
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
'--appimage',
|
|
||||||
action='store_true',
|
|
||||||
help='Build rustdesk libs with the appimage feature enabled'
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--skip-cargo',
|
'--skip-cargo',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
|
@ -296,10 +286,6 @@ def get_features(args):
|
||||||
features.append('flutter')
|
features.append('flutter')
|
||||||
if not args.disable_flutter_texture_render:
|
if not args.disable_flutter_texture_render:
|
||||||
features.append('flutter_texture_render')
|
features.append('flutter_texture_render')
|
||||||
if args.flatpak:
|
|
||||||
features.append('flatpak')
|
|
||||||
if args.appimage:
|
|
||||||
features.append('appimage')
|
|
||||||
if args.unix_file_copy_paste:
|
if args.unix_file_copy_paste:
|
||||||
features.append('unix-file-copy-paste')
|
features.append('unix-file-copy-paste')
|
||||||
if windows:
|
if windows:
|
||||||
|
|
|
@ -57,7 +57,6 @@ tokio-native-tls ="0.3"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
quic = []
|
quic = []
|
||||||
flatpak = []
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
protobuf-codegen = { version = "3.4" }
|
protobuf-codegen = { version = "3.4" }
|
||||||
|
|
|
@ -223,8 +223,19 @@ pub fn run_cmds_trim_newline(cmds: &str) -> ResultType<String> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "flatpak"))]
|
|
||||||
fn run_loginctl(args: Option<Vec<&str>>) -> std::io::Result<std::process::Output> {
|
fn run_loginctl(args: Option<Vec<&str>>) -> std::io::Result<std::process::Output> {
|
||||||
|
if std::env::var("FLATPAK_ID").is_ok() {
|
||||||
|
let mut l_args = String::from("loginctl");
|
||||||
|
if let Some(a) = args {
|
||||||
|
l_args = format!("{} {}", l_args, a.join(" "));
|
||||||
|
}
|
||||||
|
let res = std::process::Command::new("flatpak-spawn")
|
||||||
|
.args(vec![String::from("--host"), l_args])
|
||||||
|
.output();
|
||||||
|
if res.is_ok() {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
let mut cmd = std::process::Command::new("loginctl");
|
let mut cmd = std::process::Command::new("loginctl");
|
||||||
if let Some(a) = args {
|
if let Some(a) = args {
|
||||||
return cmd.args(a).output();
|
return cmd.args(a).output();
|
||||||
|
@ -232,17 +243,6 @@ fn run_loginctl(args: Option<Vec<&str>>) -> std::io::Result<std::process::Output
|
||||||
cmd.output()
|
cmd.output()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "flatpak")]
|
|
||||||
fn run_loginctl(args: Option<Vec<&str>>) -> std::io::Result<std::process::Output> {
|
|
||||||
let mut l_args = String::from("loginctl");
|
|
||||||
if let Some(a) = args {
|
|
||||||
l_args = format!("{} {}", l_args, a.join(" "));
|
|
||||||
}
|
|
||||||
std::process::Command::new("flatpak-spawn")
|
|
||||||
.args(vec![String::from("--host"), l_args])
|
|
||||||
.output()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// forever: may not work
|
/// forever: may not work
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
pub fn system_message(title: &str, msg: &str, forever: bool) -> ResultType<()> {
|
pub fn system_message(title: &str, msg: &str, forever: bool) -> ResultType<()> {
|
||||||
|
@ -290,6 +290,9 @@ mod tests {
|
||||||
fn test_run_cmds_trim_newline() {
|
fn test_run_cmds_trim_newline() {
|
||||||
assert_eq!(run_cmds_trim_newline("echo -n 123").unwrap(), "123");
|
assert_eq!(run_cmds_trim_newline("echo -n 123").unwrap(), "123");
|
||||||
assert_eq!(run_cmds_trim_newline("echo 123").unwrap(), "123");
|
assert_eq!(run_cmds_trim_newline("echo 123").unwrap(), "123");
|
||||||
assert_eq!(run_cmds_trim_newline("whoami").unwrap() + "\n", run_cmds("whoami").unwrap());
|
assert_eq!(
|
||||||
|
run_cmds_trim_newline("whoami").unwrap() + "\n",
|
||||||
|
run_cmds("whoami").unwrap()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue