Commit 2a5661fe authored by flurie's avatar flurie
Browse files

aeron-cpp: fix build on darwin

parent c6fee018
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -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/";