diff --git a/nix/dev-shell.nix b/nix/dev-shell.nix --- a/nix/dev-shell.nix +++ b/nix/dev-shell.nix @@ -8,6 +8,7 @@ , cmake , cryptopp , darwin +, fbjni , folly , fmt , grpc @@ -59,6 +60,7 @@ # include any libraries buildInputs buildInputs = [ + fbjni # android builds protobuf_3_15_cmake # exposes both a library and a command, thus should appear in both inputs folly # cpp tools fmt # needed for folly diff --git a/nix/fbjni.nix b/nix/fbjni.nix new file mode 100644 --- /dev/null +++ b/nix/fbjni.nix @@ -0,0 +1,43 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, openjdk +, gtest +}: + +stdenv.mkDerivation rec { + pname = "fbjni"; + version = "0.3.0"; + + src = fetchFromGitHub { + owner = "facebookincubator"; + repo = pname; + rev = "v${version}"; + sha256 = "132s9c8vlx1r4zcjjsgii9n3f2fx5qxgj3yvg6hw0dzg61x07bpg"; + }; + + nativeBuildInputs = [ + cmake + openjdk + ]; + + buildInputs = [ + gtest + ]; + + cmakeFlags = [ + "-DJAVA_HOME=${openjdk.passthru.home}" + ]; + + # They install the target export in the wrong directory + postInstall = '' + mv $out/share/cmake $out/lib/cmake + ''; + + meta = with lib; { + description = "A library designed to simplify the usage of the Java Native Interface"; + homepage = "https://github.com/facebookincubator/fbjni"; + license = licenses.asl20; + }; +} diff --git a/nix/overlay.nix b/nix/overlay.nix --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -38,4 +38,6 @@ ''${!outputDev}/include/olm ''; }); + + fbjni = prev.callPackage ./fbjni.nix { }; }