about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/networking/tinyproxy/default.nix
blob: 7d3c49db7b7994b46cd4317a422f14c72506f4d1 (plain) (blame)
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
{ stdenv, fetchFromGitHub, autoreconfHook, asciidoc, libxml2,
  libxslt, docbook_xsl }:

stdenv.mkDerivation rec {
  pname = "tinyproxy";
  version = "1.10.0";

  src = fetchFromGitHub {
    sha256 = "0gzapnllzyc005l3rs6iarjk1p5fc8mf9ysbck1mbzbd8xg6w35s";
    rev = version;
    repo = "tinyproxy";
    owner = "tinyproxy";
  };

  nativeBuildInputs = [ autoreconfHook asciidoc libxml2 libxslt docbook_xsl ];

  # -z flag is not supported in darwin
  preAutoreconf = stdenv.lib.optionalString stdenv.isDarwin ''
    substituteInPlace configure.ac --replace \
          'LDFLAGS="-Wl,-z,defs $LDFLAGS"' \
          'LDFLAGS="-Wl, $LDFLAGS"'
  '';

  # See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=154624
  postConfigure = ''
    substituteInPlace docs/man5/Makefile --replace \
          "-f manpage" \
          "--xsltproc-opts=--nonet \\
           -f manpage \\
           -L"
    substituteInPlace docs/man8/Makefile --replace \
          "-f manpage" \
          "--xsltproc-opts=--nonet \\
           -f manpage \\
           -L"
  '';

  configureFlags = [
    "--disable-debug"      # Turn off debugging
    "--enable-xtinyproxy"  # Compile in support for the XTinyproxy header, which is sent to any web server in your domain.
    "--enable-filter"      # Allows Tinyproxy to filter out certain domains and URLs.
    "--enable-upstream"    # Enable support for proxying connections through another proxy server.
    "--enable-transparent" # Allow Tinyproxy to be used as a transparent proxy daemon.
    "--enable-reverse"     # Enable reverse proxying.
  ] ++
  # See: https://github.com/tinyproxy/tinyproxy/issues/1
  stdenv.lib.optional stdenv.isDarwin "--disable-regexcheck";

  meta = with stdenv.lib; {
    homepage = "https://tinyproxy.github.io/";
    description = "A light-weight HTTP/HTTPS proxy daemon for POSIX operating systems";
    license = licenses.gpl2;
    platforms = platforms.all;
    maintainers = [ maintainers.carlosdagos ];
  };
}