diff options
author | Alyssa Ross <hi@alyssa.is> | 2020-01-11 23:37:02 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2020-01-11 23:41:30 +0000 |
commit | 6c557e3f1c28cf87e9fba232811d6875dd1399c1 (patch) | |
tree | 035a071d5d8980df6de0fa42e2ef8fc0cce7055e /nixpkgs/pkgs/development/libraries/geoip/default.nix | |
parent | da7500bc026e937ac7fce7b50f67a0e1765737a7 (diff) | |
parent | e4134747f5666bcab8680aff67fa3b63384f9a0f (diff) | |
download | nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.gz nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.bz2 nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.lz nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.xz nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.zst nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.zip |
Merge commit 'e4134747f5666bcab8680aff67fa3b63384f9a0f'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/geoip/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/geoip/default.nix | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/development/libraries/geoip/default.nix b/nixpkgs/pkgs/development/libraries/geoip/default.nix index 1b1f7373709f..d55983952b8c 100644 --- a/nixpkgs/pkgs/development/libraries/geoip/default.nix +++ b/nixpkgs/pkgs/development/libraries/geoip/default.nix @@ -1,37 +1,45 @@ -# in geoipDatabase, you can insert a package defining ${geoipDatabase}/share/GeoIP -# e.g. geolite-legacy { stdenv, fetchFromGitHub, autoreconfHook -, drvName ? "geoip", geoipDatabase ? "/var/lib/geoip-databases" }: +, drvName ? "geoip" -let version = "1.6.12"; - dataDir = if (stdenv.lib.isDerivation geoipDatabase) then "${toString geoipDatabase}/share/GeoIP" else geoipDatabase; -in stdenv.mkDerivation { - name = "${drvName}-${version}"; +# in geoipDatabase, you can insert a package defining +# "${geoipDatabase}/share/GeoIP" e.g. geolite-legacy +, geoipDatabase ? "/var/lib/geoip-databases" +}: + +let + dataDir = if stdenv.lib.isDerivation geoipDatabase + then "${toString geoipDatabase}/share/GeoIP" + else geoipDatabase; +in +stdenv.mkDerivation rec { + pname = drvName; + version = "1.6.12"; src = fetchFromGitHub { - owner = "maxmind"; - repo = "geoip-api-c"; - rev = "v${version}"; + owner = "maxmind"; + repo = "geoip-api-c"; + rev = "v${version}"; sha256 = "0ixyp3h51alnncr17hqp1p0rlqz9w69nlhm60rbzjjz3vjx52ajv"; }; nativeBuildInputs = [ autoreconfHook ]; + # Cross compilation shenanigans configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" ]; + # Fix up the default data directory postConfigure = '' find . -name Makefile.in -exec sed -i -r 's#^pkgdatadir\s*=.+$#pkgdatadir = ${dataDir}#' {} \; ''; - meta = { - description = "Geolocation API"; - maintainers = [ stdenv.lib.maintainers.raskin ]; - license = stdenv.lib.licenses.lgpl21; - platforms = stdenv.lib.platforms.unix; - homepage = http://geolite.maxmind.com/; - downloadPage = "http://geolite.maxmind.com/download/"; + meta = with stdenv.lib; { + description = "An API for GeoIP/Geolocation databases"; + maintainers = with maintainers; [ thoughtpolice raskin ]; + license = licenses.lgpl21; + platforms = platforms.unix; + homepage = "https://www.maxmind.com"; }; } |