Skip to content

Commit

Permalink
Merge pull request #328077 from reckenrode/cctools-darwin-aliases
Browse files Browse the repository at this point in the history
tree-wide: use top-level cctools
  • Loading branch information
reckenrode authored Jul 18, 2024
2 parents 844ec2d + 2f2e655 commit 2f07b95
Show file tree
Hide file tree
Showing 59 changed files with 126 additions and 147 deletions.
5 changes: 3 additions & 2 deletions pkgs/applications/blockchains/clightning/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib
, stdenv
, cctools
, darwin
, fetchurl
, autoconf
Expand Down Expand Up @@ -30,11 +31,11 @@ stdenv.mkDerivation rec {
hash = "sha256-FD7JFM80wrruqBWjYnJHZh2f2GZJ6XDQmUQ0XetnWBg=";
};

# when building on darwin we need dawin.cctools to provide the correct libtool
# when building on darwin we need cctools to provide the correct libtool
# as libwally-core detects the host as darwin and tries to add the -static
# option to libtool, also we have to add the modified gsed package.
nativeBuildInputs = [ autoconf autogen automake gettext libtool lowdown protobuf py3 unzip which ]
++ lib.optionals stdenv.isDarwin [ darwin.cctools darwin.autoSignDarwinBinariesHook ];
++ lib.optionals stdenv.isDarwin [ cctools darwin.autoSignDarwinBinariesHook ];

buildInputs = [ gmp libsodium sqlite zlib jq ];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/irc/thelounge/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
, fixup-yarn-lock
, python3
, npmHooks
, darwin
, cctools
, sqlite
, srcOnly
, buildPackages
Expand Down Expand Up @@ -38,7 +38,7 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-MM6SgVT7Pjdu96A4eWRucEzT7uNPxBqUDgHKl8mH2C0=";
};

nativeBuildInputs = [ nodejs yarn fixup-yarn-lock python3 npmHooks.npmInstallHook ] ++ lib.optional stdenv.isDarwin darwin.cctools;
nativeBuildInputs = [ nodejs yarn fixup-yarn-lock python3 npmHooks.npmInstallHook ] ++ lib.optional stdenv.isDarwin cctools;
buildInputs = [ sqlite ];

configurePhase = ''
Expand Down
4 changes: 2 additions & 2 deletions pkgs/build-support/node/build-npm-package/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, fetchNpmDeps
, buildPackages
, nodejs
, darwin
, cctools
} @ topLevelArgs:

