at 24.11-pre 74 lines 1.6 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, ant 5, jdk 6, libffi 7, pkg-config 8, texinfo 9, stripJavaArchivesHook 10}: 11 12stdenv.mkDerivation (finalAttrs: { 13 pname = "jffi"; 14 version = "1.3.13"; 15 16 src = fetchFromGitHub { 17 owner = "jnr"; 18 repo = "jffi"; 19 rev = "jffi-${finalAttrs.version}"; 20 hash = "sha256-aBQkkZyXZkaJc4sr/jHnIRaJYP116u4Jqsr9XXzfOBA="; 21 }; 22 23 nativeBuildInputs = [ 24 ant 25 jdk 26 pkg-config 27 texinfo 28 stripJavaArchivesHook 29 ]; 30 31 buildInputs = [ libffi ]; 32 33 # The pkg-config script in the build.xml doesn't work propery 34 # set the lib path manually to work around this. 35 env.LIBFFI_LIBS = "${libffi}/lib/libffi${stdenv.hostPlatform.extensions.sharedLibrary}"; 36 env.ANT_ARGS = "-Duse.system.libffi=1"; 37 38 buildPhase = '' 39 runHook preBuild 40 ant jar 41 ant archive-platform-jar 42 runHook postBuild 43 ''; 44 45 doCheck = true; 46 47 checkPhase = '' 48 runHook preCheck 49 ant test 50 runHook postCheck 51 ''; 52 53 installPhase = '' 54 runHook preInstall 55 install -Dm644 dist/*.jar -t $out/share/java 56 runHook postInstall 57 ''; 58 59 # nix can't detect libffi as a dependency inside the jar file, so we create 60 # a dummy file with the path to libffi, to make sure that nix knows about it 61 postFixup = '' 62 mkdir -p $out/nix-support 63 echo ${libffi} > $out/nix-support/depends 64 ''; 65 66 meta = with lib; { 67 broken = stdenv.isDarwin; 68 description = "Java Foreign Function Interface "; 69 homepage = "https://github.com/jnr/jffi"; 70 platforms = platforms.unix; 71 license = licenses.asl20; 72 maintainers = with maintainers; [ bachp ]; 73 }; 74})