0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-02-22 15:47:26 +00:00
termux-packages/packages/magic-wormhole-rs/remove-clipboard.patch
Fredrik Fornwall 4272a40874 bump(main/magic-wormhole-rs): 0.7.1
Fixes the current rust 1.80 build failure (#21130).
2024-08-15 13:30:50 +02:00

113 lines
4.0 KiB
Diff

diff -u -r ../magic-wormhole.rs-0.7.1/cli/Cargo.toml ./cli/Cargo.toml
--- ../magic-wormhole.rs-0.7.1/cli/Cargo.toml 2024-07-25 21:06:53.000000000 +0000
+++ ./cli/Cargo.toml 2024-08-15 10:40:23.896874099 +0000
@@ -39,9 +39,6 @@
number_prefix = "0.4.0"
ctrlc = "3.2.1"
qr2term = "0.3.0"
-arboard = { version = "3.2.0", features = [
- "wayland-data-control",
-] } # Wayland by default, fallback to X11.
[dev-dependencies]
trycmd = "0.15"
diff -u -r ../magic-wormhole.rs-0.7.1/cli/src/main.rs ./cli/src/main.rs
--- ../magic-wormhole.rs-0.7.1/cli/src/main.rs 2024-07-25 21:06:53.000000000 +0000
+++ ./cli/src/main.rs 2024-08-15 10:41:40.550532903 +0000
@@ -3,7 +3,6 @@
use std::time::{Duration, Instant};
-use arboard::Clipboard;
use async_std::sync::Arc;
use clap::{Args, CommandFactory, Parser, Subcommand};
use color_eyre::{eyre, eyre::Context};
@@ -279,12 +278,6 @@
.try_init()?;
}
- let mut clipboard = Clipboard::new()
- .map_err(|err| {
- log::warn!("Failed to initialize clipboard support: {}", err);
- })
- .ok();
-
match app.command {
WormholeCommand::Send {
common,
@@ -304,7 +297,6 @@
true,
transfer::APP_CONFIG,
Some(&sender_print_code),
- clipboard.as_mut(),
)),
ctrl_c(),
)
@@ -342,7 +334,6 @@
true,
transfer::APP_CONFIG,
Some(&sender_print_code),
- clipboard.as_mut(),
));
match futures::future::select(connect_fut, ctrl_c()).await {
Either::Left((result, _)) => result?,
@@ -382,7 +373,6 @@
false,
transfer::APP_CONFIG,
None,
- clipboard.as_mut(),
));
match futures::future::select(connect_fut, ctrl_c()).await {
Either::Left((result, _)) => result?,
@@ -456,7 +446,6 @@
true,
app_config,
Some(&server_print_code),
- clipboard.as_mut(),
));
let (wormhole, _code, relay_hints) =
match futures::future::select(connect_fut, ctrl_c()).await {
@@ -492,7 +481,6 @@
false,
app_config,
None,
- clipboard.as_mut(),
)
.await?;
@@ -578,7 +566,6 @@
is_send: bool,
mut app_config: magic_wormhole::AppConfig<impl serde::Serialize + Send + Sync + 'static>,
print_code: Option<&PrintCodeFn>,
- clipboard: Option<&mut Clipboard>,
) -> eyre::Result<(Wormhole, magic_wormhole::Code, Vec<transit::RelayHint>)> {
// TODO handle relay servers with multiple endpoints better
let mut relay_hints: Vec<transit::RelayHint> = common_args
@@ -621,15 +608,8 @@
let mailbox_connection =
MailboxConnection::create(app_config, code_length.unwrap()).await?;
- /* Print code and also copy it to clipboard */
+ /* Print code */
if is_send {
- if let Some(clipboard) = clipboard {
- match clipboard.set_text(mailbox_connection.code().to_string()) {
- Ok(()) => log::info!("Code copied to clipboard"),
- Err(err) => log::warn!("Failed to copy code to clipboard: {}", err),
- }
- }
-
print_code.expect("`print_code` must be `Some` when `is_send` is `true`")(
term,
mailbox_connection.code(),
@@ -749,7 +729,7 @@
.to_string();
writeln!(
term,
- "\nThis wormhole's code is: {} (it has been copied to your clipboard)",
+ "\nThis wormhole's code is: {}",
style(&code).bold()
)?;
writeln!(term, "This is equivalent to the following link: \u{001B}]8;;{}\u{001B}\\{}\u{001B}]8;;\u{001B}\\", &uri, &uri)?;
Only in .: target