2022-03-30 09:31:56 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, jdk, jre, ant, libffi, texinfo, pkg-config }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "jffi";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.3.11";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jnr";
|
|
|
|
repo = "jffi";
|
|
|
|
rev = "jffi-${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-fZnZH2j/IXbfsJkJG8s2ArOrWwVE2kgvSREVaSVoDyo=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2022-03-30 09:31:56 +00:00
|
|
|
description = "Java Foreign Function Interface ";
|
|
|
|
homepage = "https://github.com/jnr/jffi";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ bachp ];
|
|
|
|
};
|
|
|
|
}
|