2022-04-27 09:35:20 +00:00
|
|
|
{ lib, fetchFromGitHub, buildGoModule, testers, clash }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "clash";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "1.10.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Dreamacro";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-v9MUMgHIpHDUEmB5vXOIOkSriX+PCPtiiHHB4H5FeMw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
vendorSha256 = "sha256-egbXCRmC862tctapMUWTcNej1g6a9wCt2JIC9DSEP6k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Do not build testing suit
|
|
|
|
excludedPackages = [ "./test" ];
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
ldflags = [
|
2022-03-30 09:31:56 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
2020-08-20 17:08:02 +00:00
|
|
|
"-X github.com/Dreamacro/clash/constant.Version=${version}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
2022-03-30 09:31:56 +00:00
|
|
|
package = clash;
|
|
|
|
command = "clash -v";
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A rule-based tunnel in Go";
|
|
|
|
homepage = "https://github.com/Dreamacro/clash";
|
2021-03-09 03:18:52 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-11-19 00:13:47 +00:00
|
|
|
maintainers = with maintainers; [ contrun Br1ght0ne ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-07-18 16:06:22 +00:00
|
|
|
}
|