mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
[Backport release-25.05] geph: 0.2.61 -> 0.2.72 (#428611)
This commit is contained in:
@@ -23,18 +23,16 @@ let
|
||||
in
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "geph5";
|
||||
version = "0.2.61";
|
||||
version = "0.2.72";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "geph-official";
|
||||
repo = "geph5";
|
||||
rev = "geph5-client-v${finalAttrs.version}";
|
||||
hash = "sha256-qy1E5x5Fn+xwS5st6HkMrJu9nksXQQIyJf97FvNOKO4=";
|
||||
hash = "sha256-+/oOQjebkn3iYi5UXFzFoe0ldu+p+nf5uEjGhk5nlNo=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-r97DsSsqp/KtgqtYQe92nz2qaOBcJF6w9ckfxpk8Cxg=";
|
||||
|
||||
patches = [ ./test-fix.patch ];
|
||||
cargoHash = "sha256-OFSsMa/xErNB+1cvEOnGshJJEcG8ZDf9y/uYVnsVwhU=";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace binaries/geph5-client/src/vpn/*.sh \
|
||||
@@ -64,13 +62,13 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
|
||||
checkFlags = [
|
||||
# Wrong test
|
||||
"--skip=traffcount::tests::test_traffic_cleanup"
|
||||
"--skip=traffcount::tests::test_traffic_count_basic"
|
||||
# Requires network
|
||||
"--skip=dns::tests::resolve_google"
|
||||
# Never finish
|
||||
"--skip=tests::test_blind_sign"
|
||||
"--skip=tests::test_generate_secret_key"
|
||||
"--skip=tests::ping_pong"
|
||||
];
|
||||
|
||||
desktopItems = [
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
diff --git a/binaries/geph5-client/src/traffcount.rs b/binaries/geph5-client/src/traffcount.rs
|
||||
index 5c91a27..61c0b3b 100644
|
||||
--- a/binaries/geph5-client/src/traffcount.rs
|
||||
+++ b/binaries/geph5-client/src/traffcount.rs
|
||||
@@ -28,14 +28,14 @@ impl TraffCount {
|
||||
}
|
||||
|
||||
// /// Create a new traffic counter with custom history length
|
||||
- // pub fn with_history(max_seconds: usize) -> Self {
|
||||
- // let now = Instant::now();
|
||||
- // Self {
|
||||
- // bins: VecDeque::with_capacity(max_seconds),
|
||||
- // window_start: now,
|
||||
- // max_history_seconds: max_seconds,
|
||||
- // }
|
||||
- // }
|
||||
+ pub fn with_history(max_seconds: usize) -> Self {
|
||||
+ let now = Instant::now();
|
||||
+ Self {
|
||||
+ bins: VecDeque::with_capacity(max_seconds),
|
||||
+ window_start: now,
|
||||
+ max_history_seconds: max_seconds,
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/// Increment the traffic count with the given number of bytes
|
||||
pub fn incr(&mut self, bytes: f64) {
|
||||
Reference in New Issue
Block a user