jffi: clean up and make deterministic

TomaSajt e48ef08d 0c14ba3f

+47 -21
+47 -21
pkgs/development/libraries/java/jffi/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, jdk, jre, ant, libffi, texinfo, pkg-config }: 2 3 - stdenv.mkDerivation rec { 4 pname = "jffi"; 5 version = "1.3.13"; 6 7 src = fetchFromGitHub { 8 owner = "jnr"; 9 repo = "jffi"; 10 - rev = "jffi-${version}"; 11 - sha256 = "sha256-aBQkkZyXZkaJc4sr/jHnIRaJYP116u4Jqsr9XXzfOBA="; 12 }; 13 14 - nativeBuildInputs = [ jdk ant texinfo pkg-config ]; 15 - buildInputs = [ libffi ] ; 16 17 - buildPhase = '' 18 - # The pkg-config script in the build.xml doesn't work propery 19 - # set the lib path manually to work around this. 20 - export LIBFFI_LIBS="${libffi}/lib/libffi.so" 21 22 - ant -Duse.system.libffi=1 jar 23 - ant -Duse.system.libffi=1 archive-platform-jar 24 - ''; 25 26 - installPhase = '' 27 - mkdir -p $out/share/java 28 - cp -r dist/* $out/share/java 29 ''; 30 31 doCheck = true; 32 checkPhase = '' 33 - # The pkg-config script in the build.xml doesn't work propery 34 - # set the lib path manually to work around this. 35 - export LIBFFI_LIBS="${libffi}/lib/libffi.so" 36 37 - ant -Duse.system.libffi=1 test 38 ''; 39 40 meta = with lib; { ··· 45 license = licenses.asl20; 46 maintainers = with maintainers; [ bachp ]; 47 }; 48 - }
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , ant 5 + , jdk 6 + , libffi 7 + , pkg-config 8 + , texinfo 9 + , stripJavaArchivesHook 10 + }: 11 12 + stdenv.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; { ··· 71 license = licenses.asl20; 72 maintainers = with maintainers; [ bachp ]; 73 }; 74 + })