about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Jheng <wentworth@outlook.com>2022-03-13 14:17:42 +0000
committerAaron Jheng <wentworth@outlook.com>2022-03-21 07:23:35 +0000
commitfbc9c00e4f5e3fe07b90c95346c8c236d34ca5ed (patch)
tree79d5fe5038a99d568f6108e1c2f0188d90dfba58
parent75501aff5a660e09fe1328dc8f6b8900fb6c71d3 (diff)
downloadnixlib-fbc9c00e4f5e3fe07b90c95346c8c236d34ca5ed.tar
nixlib-fbc9c00e4f5e3fe07b90c95346c8c236d34ca5ed.tar.gz
nixlib-fbc9c00e4f5e3fe07b90c95346c8c236d34ca5ed.tar.bz2
nixlib-fbc9c00e4f5e3fe07b90c95346c8c236d34ca5ed.tar.lz
nixlib-fbc9c00e4f5e3fe07b90c95346c8c236d34ca5ed.tar.xz
nixlib-fbc9c00e4f5e3fe07b90c95346c8c236d34ca5ed.tar.zst
nixlib-fbc9c00e4f5e3fe07b90c95346c8c236d34ca5ed.zip
clash: 1.6.0 -> 1.10.0
-rw-r--r--pkgs/tools/networking/clash/default.nix22
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 20 insertions, 6 deletions
diff --git a/pkgs/tools/networking/clash/default.nix b/pkgs/tools/networking/clash/default.nix
index 221a6c280b26..844335df223c 100644
--- a/pkgs/tools/networking/clash/default.nix
+++ b/pkgs/tools/networking/clash/default.nix
@@ -1,24 +1,36 @@
-{ lib, fetchFromGitHub, buildGoModule }:
+{ lib, fetchFromGitHub, buildGoModule, testVersion, clash }:
 
 buildGoModule rec {
   pname = "clash";
-  version = "1.6.0";
+  version = "1.10.0";
 
   src = fetchFromGitHub {
     owner = "Dreamacro";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-XG/nci8Sj0vfa/SFPpJwl1Zmt/23LfKxocejplZtS0E=";
+    sha256 = "sha256-cAJjW+NzG48HcDRx12LLdj8VYyIroL+GWqrUrpHOOIk=";
   };
 
-  vendorSha256 = "sha256-WR1CpjEMHRkpd0/iqrOm0oVXvyQO+r6GyeP0L0zx8aA=";
+  vendorSha256 = "sha256-hE2MgjaVme+4vG7+rmJXfjycd3N2R6cA5iSUUTFcQXE=";
 
-  doCheck = false;
+  postPatch = ''
+    # Do not build testing suit
+    rm -rf ./test
+  '';
+
+  CGO_ENABLED = 0;
 
   ldflags = [
+    "-s"
+    "-w"
     "-X github.com/Dreamacro/clash/constant.Version=${version}"
   ];
 
+  passthru.tests.version = testVersion {
+    package = clash;
+    command = "clash -v";
+  };
+
   meta = with lib; {
     description = "A rule-based tunnel in Go";
     homepage = "https://github.com/Dreamacro/clash";
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 26ffdb577550..eb736a328681 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2613,7 +2613,9 @@ with pkgs;
 
   clac = callPackage ../tools/misc/clac {};
 
-  clash = callPackage ../tools/networking/clash { };
+  clash = callPackage ../tools/networking/clash {
+    buildGoModule = buildGo118Module;
+  };
 
   clasp = callPackage ../tools/misc/clasp { };