about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/java-modules/jna/default.nix
blob: 00f4cd5fba83d9ff5ab3aed5a820585b91b827e0 (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
31
32
33
34
35
36
37
{ stdenv, lib, fetchFromGitHub, ant, jdk8 }:

stdenv.mkDerivation rec {
  pname = "jna";
  version = "5.13.0";

  src = fetchFromGitHub {
    owner = "java-native-access";
    repo = pname;
    rev = version;
    hash = "sha256-EIOVmzQcnbL1NmxAaUVCMDvs9wpKqhP5iHAPoBVs3ho=";
  };

  nativeBuildInputs = [ ant jdk8 ];

  buildPhase = ''
    runHook preBuild
    rm -r dist # remove prebuilt files
    ant dist
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall
    install -Dm444 -t $out/share/java dist/jna{,-platform}.jar
    runHook postInstall
  '';

  meta = with lib; {
    inherit (src.meta) homepage;
    description = "Java Native Access";
    license = with licenses; [ lgpl21 asl20 ];
    maintainers = with maintainers; [ nagy ];
    platforms = platforms.linux ++ platforms.darwin;
    changelog = "https://github.com/java-native-access/jna/blob/${version}/CHANGES.md";
  };
}