clash-verge-rev: 2.0.3 -> 2.1.2 (#385142)

This commit is contained in:
Gaétan Lepage
2025-03-02 17:36:20 +01:00
committed by GitHub
3 changed files with 10 additions and 53 deletions
@@ -1,40 +0,0 @@
diff --git a/src/utils/help.rs b/src/utils/help.rs
index 9b0bc6a7..471b2adc 100644
--- a/src/utils/help.rs
+++ b/src/utils/help.rs
@@ -201,16 +201,6 @@ macro_rules! t {
};
}
-/// 将字节数转换为可读的流量字符串
-/// 支持 B/s、KB/s、MB/s、GB/s 的自动转换
-///
-/// # Examples
-/// ```
-/// assert_eq!(format_bytes_speed(1000), "1000B/s");
-/// assert_eq!(format_bytes_speed(1024), "1.0KB/s");
-/// assert_eq!(format_bytes_speed(1024 * 1024), "1.0MB/s");
-/// ```
-#[cfg(target_os = "macos")]
pub fn format_bytes_speed(speed: u64) -> String {
if speed < 1024 {
format!("{}B/s", speed)
@@ -222,6 +212,15 @@ pub fn format_bytes_speed(speed: u64) -> String {
format!("{:.1}GB/s", speed as f64 / 1024.0 / 1024.0 / 1024.0)
}
}
+/// 将字节数转换为可读的流量字符串
+/// 支持 B/s、KB/s、MB/s、GB/s 的自动转换
+///
+/// # Examples
+/// ```
+/// assert_eq!(format_bytes_speed(1000), "1000B/s");
+/// assert_eq!(format_bytes_speed(1024), "1.0KB/s");
+/// assert_eq!(format_bytes_speed(1024 * 1024), "1.0MB/s");
+/// ```
#[test]
fn test_format_bytes_speed() {
--
2.47.0
+7 -8
View File
@@ -14,23 +14,25 @@
}:
let
pname = "clash-verge-rev";
version = "2.0.3";
version = "2.1.2";
src = fetchFromGitHub {
owner = "clash-verge-rev";
repo = "clash-verge-rev";
tag = "v${version}";
hash = "sha256-vHXXFHdKETJBlzbf4sU+gZpDz06My9DCx5nWdMpHmyc=";
hash = "sha256-rsl3hBywToemthNrG80Mv+JagA4g4S7HukOaRpMKJi8=";
};
src-service = fetchFromGitHub {
owner = "clash-verge-rev";
repo = "clash-verge-service";
rev = "7f8ad08c2f716ca50c074ecd37967728e08edf1e"; # no meaningful tags in this repo. The only way is updating manully every time.
hash = "sha256-kZf5O3n0xmNUN0G4hAWQDN9Oj9K7PtLpv6jnhh1C5Hg=";
rev = "bfd7d597b13d49cf49b64676c2719f1ed9599d22"; # no meaningful tags in this repo. The only way is updating manully every time.
hash = "sha256-LdM0VIVsDPGnHEGwbRFh4/ACTdpVyDnu6dYLLvVbwpc=";
};
service-cargo-hash = "sha256-Sof0jnU5+IGWMmbqVqJmhUzDO6CRlFpwwzYx9Z5tZbk=";
service-cargo-hash = "sha256-mJEk4OAEcuTk5NCzPcWwSlvysqR/9s8p9OGiXWBZvdg=";
npm-hash = "sha256-1OT9Iv9AF4svaOnWNQfOUdo8EUkG0+PU+y8nprc6YjU=";
vendor-hash = "sha256-myvFXaS+QdBRHPpcLEmhg1wgheWb4uXv+QXQf5HA51M=";
service = callPackage ./service.nix {
inherit
@@ -52,9 +54,6 @@ let
;
};
npm-hash = "sha256-vpa8WyOMOH02g2gxibJmav9yWS3QLhaVcFB0e3cZ8ok=";
vendor-hash = "sha256-JAAhcMfRTlkQQ8lBMLMN+whkGQ/4WHjywompirnc/GI=";
unwrapped = callPackage ./unwrapped.nix {
inherit
pname
@@ -16,6 +16,7 @@
webkitgtk_4_1,
openssl,
}:
rustPlatform.buildRustPackage {
inherit version src meta;
pname = "${pname}-unwrapped";
@@ -28,11 +29,6 @@ rustPlatform.buildRustPackage {
OPENSSL_NO_VENDOR = 1;
};
patches = [
# https://github.com/clash-verge-rev/clash-verge-rev/pull/2582
./0001-enable-format_bytes_speed-for-every-platform.patch
];
postPatch = ''
substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
--replace-fail "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
@@ -49,6 +45,8 @@ rustPlatform.buildRustPackage {
--replace-fail '"beforeBuildCommand": "pnpm run web:build"' '"beforeBuildCommand": ""'
sed -i -e '/externalBin/d' -e '/resources/d' tauri.conf.json
sed -i -e '/sidecar/d' -e '/resources/d' tauri.linux.conf.json
chmod 777 ../.cargo
rm ../.cargo/config.toml
'';
nativeBuildInputs = [