nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 getopt,
6 ip2location-c,
7 openssl,
8 perl,
9 libmaxminddb ? null,
10 geolite-legacy ? null,
11}:
12
13stdenv.mkDerivation (finalAttrs: {
14 pname = "ipv6calc";
15 version = "4.4.0";
16
17 src = fetchFromGitHub {
18 owner = "pbiering";
19 repo = "ipv6calc";
20 rev = finalAttrs.version;
21 sha256 = "sha256-+u+7XdW0bS3nE5djdy7I1/NHZdXU9QKukZAvTkWsCK0=";
22 };
23
24 buildInputs = [
25 libmaxminddb
26 geolite-legacy
27 getopt
28 ip2location-c
29 openssl
30 perl
31 ];
32
33 postPatch = ''
34 patchShebangs *.sh */*.sh
35 for i in {,databases/}lib/Makefile.in; do
36 substituteInPlace $i --replace "/sbin/ldconfig" "ldconfig"
37 done
38 '';
39
40 configureFlags = [
41 "--prefix=${placeholder "out"}"
42 "--libdir=${placeholder "out"}/lib"
43 "--datadir=${placeholder "out"}/share"
44 "--disable-bundled-getopt"
45 "--disable-bundled-md5"
46 "--disable-dynamic-load"
47 "--enable-shared"
48 ]
49 ++ lib.optionals (libmaxminddb != null) [
50 "--enable-mmdb"
51 ]
52 ++ lib.optionals (geolite-legacy != null) [
53 "--with-geoip-db=${geolite-legacy}/share/GeoIP"
54 ]
55 ++ lib.optionals (ip2location-c != null) [
56 "--enable-ip2location"
57 ];
58
59 enableParallelBuilding = true;
60
61 meta = {
62 description = "Calculate/manipulate (not only) IPv6 addresses";
63 longDescription = ''
64 ipv6calc is a small utility to manipulate (not only) IPv6 addresses and
65 is able to do other tricky things. Intentions were convering a given
66 IPv6 address into compressed format, convering a given IPv6 address into
67 the same format like shown in /proc/net/if_inet6 and (because it was not
68 difficult) migrating the Perl program ip6_int into.
69 Now only one utiltity is needed to do a lot.
70 '';
71 homepage = "http://www.deepspace6.net/projects/ipv6calc.html";
72 license = lib.licenses.gpl2Only;
73 maintainers = [ ];
74 platforms = lib.platforms.linux;
75 };
76})