From 9458958f4a9b69919bc1073ae471b81313cbd377 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Wed, 12 Jul 2023 09:20:09 -0600 Subject: [PATCH] ruby: fix build with clang 16 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ruby requires `__cospi` and `__sinpi` from `math.h`. These should be available in 10.12, but they’re not because the upstream header used by the source-based SDK is from 2002. Unfortunately, there is no newer version of that header available upstream, so the only way to fix the calls to undefined library functions is by using the 11.0 SDK. These worked on clang 11, but they are an error on clang 16. --- pkgs/top-level/all-packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9bdf849ccbe3..9a18efea1b00 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17915,9 +17915,9 @@ with pkgs; rbenv = callPackage ../development/ruby-modules/rbenv { }; - inherit (callPackage ../development/interpreters/ruby { + inherit (darwin.apple_sdk_11_0.callPackage ../development/interpreters/ruby { inherit (darwin) libobjc libunwind; - inherit (darwin.apple_sdk.frameworks) Foundation; + inherit (darwin.apple_sdk_11_0.frameworks) Foundation; }) mkRubyVersion mkRuby