about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/java/geoipjava/default.nix
blob: cbb6b35a65c9283e7669d597730810b06ddd3e0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{lib, stdenv, fetchurl, jdk, unzip}:

stdenv.mkDerivation rec {
  pname = "GeoIPJava";
  version = "1.2.5";

  src = fetchurl {
    url = "https://geolite.maxmind.com/download/geoip/api/java/GeoIPJava-${version}.zip";
    sha256 = "1gb2d0qvvq7xankz7l7ymbr3qprwk9bifpy4hlgw0sq4i6a55ypd";
  };
  nativeBuildInputs = [ unzip ];
  buildInputs = [ jdk ];
  buildPhase =
    ''
      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";
    license = lib.licenses.lgpl21Plus;
    maintainers = [ lib.maintainers.sander ];
    platforms = lib.platforms.unix;
  };
}