2023-05-21 13:03:57 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildGoModule
|
|
|
|
, testers
|
|
|
|
, clash
|
|
|
|
}:
|
2019-12-30 02:18:10 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "clash";
|
2023-08-22 03:11:28 +00:00
|
|
|
version = "1.18.0";
|
2019-12-30 02:18:10 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Dreamacro";
|
|
|
|
repo = pname;
|
2023-08-22 03:11:28 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-LqjSPlPkR5sB4Z1pmpdE9r66NN7pwgE9GK4r1zSFlxs=";
|
2019-12-30 02:18:10 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 03:11:28 +00:00
|
|
|
vendorHash = "sha256-EWAbEFYr15RiJk9IXF6KaaX4GaSCa6E4+8rKL4/XG8Y=";
|
2019-12-30 02:18:10 +00:00
|
|
|
|
2022-05-22 07:50:12 +00:00
|
|
|
# Do not build testing suit
|
|
|
|
excludedPackages = [ "./test" ];
|
2022-03-13 14:17:42 +00:00
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
2020-08-04 00:26:27 +00:00
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags = [
|
2022-03-13 14:17:42 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
2020-08-11 21:04:55 +00:00
|
|
|
"-X github.com/Dreamacro/clash/constant.Version=${version}"
|
2020-01-02 10:56:51 +00:00
|
|
|
];
|
|
|
|
|
2023-08-22 03:11:28 +00:00
|
|
|
checkFlags = [
|
|
|
|
"-skip=TestParseRule" # Flaky tests
|
|
|
|
];
|
|
|
|
|
2022-04-20 14:40:48 +00: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";
|
2023-05-21 13:03:57 +00:00
|
|
|
homepage = "https://dreamacro.github.io/clash/";
|
|
|
|
changelog = "https://github.com/Dreamacro/clash/releases/tag/v${version}";
|
2021-02-23 09:47:57 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-11-17 11:02:06 +00:00
|
|
|
maintainers = with maintainers; [ contrun Br1ght0ne ];
|
2023-07-31 19:21:43 +00:00
|
|
|
mainProgram = "clash";
|
2019-12-30 02:18:10 +00:00
|
|
|
};
|
2020-06-28 06:14:00 +00:00
|
|
|
}
|