2022-04-20 15:40:48 +01:00
|
|
|
{ lib, fetchFromGitHub, buildGoModule, testers, clash }:
|
2019-12-30 02:18:10 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "clash";
|
2022-07-08 06:49:50 +01:00
|
|
|
version = "1.11.4";
|
2019-12-30 02:18:10 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Dreamacro";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-07-08 06:49:50 +01:00
|
|
|
sha256 = "sha256-NLGX72eZCfyh6y3mud/btMh15rNXnss7S0P7ujCX1ms=";
|
2019-12-30 02:18:10 +00:00
|
|
|
};
|
|
|
|
|
2022-07-08 06:49:50 +01:00
|
|
|
vendorSha256 = "sha256-zaWN/zI4WhHnEK12k1tWZ/qjLGvaZbJ4WfEvCZJ0+ms=";
|
2019-12-30 02:18:10 +00:00
|
|
|
|
2022-05-22 08:50:12 +01:00
|
|
|
# Do not build testing suit
|
|
|
|
excludedPackages = [ "./test" ];
|
2022-03-13 14:17:42 +00:00
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
2020-08-04 01:26:27 +01:00
|
|
|
|
2021-08-26 07:45:51 +01:00
|
|
|
ldflags = [
|
2022-03-13 14:17:42 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
2020-08-11 22:04:55 +01:00
|
|
|
"-X github.com/Dreamacro/clash/constant.Version=${version}"
|
2020-01-02 10:56:51 +00:00
|
|
|
];
|
|
|
|
|
2022-04-20 15:40:48 +01:00
|
|
|
passthru.tests.version = testers.testVersion {
|
2022-03-13 14:17:42 +00:00
|
|
|
package = clash;
|
|
|
|
command = "clash -v";
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-12-30 02:18:10 +00:00
|
|
|
description = "A rule-based tunnel in Go";
|
|
|
|
homepage = "https://github.com/Dreamacro/clash";
|
2021-02-23 09:47:57 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-11-17 11:02:06 +00:00
|
|
|
maintainers = with maintainers; [ contrun Br1ght0ne ];
|
2019-12-30 02:18:10 +00:00
|
|
|
};
|
2020-06-28 07:14:00 +01:00
|
|
|
}
|