1{ lib, stdenv, fetchFromGitHub, fetchpatch, capnproto, pkg-config }:
2
3stdenv.mkDerivation rec {
4 pname = "capnproto-java";
5 version = "0.1.5";
6
7 src = fetchFromGitHub {
8 owner = "capnproto";
9 repo = pname;
10 rev = "v${version}";
11 hash = "sha256:1512x70xa6mlg9dmr84r8xbf0jzysjal51ivhhh2ppl97yiqjgls";
12 };
13
14 patches = [
15 # Add make install rule
16 (fetchpatch {
17 url = "https://github.com/capnproto/capnproto-java/commit/e96448d3f5737db25e55cd268652712b69db5cc0.diff";
18 sha256 = "0f3vyap1zsxy675900pzg5ngh7bf9icllm1w04q64g8i91sdzljl";
19 })
20 ];
21
22 nativeBuildInputs = [ pkg-config ];
23
24 buildInputs = [ capnproto ];
25
26 makeFlags = [ "PREFIX=${placeholder "out"}" ];
27
28 meta = with lib; {
29 description = "Cap'n Proto codegen plugin for Java";
30 longDescription = "Only includes compiler plugin, the Java runtime/library that the generated code will link to must be built separately with Maven.";
31 homepage = "https://dwrensha.github.io/capnproto-java/index.html";
32 license = licenses.mit;
33 maintainers = with maintainers; [ bhipple ];
34 };
35}