{ name ? "${args.pname}-${args.version}"
Expand Down Expand Up @@ -76,7 +76,7 @@ stdenv.mkDerivation (args // {
(if npmInstallHook != null then npmInstallHook else npmHooks.npmInstallHook)
nodejs.python
]
++ lib.optionals stdenv.isDarwin [ darwin.cctools ];
++ lib.optionals stdenv.isDarwin [ cctools ];
buildInputs = buildInputs ++ [ nodejs ];

strictDeps = true;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/bi/bitwarden-cli/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
, nodejs_20
, fetchFromGitHub
, python311
, darwin
, cctools
, nixosTests
, xcbuild
}:
Expand All @@ -27,7 +27,7 @@ buildNpmPackage rec {
nativeBuildInputs = [
python311
] ++ lib.optionals stdenv.isDarwin [
darwin.cctools
cctools
xcbuild.xcrun
];

Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/fr/frankenphp/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
, brotli
, testers
, frankenphp
, cctools
, darwin
, libiconv
, pkg-config
Expand Down Expand Up @@ -44,7 +45,7 @@ in buildGoModule rec {
vendorHash = "sha256-Ir1lwTu3JqIFp9jhJyhTAFm/+XlStkPuCoNAZneeKGc=";

buildInputs = [ phpUnwrapped brotli ] ++ phpUnwrapped.buildInputs;
nativeBuildInputs = [ makeBinaryWrapper ] ++ lib.optionals stdenv.isDarwin [ pkg-config darwin.cctools darwin.autoSignDarwinBinariesHook ];
nativeBuildInputs = [ makeBinaryWrapper ] ++ lib.optionals stdenv.isDarwin [ pkg-config cctools darwin.autoSignDarwinBinariesHook ];

subPackages = [ "frankenphp" ];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/li/live555/package.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
lib,
darwin,
cctools,
fetchpatch,
fetchurl,
openssl,
Expand Down Expand Up @@ -31,7 +31,7 @@ stdenv.mkDerivation (finalAttrs: {
];

nativeBuildInputs = lib.optionals stdenv.isDarwin [
darwin.cctools
cctools
];

buildInputs = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/my/mysql84/package.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, stdenv, fetchurl, bison, cmake, pkg-config
, icu, libedit, libevent, lz4, ncurses, openssl, protobuf_21, re2, readline, zlib, zstd, libfido2
, darwin, numactl, libtirpc, rpcsvc-proto, curl
, cctools, darwin, numactl, libtirpc, rpcsvc-proto, curl
}:

stdenv.mkDerivation (finalAttrs: {
Expand Down Expand Up @@ -31,7 +31,7 @@ stdenv.mkDerivation (finalAttrs: {
] ++ lib.optionals stdenv.isLinux [
numactl libtirpc
] ++ lib.optionals stdenv.isDarwin [
darwin.cctools darwin.apple_sdk.frameworks.CoreServices darwin.developer_cmds darwin.DarwinTools
cctools darwin.apple_sdk.frameworks.CoreServices darwin.developer_cmds darwin.DarwinTools
];

outputs = [ "out" "static" ];
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/pe/petsc/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib,
stdenv,
fetchzip,
darwin,
cctools,
gfortran,
python3,
blas,
Expand Down Expand Up @@ -51,7 +51,7 @@ stdenv.mkDerivation rec {

prePatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace config/install.py \
--replace /usr/bin/install_name_tool ${darwin.cctools}/bin/install_name_tool
--replace /usr/bin/install_name_tool ${cctools}/bin/install_name_tool
'';

# Both OpenMPI and MPICH get confused by the sandbox environment and spew errors like this (both to stdout and stderr):
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/pr/protoc-gen-js/package.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, buildBazelPackage, bazel_6, fetchFromGitHub, darwin }:
{ stdenv, lib, buildBazelPackage, bazel_6, fetchFromGitHub, cctools }:

buildBazelPackage rec {
pname = "protoc-gen-js";
Expand All @@ -17,7 +17,7 @@ buildBazelPackage rec {
removeRulesCC = false;
removeLocalConfigCC = false;

LIBTOOL = lib.optionalString stdenv.isDarwin "${darwin.cctools}/bin/libtool";
LIBTOOL = lib.optionalString stdenv.isDarwin "${cctools}/bin/libtool";

fetchAttrs.sha256 = "sha256-WOBlZ0XNrl5UxIaSDxZeOfzS2a8ZkrKdTLKHBDC9UNQ=";

Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/ri/ride/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
copyDesktopItems,
makeDesktopItem,
electron,
darwin,
cctools,
}:

let
Expand Down Expand Up @@ -92,7 +92,7 @@ buildNpmPackage rec {
makeWrapper
]
++ lib.optionals (!stdenv.isDarwin) [ copyDesktopItems ]
++ lib.optionals stdenv.isDarwin [ darwin.cctools ];
++ lib.optionals stdenv.isDarwin [ cctools ];

env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";

Expand Down
4 changes: 2 additions & 2 deletions pkgs/data/fonts/iosevka/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, lib
, buildNpmPackage
, fetchFromGitHub
, darwin
, cctools
, remarshal
, ttfautohint-nox
# Custom font set options.
Expand Down Expand Up @@ -71,7 +71,7 @@ buildNpmPackage rec {
ttfautohint-nox
] ++ lib.optionals stdenv.isDarwin [
# libtool
darwin.cctools
cctools
];

buildPlan =
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/chez-racket/shared.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
args:
{ stdenv, lib, fetchFromGitHub, coreutils, darwin
{ stdenv, lib, fetchFromGitHub, coreutils, cctools, darwin
, ncurses, libiconv, libX11, zlib, lz4
}:

Expand All @@ -23,7 +23,7 @@ stdenv.mkDerivation (args // {
export LZ4="$(find ${lz4.out}/lib -type f | sort | head -n1)"
'';

nativeBuildInputs = lib.optionals stdenv.isDarwin (with darwin; [ cctools autoSignDarwinBinariesHook ]);
nativeBuildInputs = lib.optionals stdenv.isDarwin ([ cctools darwin.autoSignDarwinBinariesHook ]);
buildInputs = [ libiconv libX11 lz4 ncurses zlib ];

enableParallelBuilding = true;
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/dart/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, fetchurl
, unzip
, runCommand
, cctools
, darwin
, sources ? import ./sources.nix {inherit fetchurl;}
, version ? sources.versionUsed
Expand Down Expand Up @@ -41,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: {

testCompile = runCommand "dart-test-compile" {
nativeBuildInputs = [ finalAttrs.finalPackage ]
++ lib.optionals stdenv.isDarwin [ darwin.cctools darwin.sigtool ];
++ lib.optionals stdenv.isDarwin [ cctools darwin.sigtool ];
} ''
HELLO_MESSAGE="Hello, world!"
echo "void main() => print('$HELLO_MESSAGE');" > hello.dart
Expand Down
7 changes: 3 additions & 4 deletions pkgs/development/compilers/dotnet/sigtool.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{ darwin
{ cctools
, darwin
, fetchFromGitHub
, makeWrapper
}:
let
cctools = darwin.cctools;

in darwin.sigtool.overrideAttrs (old: {
darwin.sigtool.overrideAttrs (old: {
# this is a fork of sigtool that supports -v and --remove-signature, which are
# used by the dotnet sdk
src = fetchFromGitHub {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
nodeEnv = import ../../../../node-packages/node-env.nix {
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
libtool = if pkgs.stdenv.isDarwin then pkgs.cctools or pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/gcc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
, nukeReferences
, callPackage
, majorMinorVersion
, cctools
, darwin

# only for gcc<=6.x
Expand Down Expand Up @@ -457,7 +458,7 @@ pipe ((callFile ./common/builder.nix {}) ({
} // optionalAttrs (!atLeast10 && stdenv.targetPlatform.isDarwin) {
# GCC <10 requires default cctools `strip` instead of `llvm-strip` used by Darwin bintools.
preBuild = ''
makeFlagsArray+=('STRIP=${getBin darwin.cctools-port}/bin/${stdenv.cc.targetPrefix}strip')
makeFlagsArray+=('STRIP=${getBin cctools}/bin/${stdenv.cc.targetPrefix}strip')
'';
} // optionalAttrs (!atLeast8) {
doCheck = false; # requires a lot of tools, causes a dependency cycle for stdenv
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/gcc/patches/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ in
./6/gnat-glibc234.patch
]

# The clang-based assembler used in darwin.cctools-llvm (LLVM >11) does not support piping input.
# The clang-based assembler used in darwin.binutils (LLVM >11) does not support piping input.
# Fortunately, it does not exhibit the problem GCC has with the cctools assembler.
# This patch can be dropped should darwin.cctools-llvm ever implement support.
# This patch can be dropped should darwin.binutils ever implement support.
++ optional (!atLeast7 && hostPlatform.isDarwin && lib.versionAtLeast (lib.getVersion stdenv.cc) "12") ./4.9/darwin-clang-as.patch

# Building libstdc++ with flat namespaces results in trying to link CoreFoundation, which
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/ponyc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
, substituteAll
, which
, z3
, cctools
, darwin
}:

Expand All @@ -36,7 +37,7 @@ stdenv.mkDerivation (rec {
};

nativeBuildInputs = [ cmake makeWrapper which python3 ]
++ lib.optionals (stdenv.isDarwin) [ darwin.cctools ];
++ lib.optionals (stdenv.isDarwin) [ cctools ];
buildInputs = [ libxml2 z3 ];

# Sandbox disallows network access, so disabling problematic networking tests
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/swift/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ let
xcbuild = xcodebuild;

swift-unwrapped = callPackage ./compiler {
inherit (darwin) DarwinTools cctools sigtool;
inherit (darwin) DarwinTools sigtool;
inherit (apple_sdk) MacOSX-SDK CLTools_Executables;
inherit (apple_sdk.frameworks) CoreServices Foundation Combine;
};
Expand All @@ -85,7 +85,7 @@ let
};

swiftpm = callPackage ./swiftpm {
inherit (darwin) DarwinTools cctools;
inherit (darwin) DarwinTools;
inherit (apple_sdk.frameworks) CryptoKit LocalAuthentication;
swift = swiftNoSwiftDriver;
};
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/interpreters/cyclone/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, libck, darwin }:
{ lib, stdenv, fetchFromGitHub, libck, cctools }:

let
version = "0.34.0";
Expand All @@ -15,7 +15,7 @@ let

enableParallelBuilding = true;

nativeBuildInputs = lib.optionals stdenv.isDarwin [ darwin.cctools ];
nativeBuildInputs = lib.optionals stdenv.isDarwin [ cctools ];

buildInputs = [ libck ];

Expand All @@ -36,7 +36,7 @@ stdenv.mkDerivation {
enableParallelBuilding = true;

nativeBuildInputs = [ bootstrap ]
++ lib.optionals stdenv.isDarwin [ darwin.cctools ];
++ lib.optionals stdenv.isDarwin [ cctools ];

buildInputs = [ libck ];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/catboost/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, config
, fetchFromGitHub
, cmake
, darwin
, cctools
, libiconv
, llvmPackages
, ninja
Expand Down Expand Up @@ -60,7 +60,7 @@ stdenv.mkDerivation (finalAttrs: {
ragel
yasm
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.cctools
cctools
] ++ lib.optionals cudaSupport (with cudaPackages; [
cuda_nvcc
]);
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/freeimage/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchsvn, darwin, libtiff
{ lib, stdenv, fetchsvn, cctools, libtiff
, libpng, zlib, libwebp, libraw, openexr, openjpeg
, libjpeg, jxrlib, pkg-config
, fixDarwinDylibNames, autoSignDarwinBinariesHook }:
Expand Down Expand Up @@ -38,7 +38,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
pkg-config
] ++ lib.optionals stdenv.isDarwin [
darwin.cctools
cctools
fixDarwinDylibNames
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
autoSignDarwinBinariesHook
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/libmcrypt/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, darwin, disablePosixThreads ? false }:
{ lib, stdenv, fetchurl, cctools, disablePosixThreads ? false }:

stdenv.mkDerivation rec {
pname = "libmcrypt";
Expand All @@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
sha256 = "0gipgb939vy9m66d3k8il98rvvwczyaw2ixr8yn6icds9c3nrsz4";
};

buildInputs = lib.optional stdenv.isDarwin darwin.cctools;
buildInputs = lib.optional stdenv.isDarwin cctools;

configureFlags = lib.optionals disablePosixThreads [ "--disable-posix-threads" ]
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
Expand Down
Loading

0 comments on commit 2f07b95

Please sign in to comment.