nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 ant,
6 jdk,
7 stripJavaArchivesHook,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "jna";
12 version = "5.17.0";
13
14 src = fetchFromGitHub {
15 owner = "java-native-access";
16 repo = "jna";
17 rev = finalAttrs.version;
18 hash = "sha256-4i7iQaxH4wS35cIvMfcNf4kUGI+uIoHNpZkQrs4oAyk=";
19 };
20
21 nativeBuildInputs = [
22 ant
23 jdk
24 stripJavaArchivesHook
25 ];
26
27 buildPhase = ''
28 runHook preBuild
29 rm -r dist # remove prebuilt files
30 ant dist
31 runHook postBuild
32 '';
33
34 installPhase = ''
35 runHook preInstall
36 install -Dm444 -t $out/share/java dist/jna{,-platform}.jar
37 runHook postInstall
38 '';
39
40 meta = with lib; {
41 changelog = "https://github.com/java-native-access/jna/blob/${finalAttrs.version}/CHANGES.md";
42 description = "Java Native Access";
43 homepage = "https://github.com/java-native-access/jna";
44 license = with licenses; [
45 lgpl21
46 asl20
47 ];
48 maintainers = with maintainers; [ nagy ];
49 platforms = platforms.linux ++ platforms.darwin;
50 };
51})