Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pkgs/by-name/gm/gmt/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
fetchFromGitHub,
cmake,
curl,
darwin,
apple-sdk,
fftwSinglePrec,
netcdf,
pcre,
Expand Down Expand Up @@ -34,8 +34,7 @@ stdenv.mkDerivation (finalAttrs: {
NIX_CFLAGS_COMPILE =
lib.optionalString stdenv.cc.isClang "-Wno-implicit-function-declaration "
+ lib.optionalString (
stdenv.hostPlatform.isDarwin
&& lib.versionOlder (darwin.apple_sdk.MacOSX-SDK.version or darwin.apple_sdk.sdk.version) "13.3"
stdenv.hostPlatform.isDarwin && lib.versionOlder apple-sdk.version "13.3"
) "-D__LAPACK_int=int";
};

Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/haskell-modules/configuration-darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ self: super:
}) super.OpenGLRaw;
bindings-GLFW = overrideCabal (drv: {
librarySystemDepends = [ ];
libraryHaskellDepends = drv.libraryHaskellDepends ++ [
darwin.CF
];
}) super.bindings-GLFW;

# cabal2nix likes to generate dependencies on hinotify when hfsevents is
Expand Down
61 changes: 14 additions & 47 deletions pkgs/development/tools/analysis/valgrind/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
autoreconfHook,
perl,
gdb,
cctools,
xnu,
bootstrap_cmds,
writeScript,
}:

Expand Down Expand Up @@ -56,15 +53,10 @@ stdenv.mkDerivation rec {

# GDB is needed to provide a sane default for `--db-command'.
# Perl is needed for `callgrind_{annotate,control}'.
buildInputs =
[
gdb
perl
]
++ lib.optionals (stdenv.hostPlatform.isDarwin) [
bootstrap_cmds
xnu
];
buildInputs = [
gdb
perl
];

# Perl is also a native build input.
nativeBuildInputs = [
Expand All @@ -75,40 +67,11 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
separateDebugInfo = stdenv.hostPlatform.isLinux;

preConfigure =
lib.optionalString stdenv.hostPlatform.isFreeBSD ''
substituteInPlace configure --replace-fail '`uname -r`' ${stdenv.cc.libc.version}-
''
+ lib.optionalString stdenv.hostPlatform.isDarwin (
let
OSRELEASE = ''
$(awk -F '"' '/#define OSRELEASE/{ print $2 }' \
<${xnu}/Library/Frameworks/Kernel.framework/Headers/libkern/version.h)'';
in
''
echo "Don't derive our xnu version using uname -r."
substituteInPlace configure --replace "uname -r" "echo ${OSRELEASE}"

# Apple's GCC doesn't recognize `-arch' (as of version 4.2.1, build 5666).
echo "getting rid of the \`-arch' GCC option..."
find -name Makefile\* -exec \
sed -i {} -e's/DARWIN\(.*\)-arch [^ ]\+/DARWIN\1/g' \;

sed -i coregrind/link_tool_exe_darwin.in \
-e 's/^my \$archstr = .*/my $archstr = "x86_64";/g'

substituteInPlace coregrind/m_debuginfo/readmacho.c \
--replace /usr/bin/dsymutil ${stdenv.cc.bintools.bintools}/bin/dsymutil

echo "substitute hardcoded /usr/bin/ld with ${cctools}/bin/ld"
substituteInPlace coregrind/link_tool_exe_darwin.in \
--replace /usr/bin/ld ${cctools}/bin/ld
''
);

configureFlags =
lib.optional stdenv.hostPlatform.isx86_64 "--enable-only64bit"
++ lib.optional stdenv.hostPlatform.isDarwin "--with-xcodedir=${xnu}/include";
preConfigure = lib.optionalString stdenv.hostPlatform.isFreeBSD ''
substituteInPlace configure --replace-fail '`uname -r`' ${stdenv.cc.libc.version}-
'';

configureFlags = lib.optional stdenv.hostPlatform.isx86_64 "--enable-only64bit";

doCheck = true;

Expand Down Expand Up @@ -157,6 +120,10 @@ stdenv.mkDerivation rec {
darwin ++ freebsd ++ illumos ++ linux
);
badPlatforms = [ lib.systems.inspect.platformPatterns.isStatic ];
broken = stdenv.hostPlatform.isDarwin; # https://hydra.nixos.org/build/128521440/nixlog/2
# See: <https://hydra.nixos.org/build/128521440/nixlog/2>
#
# Darwin‐specific derivation logic has been removed, check the
# history if you want to fix this.
broken = stdenv.hostPlatform.isDarwin;
};
}
5 changes: 0 additions & 5 deletions pkgs/os-specific/darwin/apple-sdk-11.0/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# Compatibility stubs for packages that used the old SDK frameworks.
# TODO(@reckenrode) Make these stubs warn after framework usage has been cleaned up in nixpkgs.
{
lib,
callPackage,
newScope,
overrideSDK,
pkgs,
stdenv,
stdenvNoCC,
}:

