From de2bba6d8c2701fceb8c2904a4270559f77beedf Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 7 Sep 2015 03:33:58 +0200 Subject: [PATCH] ipv6calc: add optional ip2location support This only links to the C library. The database must be downloaded manually. --- pkgs/tools/networking/ipv6calc/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/networking/ipv6calc/default.nix b/pkgs/tools/networking/ipv6calc/default.nix index 08a13a9f9ac6..a7c844932c96 100644 --- a/pkgs/tools/networking/ipv6calc/default.nix +++ b/pkgs/tools/networking/ipv6calc/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, geoip, geolite-legacy, getopt, openssl, perl }: +{ stdenv, fetchurl, getopt, ip2location-c, openssl, perl +, geoip ? null, geolite-legacy ? null +, ip2location-database ? null }: let version = "0.99.1"; in stdenv.mkDerivation rec { @@ -9,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "0a0xpai14y969hp6l10r2wcd16sqf3v40fq5h97m4a69hcpmvg5h"; }; - buildInputs = [ geoip geolite-legacy getopt openssl ]; + buildInputs = [ geoip geolite-legacy getopt ip2location-c openssl ]; nativeBuildInputs = [ perl ]; patchPhase = '' @@ -30,6 +32,8 @@ stdenv.mkDerivation rec { "--enable-geoip" ] ++ stdenv.lib.optional (geolite-legacy != null) [ "--with-geoip-db=${geolite-legacy}/share/GeoIP" + ] ++ stdenv.lib.optional (ip2location-c != null ) [ + "--enable-ip2location" ]; enableParallelBuilding = true;