summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/pr/privoxy/package.nix
blob: d7d77f85b15b1e7337c456c2fc9c0dfe21dfcb26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  lib,
  stdenv,
  nixosTests,
  fetchpatch,
  fetchurl,
  autoreconfHook,
  zlib,
  pcre2,
  w3m-batch,
  man,
  openssl,
  brotli,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "privoxy";
  version = "4.2.0";

  src = fetchurl {
    url = "mirror://sourceforge/ijbswa/Sources/${finalAttrs.version}%20%28stable%29/privoxy-${finalAttrs.version}-stable-src.tar.gz";
    hash = "sha256-b5Emf4H2JsQWmU24mrYvTQkkbuv0dUuBGG4ToY7pAo8=";
  };

  nativeBuildInputs = [
    autoreconfHook
    w3m-batch
    man
  ];

  buildInputs = [
    zlib
    pcre2
    openssl
    brotli
  ];

  makeFlags = [ "STRIP=" ];
  configureFlags = [
    "--with-openssl"
    "--with-brotli"
    "--enable-external-filters"
    "--enable-compression"
  ];

  postInstall = ''
    rm -r $out/var
  '';

  passthru.tests.privoxy = nixosTests.privoxy;

  meta = {
    homepage = "https://www.privoxy.org/";
    description = "Non-caching web proxy with advanced filtering capabilities";
    # When linked with mbedtls, the license becomes GPLv3 (or later), otherwise
    # GPLv2 (or later). See https://www.privoxy.org/user-manual/copyright.html
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.all;
    maintainers = [ ];
    mainProgram = "privoxy";
  };
})