2021-02-05 17:12:51 +00:00
|
|
|
{lib, stdenv, fetchurl, jdk, unzip}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "GeoIPJava";
|
|
|
|
version = "1.2.5";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2021-12-26 17:43:05 +00:00
|
|
|
url = "https://geolite.maxmind.com/download/geoip/api/java/GeoIPJava-${version}.zip";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1gb2d0qvvq7xankz7l7ymbr3qprwk9bifpy4hlgw0sq4i6a55ypd";
|
|
|
|
};
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
buildInputs = [ jdk ];
|
2021-02-05 17:12:51 +00:00
|
|
|
buildPhase =
|
2020-04-24 23:36:52 +00:00
|
|
|
''
|
|
|
|
cd source
|
|
|
|
javac $(find . -name \*.java)
|
|
|
|
jar cfv maxmindgeoip.jar $(find . -name \*.class)
|
|
|
|
'';
|
|
|
|
installPhase =
|
|
|
|
''
|
|
|
|
mkdir -p $out/share/java
|
|
|
|
cp maxmindgeoip.jar $out/share/java
|
|
|
|
'';
|
|
|
|
meta = {
|
|
|
|
description = "GeoIP Java API";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.lgpl21Plus;
|
|
|
|
maintainers = [ lib.maintainers.sander ];
|
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|