diff options
author | Pascal Bach <pascal.bach@nextrem.ch> | 2022-01-15 00:16:10 +0100 |
---|---|---|
committer | Pascal Bach <pascal.bach@nextrem.ch> | 2022-03-26 08:48:53 +0100 |
commit | a2c06170a3c247c34a76374dc1a61560e9e419f1 (patch) | |
tree | 048fc7ca1ed09bcc74a558a7474c5bf535d197c0 /pkgs/development/libraries/java | |
parent | 481cc5f7dbf4526412df68b12a674515ba9ba879 (diff) |
jffi: init at 1.3.9
Diffstat (limited to 'pkgs/development/libraries/java')
-rw-r--r-- | pkgs/development/libraries/java/jffi/default.nix | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/development/libraries/java/jffi/default.nix b/pkgs/development/libraries/java/jffi/default.nix new file mode 100644 index 0000000000000..c15a6ddb819c8 --- /dev/null +++ b/pkgs/development/libraries/java/jffi/default.nix @@ -0,0 +1,47 @@ +{ lib, stdenv, fetchFromGitHub, jdk, jre, ant, libffi, texinfo, pkg-config }: + +stdenv.mkDerivation rec { + pname = "jffi"; + version = "1.3.9"; + + src = fetchFromGitHub { + owner = "jnr"; + repo = "jffi"; + rev = "jffi-${version}"; + sha256 = "sha256-VjZYhMbad+AesANG06umRzqMWj+Ebzu59TYK7Tm/bFo="; + }; + + nativeBuildInputs = [ jdk ant texinfo pkg-config ]; + buildInputs = [ libffi ] ; + + buildPhase = '' + # The pkg-config script in the build.xml doesn't work propery + # set the lib path manually to work around this. + export LIBFFI_LIBS="${libffi}/lib/libffi.so" + + ant -Duse.system.libffi=1 jar + ant -Duse.system.libffi=1 archive-platform-jar + ''; + + installPhase = '' + mkdir -p $out/share/java + cp -r dist/* $out/share/java + ''; + + doCheck = true; + checkPhase = '' + # The pkg-config script in the build.xml doesn't work propery + # set the lib path manually to work around this. + export LIBFFI_LIBS="${libffi}/lib/libffi.so" + + ant -Duse.system.libffi=1 test + ''; + + meta = with lib; { + description = "Java Foreign Function Interface "; + homepage = "https://github.com/jnr/jffi"; + platforms = platforms.unix; + license = licenses.asl20; + maintainers = with maintainers; [ bachp ]; + }; +} |