2022-03-30 09:31:56 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, openssl, CoreServices, libiconv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "shadowsocks-rust";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "1.14.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "shadowsocks";
|
|
|
|
repo = pname;
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-tRiziyCw1Qpm22RtZHeKt4VFReJidFHsPxPSjxIA3hA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
cargoSha256 = "sha256-snnzNb1yJ8L5pMvNNEIf5hZOpFV6DKOWGtGP1T3YTWg=";
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
RUSTC_BOOTSTRAP = 1;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices libiconv ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2022-03-10 19:12:11 +00:00
|
|
|
cargoBuildFlags = [
|
|
|
|
"--features=aead-cipher-extra,local-dns,local-http-native-tls,local-redir,local-tun"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
# all of these rely on connecting to www.example.com:80
|
|
|
|
checkFlags = [
|
|
|
|
"--skip=http_proxy"
|
|
|
|
"--skip=tcp_tunnel"
|
|
|
|
"--skip=udp_tunnel"
|
|
|
|
"--skip=udp_relay"
|
|
|
|
"--skip=socks4_relay_connect"
|
|
|
|
"--skip=socks5_relay_aead"
|
|
|
|
"--skip=socks5_relay_stream"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/shadowsocks/shadowsocks-rust";
|
|
|
|
description = "A Rust port of shadowsocks";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
};
|
|
|
|
}
|