Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c2eed8b9b08b
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2c858f06aa99
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Oct 22, 2019

  1. geoip: spruce it up a bit

    Update metadata (dead URL), add myself as a maintainer, and do some
    minor touchups, including moving to `pname+version`.
    
    Signed-off-by: Austin Seipp <aseipp@pobox.com>
    thoughtpolice committed Oct 22, 2019
    Copy the full SHA
    2c858f0 View commit details
Showing with 25 additions and 17 deletions.
  1. +25 −17 pkgs/development/libraries/geoip/default.nix
42 changes: 25 additions & 17 deletions pkgs/development/libraries/geoip/default.nix
Original file line number Diff line number Diff line change
@@ -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 = "http://maxmind.com";
};
}