@@ -0,0 +1,34 @@
1+{ stdenv, fetchurl, autoreconfHook }:
2+
3+let version = "7.0.2"; in # meta.homepage might change after a major update
4+stdenv.mkDerivation {
5+ name = "ip2location-c-${version}";
6+
7+ src = fetchurl {
8+ sha256 = "1gs43qgcyfn83abrkhvvw1s67d1sbkbj3hab9m17ysn6swafiycx";
9+ url = "http://www.ip2location.com/downloads/ip2location-c-${version}.tar.gz";
10+ };
11+
12+ nativeBuildInputs = [ autoreconfHook ];
13+
14+ enableParallelBuilding = true;
15+
16+ # Checks require a database, which require registration (although sample
17+ # databases are available, downloading them for just 1 test seems excessive):
18+ doCheck = false;
19+
20+ meta = with stdenv.lib; {
21+ inherit version;
22+ description = "Library to look up locations of host names and IP addresses";
23+ longDescription = ''
24+ A C library to find the country, region, city,coordinates,
25+ zip code, time zone, ISP, domain name, connection type, area code,
26+ weather, MCC, MNC, mobile brand name, elevation and usage type of
27+ any IP address or host name in the IP2Location databases.
28+ '';
29+ homepage = http://www.ip2location.com/developers/c-7;
30+ license = with licenses; [ gpl3Plus lgpl3Plus ];
31+ platforms = platforms.unix;
32+ maintainers = with maintainers; [ nckx ];
33+ };
34+}