1{
2 lib,
3 stdenv,
4 nixosTests,
5 fetchpatch,
6 fetchurl,
7 autoreconfHook,
8 zlib,
9 pcre,
10 w3m,
11 man,
12 openssl,
13 brotli,
14}:
15
16stdenv.mkDerivation rec {
17
18 pname = "privoxy";
19 version = "3.0.34";
20
21 src = fetchurl {
22 url = "mirror://sourceforge/ijbswa/Sources/${version}%20%28stable%29/${pname}-${version}-stable-src.tar.gz";
23 sha256 = "sha256-5sy8oWVvTmFrRlf4UU4zpw9ml+nXKUNWV3g5Mio8XSw=";
24 };
25
26 # Patch to fix socks4 and socks4a support under glibc's source fortification
27 # (enabled by default since glibc 2.38-0)
28 patches = [
29 (fetchpatch {
30 url = "https://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=19d7684ca10f6c1279568aa19e9a9da2276851f1";
31 sha256 = "sha256-bCb0RUVrWeGfqZYFHXDEEx+76xiNyVqehtLvk9C1j+4=";
32 })
33 ];
34
35 hardeningEnable = [ "pie" ];
36
37 nativeBuildInputs = [
38 autoreconfHook
39 w3m
40 man
41 ];
42 buildInputs = [
43 zlib
44 pcre
45 openssl
46 brotli
47 ];
48
49 makeFlags = [ "STRIP=" ];
50 configureFlags = [
51 "--with-openssl"
52 "--with-brotli"
53 "--enable-external-filters"
54 "--enable-compression"
55 ];
56
57 postInstall = ''
58 rm -r $out/var
59 '';
60
61 passthru.tests.privoxy = nixosTests.privoxy;
62
63 meta = with lib; {
64 homepage = "https://www.privoxy.org/";
65 description = "Non-caching web proxy with advanced filtering capabilities";
66 # When linked with mbedtls, the license becomes GPLv3 (or later), otherwise
67 # GPLv2 (or later). See https://www.privoxy.org/user-manual/copyright.html
68 license = licenses.gpl2Plus;
69 platforms = platforms.all;
70 maintainers = [ ];
71 mainProgram = "privoxy";
72 };
73
74}