lol

geoip: pass through the dataDir so consumers know where to look

+17 -10
+17 -10
pkgs/development/libraries/geoip/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, autoreconfHook 2 , drvName ? "geoip" 3 4 - # in geoipDatabase, you can insert a package defining 5 - # "${geoipDatabase}/share/GeoIP" e.g. geolite-legacy 6 , geoipDatabase ? "/var/lib/geoip-databases" 7 }: 8 9 let 10 - dataDir = if lib.isDerivation geoipDatabase 11 then "${toString geoipDatabase}/share/GeoIP" 12 else geoipDatabase; 13 in 14 stdenv.mkDerivation rec { 15 pname = drvName; 16 version = "1.6.12"; 17 18 src = fetchFromGitHub { 19 - owner = "maxmind"; 20 - repo = "geoip-api-c"; 21 - rev = "v${version}"; 22 sha256 = "0ixyp3h51alnncr17hqp1p0rlqz9w69nlhm60rbzjjz3vjx52ajv"; 23 }; 24 ··· 35 find . -name Makefile.in -exec sed -i -r 's#^pkgdatadir\s*=.+$#pkgdatadir = ${dataDir}#' {} \; 36 ''; 37 38 meta = with lib; { 39 description = "An API for GeoIP/Geolocation databases"; 40 maintainers = with maintainers; [ thoughtpolice raskin ]; 41 - license = licenses.lgpl21; 42 - platforms = platforms.unix; 43 - homepage = "https://www.maxmind.com"; 44 }; 45 }
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , autoreconfHook 5 , drvName ? "geoip" 6 7 + # in geoipDatabase, you can insert a package defining 8 + # "${geoipDatabase}/share/GeoIP" e.g. geolite-legacy 9 , geoipDatabase ? "/var/lib/geoip-databases" 10 }: 11 12 let 13 + dataDir = 14 + if lib.isDerivation geoipDatabase 15 then "${toString geoipDatabase}/share/GeoIP" 16 else geoipDatabase; 17 + 18 in 19 stdenv.mkDerivation rec { 20 pname = drvName; 21 version = "1.6.12"; 22 23 src = fetchFromGitHub { 24 + owner = "maxmind"; 25 + repo = "geoip-api-c"; 26 + rev = "v${version}"; 27 sha256 = "0ixyp3h51alnncr17hqp1p0rlqz9w69nlhm60rbzjjz3vjx52ajv"; 28 }; 29 ··· 40 find . -name Makefile.in -exec sed -i -r 's#^pkgdatadir\s*=.+$#pkgdatadir = ${dataDir}#' {} \; 41 ''; 42 43 + passthru = { inherit dataDir; }; 44 + 45 meta = with lib; { 46 description = "An API for GeoIP/Geolocation databases"; 47 maintainers = with maintainers; [ thoughtpolice raskin ]; 48 + license = licenses.lgpl21; 49 + platforms = platforms.unix; 50 + homepage = "https://www.maxmind.com"; 51 }; 52 }