1{ stdenv, fetchFromGitHub, automake, autoreconfHook, asciidoc, libxml2,
2 libxslt, docbook_xsl }:
3
4stdenv.mkDerivation rec{
5 name = "tinyproxy-${version}";
6 version = "1.8.4";
7
8 src = fetchFromGitHub {
9 sha256 = "043mfqin5bsba9igm1lqbkp2spibk4j3niyjqc868cnzgx60709c";
10 rev = "${version}";
11 repo = "tinyproxy";
12 owner = "tinyproxy";
13 };
14
15 nativeBuildInputs = [ autoreconfHook asciidoc libxml2 libxslt docbook_xsl ];
16
17 # -z flag is not supported in darwin
18 preAutoreconf = stdenv.lib.optionalString stdenv.isDarwin ''
19 substituteInPlace configure.ac --replace \
20 'LDFLAGS="-Wl,-z,defs $LDFLAGS"' \
21 'LDFLAGS="-Wl, $LDFLAGS"'
22 '';
23
24 # See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=154624
25 postConfigure = ''
26 substituteInPlace docs/man5/Makefile --replace \
27 "-f manpage" \
28 "--xsltproc-opts=--nonet \\
29 -f manpage \\
30 -L"
31 substituteInPlace docs/man8/Makefile --replace \
32 "-f manpage" \
33 "--xsltproc-opts=--nonet \\
34 -f manpage \\
35 -L"
36 '';
37
38 configureFlags = [
39 "--disable-debug" # Turn off debugging
40 "--enable-xtinyproxy" # Compile in support for the XTinyproxy header, which is sent to any web server in your domain.
41 "--enable-filter" # Allows Tinyproxy to filter out certain domains and URLs.
42 "--enable-upstream" # Enable support for proxying connections through another proxy server.
43 "--enable-transparent" # Allow Tinyproxy to be used as a transparent proxy daemon.
44 "--enable-reverse" # Enable reverse proxying.
45 ] ++
46 # See: https://github.com/tinyproxy/tinyproxy/issues/1
47 stdenv.lib.optional stdenv.isDarwin "--disable-regexcheck";
48
49 meta = with stdenv.lib; {
50 homepage = https://tinyproxy.github.io/;
51 description = "A light-weight HTTP/HTTPS proxy daemon for POSIX operating systems";
52 license = licenses.gpl2;
53 platforms = platforms.all;
54 maintainers = [ maintainers.carlosdagos ];
55 };
56}