diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-04-10 20:43:08 +0200 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-04-10 20:43:08 +0200 |
commit | 69bfdf2484041b9d242840c4e5017b4703383bb0 (patch) | |
tree | d8bdaa69e7990d7d6f09b594b3c425f742acd2d0 /nixpkgs/pkgs/development/libraries/java | |
parent | c8aee4b4363b6bf905a521b05b7476960e8286c8 (diff) | |
parent | d8fe5e6c92d0d190646fb9f1056741a229980089 (diff) | |
download | nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.gz nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.bz2 nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.lz nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.xz nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.tar.zst nixlib-69bfdf2484041b9d242840c4e5017b4703383bb0.zip |
Merge commit 'd8fe5e6c'
Conflicts: nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/java')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/java/jffi/default.nix | 68 |
1 files changed, 47 insertions, 21 deletions
diff --git a/nixpkgs/pkgs/development/libraries/java/jffi/default.nix b/nixpkgs/pkgs/development/libraries/java/jffi/default.nix index 3ba336aa18e9..46f270163549 100644 --- a/nixpkgs/pkgs/development/libraries/java/jffi/default.nix +++ b/nixpkgs/pkgs/development/libraries/java/jffi/default.nix @@ -1,40 +1,66 @@ -{ lib, stdenv, fetchFromGitHub, jdk, jre, ant, libffi, texinfo, pkg-config }: +{ lib +, stdenv +, fetchFromGitHub +, ant +, jdk +, libffi +, pkg-config +, texinfo +, stripJavaArchivesHook +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "jffi"; version = "1.3.13"; src = fetchFromGitHub { owner = "jnr"; repo = "jffi"; - rev = "jffi-${version}"; - sha256 = "sha256-aBQkkZyXZkaJc4sr/jHnIRaJYP116u4Jqsr9XXzfOBA="; + rev = "jffi-${finalAttrs.version}"; + hash = "sha256-aBQkkZyXZkaJc4sr/jHnIRaJYP116u4Jqsr9XXzfOBA="; }; - nativeBuildInputs = [ jdk ant texinfo pkg-config ]; - buildInputs = [ libffi ] ; + nativeBuildInputs = [ + ant + jdk + pkg-config + texinfo + stripJavaArchivesHook + ]; - 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" + buildInputs = [ libffi ]; - ant -Duse.system.libffi=1 jar - ant -Duse.system.libffi=1 archive-platform-jar - ''; + # The pkg-config script in the build.xml doesn't work propery + # set the lib path manually to work around this. + env.LIBFFI_LIBS = "${libffi}/lib/libffi${stdenv.hostPlatform.extensions.sharedLibrary}"; + env.ANT_ARGS = "-Duse.system.libffi=1"; - installPhase = '' - mkdir -p $out/share/java - cp -r dist/* $out/share/java + buildPhase = '' + runHook preBuild + ant jar + ant archive-platform-jar + runHook postBuild ''; 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" + runHook preCheck + ant test + runHook postCheck + ''; + + installPhase = '' + runHook preInstall + install -Dm644 dist/*.jar -t $out/share/java + runHook postInstall + ''; - ant -Duse.system.libffi=1 test + # nix can't detect libffi as a dependency inside the jar file, so we create + # a dummy file with the path to libffi, to make sure that nix knows about it + postFixup = '' + mkdir -p $out/nix-support + echo ${libffi} > $out/nix-support/depends ''; meta = with lib; { @@ -45,4 +71,4 @@ stdenv.mkDerivation rec { license = licenses.asl20; maintainers = with maintainers; [ bachp ]; }; -} +}) |