2022-03-11 17:06:31 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, openssl, CoreServices, libiconv }:
|
2019-03-02 01:59:49 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "shadowsocks-rust";
|
2022-04-06 19:59:43 +02:00
|
|
|
version = "1.14.2";
|
2019-03-02 01:59:49 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "shadowsocks";
|
|
|
|
repo = pname;
|
2022-04-06 19:59:43 +02:00
|
|
|
sha256 = "sha256-zWiC1GhrI3gcXhr8JpAbFF6t7N6aBSho33FMu8bhF2o=";
|
2019-03-02 01:59:49 +01:00
|
|
|
};
|
|
|
|
|
2022-04-06 19:59:43 +02:00
|
|
|
cargoSha256 = "sha256-nSKeFLWTHhtmlvA9MV6NpupKJo3d1jKpTBI5H8cHJ9s=";
|
2020-05-15 11:20:00 +02:00
|
|
|
|
2021-02-23 05:20:00 +01:00
|
|
|
RUSTC_BOOTSTRAP = 1;
|
2019-03-02 01:59:49 +01:00
|
|
|
|
2022-03-11 17:06:31 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreServices libiconv ];
|
2021-02-23 05:20:00 +01:00
|
|
|
|
2022-03-07 16:45:09 +01:00
|
|
|
cargoBuildFlags = [
|
|
|
|
"--features=aead-cipher-extra,local-dns,local-http-native-tls,local-redir,local-tun"
|
|
|
|
];
|
|
|
|
|
2021-11-01 06:18:57 +01: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"
|
|
|
|
];
|
2019-03-02 01:59:49 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/shadowsocks/shadowsocks-rust";
|
2019-03-02 01:59:49 +01:00
|
|
|
description = "A Rust port of shadowsocks";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
};
|
|
|
|
}
|