let
Expand Down
5 changes: 0 additions & 5 deletions pkgs/os-specific/darwin/apple-sdk-12.3/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# Compatibility stubs for packages that used the old SDK frameworks.
# TODO(@reckenrode) Make these stubs warn after framework usage has been cleaned up in nixpkgs.
{
lib,
callPackage,
newScope,
overrideSDK,
pkgs,
stdenv,
stdenvNoCC,
}:

let
Expand Down
4 changes: 1 addition & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8175,9 +8175,7 @@ with pkgs;
jdk = jdk11;
};

valgrind = callPackage ../development/tools/analysis/valgrind {
inherit (buildPackages.darwin) xnu bootstrap_cmds;
};
valgrind = callPackage ../development/tools/analysis/valgrind { };
valgrind-light = (res.valgrind.override { gdb = null; }).overrideAttrs (oldAttrs: {
meta = oldAttrs.meta // {
description = "${oldAttrs.meta.description} (without GDB)";
Expand Down
77 changes: 74 additions & 3 deletions pkgs/top-level/darwin-aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,69 @@ let
mapAliases = lib.mapAttrs (
n: alias: removeDistribute (removeRecurseForDerivations (checkInPkgs n alias))
);

# Old Darwin pattern stubs; remove these by 25.11.

mkStub = pkgs.callPackage ../os-specific/darwin/apple-sdk/mk-stub.nix { };

warnStub =
prefix:
lib.warn "${prefix} these stubs do nothing and will be removed in Nixpkgs 25.11; see <https://nixos.org/manual/nixpkgs/stable/#sec-darwin> for documentation and migration instructions";

apple_sdk_11_0 = warnStub "darwin.apple_sdk_11_0.*:" (
pkgs.callPackage ../os-specific/darwin/apple-sdk-11.0 { }
);

apple_sdk_12_3 =
warnStub
"darwin.apple_sdk_12_3.*: add `apple-sdk_12` to build inputs instead to use the macOS 12 SDK."
(pkgs.callPackage ../os-specific/darwin/apple-sdk-12.3 { });

apple_sdk = apple_sdk_11_0;

stubs =
{
inherit apple_sdk apple_sdk_11_0 apple_sdk_12_3;
}
// lib.genAttrs [
"CF"
"CarbonHeaders"
"CommonCrypto"
"CoreSymbolication"
"IOKit"
"Libc"
"Libinfo"
"Libm"
"Libnotify"
"Librpcsvc"
"Libsystem"
"LibsystemCross"
"Security"
"architecture"
"cf-private"
"configd"
"configdHeaders"
"darwin-stubs"
"dtrace"
"eap8021x"
"hfs"
"hfsHeaders"
"launchd"
"libclosure"
"libdispatch"
"libmalloc"
"libobjc"
"libplatform"
"libpthread"
"mDNSResponder"
"objc4"
"ppp"
"xnu"
] (name: warnStub "darwin.${name}:" (mkStub "11.0" name));
in

mapAliases ({
stubs
// mapAliases ({
### A ###

apple_sdk_10_12 = throw "darwin.apple_sdk_10_12 was removed as Nixpkgs no longer supports macOS 10.12; see the 25.05 release notes"; # Added 2024-10-27
Expand All @@ -63,8 +123,6 @@ mapAliases ({
cctools-llvm = pkgs.cctools; # added 2024-07-01
cctools-port = pkgs.cctools; # added 2024-07-17

cf-private = throw "'cf-private' has been renamed to 'apple_sdk.frameworks.CoreFoundation'.";

### D ###

discrete-scroll = pkgs.discrete-scroll; # added 2024-11-27
Expand All @@ -78,7 +136,13 @@ mapAliases ({
### L ###

libauto = throw "'darwin.libauto' has been removed, as it was broken and unmaintained"; # added 2024-05-10
libresolvHeaders = lib.warn "darwin.libresolvHeaders: use `lib.getInclude darwin.libresolv`; this will be removed in 25.11" (
lib.getDev self.libresolv
); # added 2025-04-20
libtapi = pkgs.libtapi; # 2024-08-16
libutilHeaders = lib.warn "darwin.libutilHeaders: use `lib.getInclude darwin.libutil`; this will be removed in 25.11" (
lib.getDev self.libutil
); # added 2025-04-20

### M ###

Expand All @@ -98,6 +162,13 @@ mapAliases ({

### S ###

stdenvNoCF =
lib.warn "darwin.stdenvNoCF: use `stdenv` or `stdenvNoCC`; this will be removed in 25.11"
(
pkgs.stdenv.override {
extraBuildInputs = [ ];
}
); # added 2025-04-20
stubs = throw "'darwin.stubs.*' have been removed as they were unused"; # added 2025-04-20
swift-corelibs-foundation = throw "'darwin.swift-corelibs-foundation' has been removed, as it was broken and is no longer used"; # added 2025-04-20
})
62 changes: 0 additions & 62 deletions pkgs/top-level/darwin-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ let
pkg
) (old.extraBuildInputs or [ ]);
});

mkStub = pkgs.callPackage ../os-specific/darwin/apple-sdk/mk-stub.nix { };
in

makeScopeWithSplicing' {
otherSplices = generateSplicesForMkScope "darwin";
extra = spliced: spliced.apple_sdk.frameworks;
f = lib.extends aliases (
self:
let
Expand All @@ -44,73 +41,14 @@ makeScopeWithSplicing' {
directory = ../os-specific/darwin/apple-source-releases;
};

# Compatibility packages that aren’t necessary anymore
apple-source-headers = {
libresolvHeaders = lib.getDev self.libresolv;
libutilHeaders = lib.getDev self.libutil;
};

# Must use pkgs.callPackage to avoid infinite recursion.
impure-cmds = pkgs.callPackage ../os-specific/darwin/impure-cmds { };

# macOS 11.0 SDK
apple_sdk_11_0 = pkgs.callPackage ../os-specific/darwin/apple-sdk-11.0 { };

# macOS 12.3 SDK
apple_sdk_12_3 = pkgs.callPackage ../os-specific/darwin/apple-sdk-12.3 { };

apple_sdk = apple_sdk_11_0;

stubs =
{
inherit apple_sdk apple_sdk_11_0 apple_sdk_12_3;
libobjc = self.objc4;
}
// lib.genAttrs [
"CF"
"CarbonHeaders"
"CommonCrypto"
"CoreSymbolication"
"IOKit"
"Libc"
"Libinfo"
"Libm"
"Libnotify"
"Librpcsvc"
"Libsystem"
"LibsystemCross"
"Security"
"architecture"
"configd"
"configdHeaders"
"darwin-stubs"
"dtrace"
"eap8021x"
"hfs"
"hfsHeaders"
"launchd"
"libclosure"
"libdispatch"
"libmalloc"
"libplatform"
"libpthread"
"mDNSResponder"
"objc4"
"ppp"
"xnu"
] (mkStub apple_sdk.version);
in

impure-cmds
// apple-source-packages
// apple-source-headers
// stubs
// {

stdenvNoCF = stdenv.override {
extraBuildInputs = [ ];
};

inherit (self.adv_cmds) ps;

binutils-unwrapped = callPackage ../os-specific/darwin/binutils {
Expand Down