8 # in geoipDatabase, you can insert a package defining
9 # "${geoipDatabase}/share/GeoIP" e.g. geolite-legacy
10 geoipDatabase ? "/var/lib/geoip-databases",
15 if lib.isDerivation geoipDatabase then "${toString geoipDatabase}/share/GeoIP" else geoipDatabase;
18 stdenv.mkDerivation rec {
22 src = fetchFromGitHub {
26 sha256 = "0ixyp3h51alnncr17hqp1p0rlqz9w69nlhm60rbzjjz3vjx52ajv";
29 nativeBuildInputs = [ autoreconfHook ];
31 # Cross compilation shenanigans
32 configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
33 "ac_cv_func_malloc_0_nonnull=yes"
34 "ac_cv_func_realloc_0_nonnull=yes"
37 # Fix up the default data directory
39 find . -name Makefile.in -exec sed -i -r 's#^pkgdatadir\s*=.+$#pkgdatadir = ${dataDir}#' {} \;
42 passthru = { inherit dataDir; };
45 description = "API for GeoIP/Geolocation databases";
46 maintainers = with maintainers; [
50 license = licenses.lgpl21;
51 platforms = platforms.unix;
52 homepage = "https://www.maxmind.com";