diff --git a/pkgs/by-name/ae/aeron-cpp/package.nix b/pkgs/by-name/ae/aeron-cpp/package.nix index 015ff45435e7..5b084c51c9a6 100644 --- a/pkgs/by-name/ae/aeron-cpp/package.nix +++ b/pkgs/by-name/ae/aeron-cpp/package.nix @@ -4,6 +4,7 @@ cmake, fetchFromGitHub, fetchMavenArtifact, + fixDarwinDylibNames, jdk11, lib, libbsd, @@ -54,11 +55,16 @@ stdenv.mkDerivation { ]; nativeBuildInputs = [ - autoPatchelfHook cmake jdk11 makeWrapper patchelf + ] + ++ lib.optionals stdenv.isLinux [ + autoPatchelfHook + ] + ++ lib.optionals stdenv.isDarwin [ + fixDarwinDylibNames ]; configurePhase = '' @@ -113,6 +119,12 @@ stdenv.mkDerivation { runHook postInstall ''; + postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' + for lib in $out/lib/*.dylib; do + install_name_tool -change "@rpath/$(basename $lib)" "$lib" "$out/bin/aeronmd" + done + ''; + meta = with lib; { description = "Aeron Messaging C++ Library"; homepage = "https://aeron.io/";