From c431713f999f28c4a97f78a6655394fd24c3f532 Mon Sep 17 00:00:00 2001 From: Carlos D Date: Thu, 2 Aug 2018 18:36:57 +1000 Subject: [PATCH 1/2] tinyproxy: init at 1.8.4 --- pkgs/tools/networking/tinyproxy/default.nix | 53 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 55 insertions(+) create mode 100644 pkgs/tools/networking/tinyproxy/default.nix diff --git a/pkgs/tools/networking/tinyproxy/default.nix b/pkgs/tools/networking/tinyproxy/default.nix new file mode 100644 index 000000000000..b4a2db8a9706 --- /dev/null +++ b/pkgs/tools/networking/tinyproxy/default.nix @@ -0,0 +1,53 @@ +{ stdenv, fetchFromGitHub, automake, autoreconfHook, asciidoc, libxml2, libxslt }: + +stdenv.mkDerivation rec{ + name = "tinyproxy-${version}"; + version = "1.8.4"; + + src = fetchFromGitHub { + sha256 = "043mfqin5bsba9igm1lqbkp2spibk4j3niyjqc868cnzgx60709c"; + rev = "${version}"; + repo = "tinyproxy"; + owner = "tinyproxy"; + }; + + nativeBuildInputs = [ autoreconfHook asciidoc libxml2 libxslt ]; + + # -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" \ + "-f manpage \\ + -L" + substituteInPlace docs/man8/Makefile --replace \ + "-f manpage" \ + "-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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0ae3f49c4432..10c87c5b95fa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5448,6 +5448,8 @@ with pkgs; tiny8086 = callPackage ../applications/virtualization/8086tiny { }; + tinyproxy = callPackage ../tools/networking/tinyproxy {}; + tio = callPackage ../tools/misc/tio { }; tldr = callPackage ../tools/misc/tldr { }; From a568eec08cf85246f56528ff242e00678c51a3aa Mon Sep 17 00:00:00 2001 From: Carlos D'Agostino Date: Thu, 2 Aug 2018 23:35:29 +1000 Subject: [PATCH 2/2] tinyproxy: add docbook_xsl and add nonet option to a2x --- pkgs/tools/networking/tinyproxy/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/networking/tinyproxy/default.nix b/pkgs/tools/networking/tinyproxy/default.nix index b4a2db8a9706..8ecc85544354 100644 --- a/pkgs/tools/networking/tinyproxy/default.nix +++ b/pkgs/tools/networking/tinyproxy/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchFromGitHub, automake, autoreconfHook, asciidoc, libxml2, libxslt }: +{ stdenv, fetchFromGitHub, automake, autoreconfHook, asciidoc, libxml2, + libxslt, docbook_xsl }: stdenv.mkDerivation rec{ name = "tinyproxy-${version}"; @@ -11,7 +12,7 @@ stdenv.mkDerivation rec{ owner = "tinyproxy"; }; - nativeBuildInputs = [ autoreconfHook asciidoc libxml2 libxslt ]; + nativeBuildInputs = [ autoreconfHook asciidoc libxml2 libxslt docbook_xsl ]; # -z flag is not supported in darwin preAutoreconf = stdenv.lib.optionalString stdenv.isDarwin '' @@ -24,11 +25,13 @@ stdenv.mkDerivation rec{ postConfigure = '' substituteInPlace docs/man5/Makefile --replace \ "-f manpage" \ - "-f manpage \\ + "--xsltproc-opts=--nonet \\ + -f manpage \\ -L" substituteInPlace docs/man8/Makefile --replace \ "-f manpage" \ - "-f manpage \\ + "--xsltproc-opts=--nonet \\ + -f manpage \\ -L" '';