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