@@ -1,18 +1,23 @@
11{ withPolarSSL ? false
2+, enableSystemSharedLib ? true
23, stdenv, fetchurl, zlib
34, openssl ? null
45, polarssl ? null
6+, libev ? null
7+, libsodium ? null
8+, udns ? null
59}:
610
711let
812
9− version = "2.4.6";
10− sha256 = "c87781bc280d7a7180cf82b17ad4e8f38242c73431d5b4b6cd4ccd0c29e1fe93";
13+ version = "2.4.7";
14+ sha256 = "957265cc5339e020d8c8bb7414ab14936e3939dc7355f334aec896ec9b03c6ed";
1115
1216in
1317
18+with stdenv.lib;
19+
1420stdenv.mkDerivation rec {
15− inherit version;
1621 name = "shadowsocks-libev-${version}";
1722 src = fetchurl {
1823 url = "https://github.com/shadowsocks/shadowsocks-libev/archive/v${version}.tar.gz";
@@ -20,13 +25,15 @@ stdenv.mkDerivation rec {
2025 };
2126
2227 buildInputs = [ zlib ]
23− ++ stdenv.lib.optional (!withPolarSSL) openssl
24− ++ stdenv.lib.optional withPolarSSL polarssl;
28+ ++ optional (!withPolarSSL) openssl
29+ ++ optional withPolarSSL polarssl
30+ ++ optional enableSystemSharedLib [libev libsodium udns];
2531
26− configureFlags = stdenv.lib.optional (withPolarSSL)
32+ configureFlags = optional withPolarSSL
2733 [ "--with-crypto-library=polarssl"
2834 "--with-polarssl=${polarssl}"
29− ];
35+ ]
36+ ++ optional enableSystemSharedLib "--enable-system-shared-lib";
3037
3138 meta = {
3239 description = "A lightweight secured SOCKS5 proxy";
@@ -35,8 +42,8 @@ stdenv.mkDerivation rec {
3542 It is a port of Shadowsocks created by @clowwindy, which is maintained by @madeye and @linusyang.
3643 '';
3744 homepage = https://github.com/shadowsocks/shadowsocks-libev;
38− license = stdenv.lib.licenses.gpl3Plus;
39− maintainers = [ stdenv.lib.maintainers.nfjinjing ];
40− platforms = stdenv.lib.platforms.all;
45+ license = licenses.gpl3Plus;
46+ maintainers = [ maintainers.nfjinjing ];
47+ platforms = platforms.all;
4148 };
4249}