From 0acb5e2466b2638aef1f27344564536b0b7435ec Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 8 May 2023 20:17:26 +0300 Subject: [PATCH 1/2] gnatcoll-core: fix build on x86_64-darwin --- .../gprbuild/gpr-project-path-hook.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/tools/build-managers/gprbuild/gpr-project-path-hook.sh b/pkgs/development/tools/build-managers/gprbuild/gpr-project-path-hook.sh index f98b2ab9e58d..bd562b925e22 100644 --- a/pkgs/development/tools/build-managers/gprbuild/gpr-project-path-hook.sh +++ b/pkgs/development/tools/build-managers/gprbuild/gpr-project-path-hook.sh @@ -6,3 +6,16 @@ addAdaObjectsPath() { } addEnvHooks "$targetOffset" addAdaObjectsPath + +fixDarwinRpath() { + for f in $(find $out -type f -executable); do + install_name_tool -id $f $f || true + for rpath in $(otool -L $f | grep rpath | awk '{print $1}'); do + install_name_tool -change $rpath $out/lib/$(basename $rpath) $f || true + done + done +} + +if [ "$(uname)" = "Darwin" ]; then + preFixupPhases+=" fixDarwinRpath" +fi From 561c6f2b6cbd3dff2d40571889c1ca1cece3a70f Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 8 May 2023 21:07:04 +0300 Subject: [PATCH 2/2] gnatcoll-python3: fix build on x86_64-darwin --- pkgs/development/libraries/ada/gnatcoll/bindings.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/ada/gnatcoll/bindings.nix b/pkgs/development/libraries/ada/gnatcoll/bindings.nix index 9d22551b32a9..146bf1091a70 100644 --- a/pkgs/development/libraries/ada/gnatcoll/bindings.nix +++ b/pkgs/development/libraries/ada/gnatcoll/bindings.nix @@ -14,6 +14,7 @@ , zlib , python3 , ncurses +, darwin }: let @@ -48,6 +49,10 @@ stdenv.mkDerivation rec { python3 ]; + buildInputs = lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.CoreFoundation + ]; + # propagate since gprbuild needs to find referenced .gpr files # and all dependency C libraries when statically linking a # downstream executable.