1{ stdenv, lib, fetchFromGitHub, ant, jdk8 }:
2
3stdenv.mkDerivation rec {
4 pname = "jna";
5 version = "5.13.0";
6
7 src = fetchFromGitHub {
8 owner = "java-native-access";
9 repo = pname;
10 rev = version;
11 hash = "sha256-EIOVmzQcnbL1NmxAaUVCMDvs9wpKqhP5iHAPoBVs3ho=";
12 };
13
14 nativeBuildInputs = [ ant jdk8 ];
15
16 buildPhase = ''
17 runHook preBuild
18 rm -r dist # remove prebuilt files
19 ant dist
20 runHook postBuild
21 '';
22
23 installPhase = ''
24 runHook preInstall
25 install -Dm444 -t $out/share/java dist/jna{,-platform}.jar
26 runHook postInstall
27 '';
28
29 meta = with lib; {
30 inherit (src.meta) homepage;
31 description = "Java Native Access";
32 license = with licenses; [ lgpl21 asl20 ];
33 maintainers = with maintainers; [ nagy ];
34 platforms = platforms.linux ++ platforms.darwin;
35 changelog = "https://github.com/java-native-access/jna/blob/${version}/CHANGES.md";
36 };
37}