Merge pull request #226124 from wegank/ripasso-bump

ripasso-cursive: 0.6.2 -> 0.6.4
This commit is contained in:
Weijia Wang 2023-04-14 13:21:42 +03:00 committed by GitHub
commit bc8ebd6a12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 503 additions and 354 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,55 +0,0 @@
diff --git a/cursive/Cargo.toml b/cursive/Cargo.toml
index 8cc0c1e..815c170 100644
--- a/cursive/Cargo.toml
+++ b/cursive/Cargo.toml
@@ -20,8 +20,9 @@ gettext = "0.4.0"
lazy_static = "1.4.0"
toml = "0.5.9"
term_size = "0.3.2"
-wl-clipboard-rs = "0.7.0"
hex = "0.4.3"
+[target.'cfg(target_os = "linux")'.dependencies]
+wl-clipboard-rs = "0.7.0"
[dependencies.config]
version = "0.11.0"
diff --git a/cursive/src/helpers.rs b/cursive/src/helpers.rs
index 7c2f733..9d63760 100644
--- a/cursive/src/helpers.rs
+++ b/cursive/src/helpers.rs
@@ -23,6 +23,7 @@ use cursive::{
};
use pass::Result;
use ripasso::{crypto::CryptoImpl, pass};
+#[cfg(target_os = "linux")]
use wl_clipboard_rs::copy::{MimeType, Options, Source};
/// Displays an error in a cursive dialog
@@ -48,7 +49,8 @@ pub fn errorbox(ui: &mut Cursive, err: &pass::Error) {
/// Copies content to the clipboard.
/// It first tries to copy to a wayland clipboard, and if that's not availible due to that the
-/// user runs x11/mac/windows we instead try the more generic clipboard crate.
+/// user runs x11 we instead try the more generic clipboard crate.
+#[cfg(target_os = "linux")]
pub fn set_clipboard(content: String) -> Result<()> {
let opts = Options::new();
let result = opts.copy(
@@ -62,6 +64,17 @@ pub fn set_clipboard(content: String) -> Result<()> {
Ok(())
}
+/// Copies content to the clipboard.
+/// It first tries to copy to a wayland clipboard, and if that's not availible due to that the
+/// user runs mac/windows we instead try the more generic clipboard crate.
+#[cfg(not(target_os = "linux"))]
+pub fn set_clipboard(content: String) -> Result<()> {
+ let mut ctx = clipboard::ClipboardContext::new()?;
+ ctx.set_contents(content)?;
+
+ Ok(())
+}
+
pub fn get_value_from_input(s: &mut Cursive, input_name: &str) -> Option<std::rc::Rc<String>> {
let mut password = None;
s.call_on_name(input_name, |e: &mut EditView| {

View File

@ -1,21 +1,41 @@
{ stdenv, lib, rustPlatform, fetchFromGitHub, pkg-config, python3, openssl, libgpg-error, gpgme, xorg, nettle, llvmPackages, clang, AppKit, Security, installShellFiles }:
{ stdenv
, lib
, rustPlatform
, fetchFromGitHub
, fetchpatch
, pkg-config
, python3
, openssl
, libgpg-error
, gpgme
, xorg
, nettle
, llvmPackages
, clang
, AppKit
, Security
, installShellFiles
}:
with rustPlatform;
buildRustPackage rec {
version = "0.6.2";
version = "0.6.4";
pname = "ripasso-cursive";
src = fetchFromGitHub {
owner = "cortex";
repo = "ripasso";
rev = "release-${version}";
sha256 = "sha256-OKFgBfm4d9IqSJFjg+J1XdsgQrfuIaoRIhVJQeZ+558=";
rev = "release-${version}";
hash = "sha256-9wBaFq2KVfLTd1j8ZPoUlmZJDW2UhvGBAaCGX+qg92s=";
};
patches = [ ./fix-tests.patch ./build-on-macos.patch ];
patches = [
./fix-tests.patch
];
# Needed so bindgen can find libclang.so
LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib";
cargoPatches = [
./fix-build.patch
];
cargoLock = {
lockFile = ./Cargo.lock;
@ -26,10 +46,25 @@ buildRustPackage rec {
cargoBuildFlags = [ "-p ripasso-cursive" ];
nativeBuildInputs = [ pkg-config gpgme python3 installShellFiles clang ];
nativeBuildInputs = [
pkg-config
gpgme
python3
installShellFiles
clang
rustPlatform.bindgenHook
];
buildInputs = [
openssl libgpg-error gpgme xorg.libxcb nettle
] ++ lib.optionals stdenv.isDarwin [ AppKit Security ];
openssl
libgpg-error
gpgme
xorg.libxcb
nettle
] ++ lib.optionals stdenv.isDarwin [
AppKit
Security
];
preCheck = ''
export HOME=$TMPDIR

View File

@ -0,0 +1,40 @@
diff --git a/Cargo.lock b/Cargo.lock
index 8464bf70..659e66c0 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2702,7 +2702,7 @@ dependencies = [
[[package]]
name = "ripasso"
-version = "0.6.3"
+version = "0.6.4"
dependencies = [
"anyhow",
"base64 0.21.0",
@@ -2730,7 +2730,7 @@ dependencies = [
[[package]]
name = "ripasso-cursive"
-version = "0.6.3"
+version = "0.6.4"
dependencies = [
"chrono",
"cli-clipboard",
@@ -2753,7 +2753,7 @@ dependencies = [
[[package]]
name = "ripasso-gtk"
-version = "0.6.3"
+version = "0.6.4"
dependencies = [
"clipboard",
"gdk",
@@ -2765,7 +2765,7 @@ dependencies = [
[[package]]
name = "ripasso-qt"
-version = "0.6.3"
+version = "0.6.4"
dependencies = [
"clipboard",
"qml",