diff --git a/pkgs/by-name/bu/bun/package.nix b/pkgs/by-name/bu/bun/package.nix index 8975db4fabbc..e3bb543c8d3d 100644 --- a/pkgs/by-name/bu/bun/package.nix +++ b/pkgs/by-name/bu/bun/package.nix @@ -4,11 +4,13 @@ , autoPatchelfHook , unzip , installShellFiles +, makeWrapper , openssl , writeShellScript , curl , jq , common-updater-scripts +, darwin }: stdenvNoCC.mkDerivation rec { @@ -18,7 +20,7 @@ stdenvNoCC.mkDerivation rec { src = passthru.sources.${stdenvNoCC.hostPlatform.system} or (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}"); strictDeps = true; - nativeBuildInputs = [ unzip installShellFiles ] ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ autoPatchelfHook ]; + nativeBuildInputs = [ unzip installShellFiles makeWrapper ] ++ lib.optionals stdenvNoCC.hostPlatform.isLinux [ autoPatchelfHook ]; buildInputs = [ openssl ]; dontConfigure = true; @@ -33,14 +35,17 @@ stdenvNoCC.mkDerivation rec { runHook postInstall ''; - - # We currently cannot generate completions for x86_64-darwin because bun requires avx support to run, which is: - # 1. Not currently supported by the version of Rosetta on our aarch64 builders - # 2. Is not correctly detected even on macOS 15+, where it is available through Rosetta - # - # The baseline builds are no longer an option because they too now require avx support. postInstall = - lib.optionalString + lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' + wrapProgram $out/bin/bun \ + --prefix DYLD_LIBRARY_PATH : ${lib.makeLibraryPath [ darwin.ICU ]} + '' + # We currently cannot generate completions for x86_64-darwin because bun requires avx support to run, which is: + # 1. Not currently supported by the version of Rosetta on our aarch64 builders + # 2. Is not correctly detected even on macOS 15+, where it is available through Rosetta + # + # The baseline builds are no longer an option because they too now require avx support. + + lib.optionalString ( stdenvNoCC.buildPlatform.canExecute stdenvNoCC.hostPlatform && !(stdenvNoCC.hostPlatform.isDarwin && stdenvNoCC.hostPlatform.isx86_64)