diff options
Diffstat (limited to 'pkgs/os-specific/darwin')
24 files changed, 439 insertions, 124 deletions
diff --git a/pkgs/os-specific/darwin/CoreSymbolication/default.nix b/pkgs/os-specific/darwin/CoreSymbolication/default.nix index aa73c7f86c4..5cf92a41a6f 100644 --- a/pkgs/os-specific/darwin/CoreSymbolication/default.nix +++ b/pkgs/os-specific/darwin/CoreSymbolication/default.nix @@ -1,19 +1,23 @@ -{ fetchFromGitHub, stdenv }: +{ lib, fetchFromGitHub, stdenv }: -# Reverse engineered CoreSymbolication to make dtrace buildable - -stdenv.mkDerivation rec { - name = "CoreSymbolication"; +stdenv.mkDerivation { + pname = "core-symbolication"; + version = "unstable-2018-06-17"; src = fetchFromGitHub { - repo = name; + repo = "CoreSymbolication"; owner = "matthewbauer"; - rev = "671fcb66c82eac1827f3f53dc4cc4e9b1b94da0a"; - sha256 = "0qpw46gwgjxiwqqjxksb8yghp2q8dwad6hzaf4zl82xpvk9n5ahj"; + rev = "24c87c23664b3ee05dc7a5a87d647ae476a680e4"; + hash = "sha256-PzvLq94eNhP0+rLwGMKcMzxuD6MlrNI7iT/eV0obtSE="; }; - installPhase = '' - mkdir -p $out/include - cp -r CoreSymbolication $out/include - ''; + makeFlags = [ "PREFIX=$(out)" "CC=${stdenv.cc.targetPrefix}cc" ]; + + meta = with lib; { + description = "Reverse engineered headers for Apple's CoreSymbolication framework"; + homepage = "https://github.com/matthewbauer/CoreSymbolication"; + license = licenses.mit; + platforms = platforms.darwin; + maintainers = with maintainers; [ matthewbauer ]; + }; } diff --git a/pkgs/os-specific/darwin/DarwinTools/default.nix b/pkgs/os-specific/darwin/DarwinTools/default.nix index 72a37502845..11e4c84395d 100644 --- a/pkgs/os-specific/darwin/DarwinTools/default.nix +++ b/pkgs/os-specific/darwin/DarwinTools/default.nix @@ -13,17 +13,17 @@ stdenv.mkDerivation rec { ./sw_vers-CFPriv.patch ]; - postPatch = '' - substituteInPlace Makefile \ - --replace gcc cc - ''; - configurePhase = '' export SRCROOT=. export SYMROOT=. export DSTROOT=$out ''; + makeFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + "STRIP=${stdenv.cc.targetPrefix}strip" + ]; + postInstall = '' mv $out/usr/* $out rmdir $out/usr diff --git a/pkgs/os-specific/darwin/aldente/default.nix b/pkgs/os-specific/darwin/aldente/default.nix index 6dd464a405f..7ca454609ae 100644 --- a/pkgs/os-specific/darwin/aldente/default.nix +++ b/pkgs/os-specific/darwin/aldente/default.nix @@ -6,11 +6,11 @@ stdenvNoCC.mkDerivation (finalAttrs: { pname = "aldente"; - version = "1.22.2"; + version = "1.22.3"; src = fetchurl { url = "https://github.com/davidwernhart/aldente-charge-limiter/releases/download/${finalAttrs.version}/AlDente.dmg"; - hash = "sha256-bREI0RS4xvEccyw3yed5aD8oG5wmD5hyG82qW2tqlEA="; + hash = "sha256-pSqBDDumCbORLQ+B3skSqKmgG2KybR5Zb4ojiNQcAaM="; }; dontBuild = true; diff --git a/pkgs/os-specific/darwin/apple-sdk-11.0/private-frameworks.nix b/pkgs/os-specific/darwin/apple-sdk-11.0/private-frameworks.nix index f95932516d2..4566c8af84f 100644 --- a/pkgs/os-specific/darwin/apple-sdk-11.0/private-frameworks.nix +++ b/pkgs/os-specific/darwin/apple-sdk-11.0/private-frameworks.nix @@ -2,6 +2,7 @@ # generated by hand to avoid exposing all private frameworks # frameworks here are only the necessary ones used by public frameworks. { + Apple80211 = {}; AVFCapture = {}; AVFCore = {}; AddressBookCore = { inherit ContactsPersistence; }; diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix index 0c959695d77..5484ba5acb1 100644 --- a/pkgs/os-specific/darwin/apple-sdk/default.nix +++ b/pkgs/os-specific/darwin/apple-sdk/default.nix @@ -1,9 +1,6 @@ -{ stdenv, fetchurl, libxml2, xar, cpio, pkgs, python3Minimal, pbzx, lib, darwin-stubs, print-reexports }: +{ stdenv, fetchurl, cpio, pbzx, pkgs, lib, darwin-stubs, print-reexports }: let - xarMinimal = xar.override { - libxml2 = libxml2.override { pythonSupport = false; }; - }; # sadly needs to be exported because security_tool needs it sdk = stdenv.mkDerivation rec { pname = "MacOS_SDK"; @@ -19,27 +16,23 @@ let sha256 = "13xq34sb7383b37hwy076gnhf96prpk1b4087p87xnwswxbrisih"; }; - nativeBuildInputs = [ xarMinimal cpio python3Minimal pbzx ]; + nativeBuildInputs = [ cpio pbzx ]; outputs = [ "out" "dev" "man" ]; unpackPhase = '' - xar -x -f $src + pbzx $src | cpio -idm ''; + sourceRoot = "."; + installPhase = '' - start="$(pwd)" mkdir -p $out - cd $out - pbzx -n $start/Payload | cpio -idm - - mv usr/* . - rmdir usr - mv System/* . - rmdir System + cp -R System/Library $out + cp -R usr/* $out - pushd lib + pushd $out/lib cp ${darwin-stubs}/usr/lib/libcups*.tbd . ln -s libcups.2.tbd libcups.tbd ln -s libcupscgi.1.tbd libcupscgi.tbd diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix index 6e6712f375e..931bebeae5d 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/Libm/default.nix @@ -1,6 +1,13 @@ { appleDerivation', stdenvNoCC }: appleDerivation' stdenvNoCC { + patches = [ + # The source release version of math.h is missing some symbols that are actually present + # in newer SDKs. Patch them into the header to avoid implicit function declaration errors + # when compiling with newer versions of clang. + ./missing-declarations.patch + ]; + installPhase = '' mkdir -p $out/include diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libm/missing-declarations.patch b/pkgs/os-specific/darwin/apple-source-releases/Libm/missing-declarations.patch new file mode 100644 index 00000000000..e56934e59d4 --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/Libm/missing-declarations.patch @@ -0,0 +1,292 @@ +--- a/Source/Intel/math.h 2023-10-20 09:43:42.640416006 -0400 ++++ b/Source/Intel/math.h 2023-10-20 09:47:59.743127003 -0400 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2002 Apple Computer, Inc. All rights reserved. ++ * Copyright (c) 2002-2015 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * +@@ -27,14 +27,17 @@ + * Contains: typedefs, prototypes, and macros germane to C99 floating point.* + * * + *******************************************************************************/ ++#ifndef __MATH_H__ ++#define __MATH_H__ ++ + #ifndef __MATH__ + #define __MATH__ ++#endif + +-#include <sys/cdefs.h> /* For definition of __DARWIN_UNIX03 et al */ ++#include <sys/cdefs.h> ++#include <Availability.h> + +-#ifdef __cplusplus +-extern "C" { +-#endif ++__BEGIN_DECLS + + /****************************************************************************** + * Floating point data types * +@@ -87,14 +90,26 @@ + #define FP_SUBNORMAL 5 + #define FP_SUPERNORMAL 6 /* meaningful only on PowerPC */ + +-/* fma() *function call* is more costly than equivalent (in-line) multiply and add operations */ +-/* For single and double precision, the cost isn't too bad, because we can fall back on higher */ +-/* precision hardware, with the necessary range to handle infinite precision products. However, */ +-/* expect the long double fma to be at least an order of magnitude slower than a simple multiply */ +-/* and an add. */ +-#undef FP_FAST_FMA +-#undef FP_FAST_FMAF +-#undef FP_FAST_FMAL ++#if defined __arm64__ || defined __ARM_VFPV4__ ++/* On these architectures, fma(), fmaf( ), and fmal( ) are generally about as ++ fast as (or faster than) separate multiply and add of the same operands. */ ++# define FP_FAST_FMA 1 ++# define FP_FAST_FMAF 1 ++# define FP_FAST_FMAL 1 ++#elif (defined __i386__ || defined __x86_64__) && (defined __FMA__) ++/* When targeting the FMA ISA extension, fma() and fmaf( ) are generally ++ about as fast as (or faster than) separate multiply and add of the same ++ operands, but fmal( ) may be more costly. */ ++# define FP_FAST_FMA 1 ++# define FP_FAST_FMAF 1 ++# undef FP_FAST_FMAL ++#else ++/* On these architectures, fma( ), fmaf( ), and fmal( ) function calls are ++ significantly more costly than separate multiply and add operations. */ ++# undef FP_FAST_FMA ++# undef FP_FAST_FMAF ++# undef FP_FAST_FMAL ++#endif + + /* The values returned by `ilogb' for 0 and NaN respectively. */ + #define FP_ILOGB0 (-2147483647 - 1) +@@ -191,6 +206,23 @@ + static __inline__ int __inline_isnormalf( float __x ) { float fabsf = __builtin_fabsf(__x); if( __x != __x ) return 0; return fabsf < __builtin_inff() && fabsf >= __FLT_MIN__; } + static __inline__ int __inline_isnormald( double __x ) { double fabsf = __builtin_fabs(__x); if( __x != __x ) return 0; return fabsf < __builtin_inf() && fabsf >= __DBL_MIN__; } + static __inline__ int __inline_isnormal( long double __x ) { long double fabsf = __builtin_fabsl(__x); if( __x != __x ) return 0; return fabsf < __builtin_infl() && fabsf >= __LDBL_MIN__; } ++ ++#if defined __i386__ || defined __x86_64__ ++__header_always_inline int __inline_signbitl(long double __x) { ++ union { ++ long double __ld; ++ struct{ unsigned long long __m; unsigned short __sexp; } __p; ++ } __u; ++ __u.__ld = __x; ++ return (int)(__u.__p.__sexp >> 15); ++} ++#else ++__header_always_inline int __inline_signbitl(long double __x) { ++ union { long double __f; unsigned long long __u;} __u; ++ __u.__f = __x; ++ return (int)(__u.__u >> 63); ++} ++#endif + + #else + +@@ -509,7 +541,112 @@ + extern long double __infl( void ); + extern float __nan( void ); /* 10.3 (and later) must retain in ABI for backward compatability */ + +-#if !defined(_ANSI_SOURCE) ++ ++/****************************************************************************** ++ * Apple extensions to the C standard * ++ ******************************************************************************/ ++ ++/* Because these functions are not specified by any relevant standard, they ++ are prefixed with __, which places them in the implementor's namespace, so ++ they should not conflict with any developer or third-party code. If they ++ are added to a relevant standard in the future, un-prefixed names may be ++ added to the library and they may be moved out of this section of the ++ header. ++ ++ Because these functions are non-standard, they may not be available on non- ++ Apple platforms. */ ++ ++/* __exp10(x) returns 10**x. Edge cases match those of exp( ) and exp2( ). */ ++extern float __exp10f(float) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); ++extern double __exp10(double) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); ++ ++/* __sincos(x,sinp,cosp) computes the sine and cosine of x with a single ++ function call, storing the sine in the memory pointed to by sinp, and ++ the cosine in the memory pointed to by cosp. Edge cases match those of ++ separate calls to sin( ) and cos( ). */ ++__header_always_inline void __sincosf(float __x, float *__sinp, float *__cosp); ++__header_always_inline void __sincos(double __x, double *__sinp, double *__cosp); ++ ++/* __sinpi(x) returns the sine of pi times x; __cospi(x) and __tanpi(x) return ++ the cosine and tangent, respectively. These functions can produce a more ++ accurate answer than expressions of the form sin(M_PI * x) because they ++ avoid any loss of precision that results from rounding the result of the ++ multiplication M_PI * x. They may also be significantly more efficient in ++ some cases because the argument reduction for these functions is easier ++ to compute. Consult the man pages for edge case details. */ ++extern float __cospif(float) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); ++extern double __cospi(double) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); ++extern float __sinpif(float) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); ++extern double __sinpi(double) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); ++extern float __tanpif(float) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); ++extern double __tanpi(double) __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0); ++ ++#if (defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 1090) || \ ++ (defined __IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < 70000) ++/* __sincos and __sincosf were introduced in OSX 10.9 and iOS 7.0. When ++ targeting an older system, we simply split them up into discrete calls ++ to sin( ) and cos( ). */ ++__header_always_inline void __sincosf(float __x, float *__sinp, float *__cosp) { ++ *__sinp = sinf(__x); ++ *__cosp = cosf(__x); ++} ++ ++__header_always_inline void __sincos(double __x, double *__sinp, double *__cosp) { ++ *__sinp = sin(__x); ++ *__cosp = cos(__x); ++} ++#else ++/* __sincospi(x,sinp,cosp) computes the sine and cosine of pi times x with a ++ single function call, storing the sine in the memory pointed to by sinp, ++ and the cosine in the memory pointed to by cosp. Edge cases match those ++ of separate calls to __sinpi( ) and __cospi( ), and are documented in the ++ man pages. ++ ++ These functions were introduced in OSX 10.9 and iOS 7.0. Because they are ++ implemented as header inlines, weak-linking does not function as normal, ++ and they are simply hidden when targeting earlier OS versions. */ ++__header_always_inline void __sincospif(float __x, float *__sinp, float *__cosp); ++__header_always_inline void __sincospi(double __x, double *__sinp, double *__cosp); ++ ++/* Implementation details of __sincos and __sincospi allowing them to return ++ two results while allowing the compiler to optimize away unnecessary load- ++ store traffic. Although these interfaces are exposed in the math.h header ++ to allow compilers to generate better code, users should call __sincos[f] ++ and __sincospi[f] instead and allow the compiler to emit these calls. */ ++struct __float2 { float __sinval; float __cosval; }; ++struct __double2 { double __sinval; double __cosval; }; ++ ++extern struct __float2 __sincosf_stret(float); ++extern struct __double2 __sincos_stret(double); ++extern struct __float2 __sincospif_stret(float); ++extern struct __double2 __sincospi_stret(double); ++ ++__header_always_inline void __sincosf(float __x, float *__sinp, float *__cosp) { ++ const struct __float2 __stret = __sincosf_stret(__x); ++ *__sinp = __stret.__sinval; *__cosp = __stret.__cosval; ++} ++ ++__header_always_inline void __sincos(double __x, double *__sinp, double *__cosp) { ++ const struct __double2 __stret = __sincos_stret(__x); ++ *__sinp = __stret.__sinval; *__cosp = __stret.__cosval; ++} ++ ++__header_always_inline void __sincospif(float __x, float *__sinp, float *__cosp) { ++ const struct __float2 __stret = __sincospif_stret(__x); ++ *__sinp = __stret.__sinval; *__cosp = __stret.__cosval; ++} ++ ++__header_always_inline void __sincospi(double __x, double *__sinp, double *__cosp) { ++ const struct __double2 __stret = __sincospi_stret(__x); ++ *__sinp = __stret.__sinval; *__cosp = __stret.__cosval; ++} ++#endif ++ ++/****************************************************************************** ++ * POSIX/UNIX extensions to the C standard * ++ ******************************************************************************/ ++ ++#if __DARWIN_C_LEVEL >= 199506L + extern double j0 ( double ); + + extern double j1 ( double ); +@@ -543,14 +680,32 @@ + extern int signgam; /* required for unix 2003 */ + + +-#endif /* !defined(_ANSI_SOURCE) */ ++#endif /* __DARWIN_C_LEVEL >= 199506L */ + +-#if !defined(__NOEXTENSIONS__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +-#define __WANT_EXTENSIONS__ +-#endif ++/* Long-double versions of M_E, etc for convenience on Intel where long- ++ double is not the same as double. Define __MATH_LONG_DOUBLE_CONSTANTS ++ to make these constants available. */ ++#if defined __MATH_LONG_DOUBLE_CONSTANTS ++#define M_El 0xa.df85458a2bb4a9bp-2L ++#define M_LOG2El 0xb.8aa3b295c17f0bcp-3L ++#define M_LOG10El 0xd.e5bd8a937287195p-5L ++#define M_LN2l 0xb.17217f7d1cf79acp-4L ++#define M_LN10l 0x9.35d8dddaaa8ac17p-2L ++#define M_PIl 0xc.90fdaa22168c235p-2L ++#define M_PI_2l 0xc.90fdaa22168c235p-3L ++#define M_PI_4l 0xc.90fdaa22168c235p-4L ++#define M_1_PIl 0xa.2f9836e4e44152ap-5L ++#define M_2_PIl 0xa.2f9836e4e44152ap-4L ++#define M_2_SQRTPIl 0x9.06eba8214db688dp-3L ++#define M_SQRT2l 0xb.504f333f9de6484p-3L ++#define M_SQRT1_2l 0xb.504f333f9de6484p-4L ++#endif /* defined __MATH_LONG_DOUBLE_CONSTANTS */ + +-#ifdef __WANT_EXTENSIONS__ ++/****************************************************************************** ++ * Legacy BSD extensions to the C standard * ++ ******************************************************************************/ + ++#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL + #define FP_SNAN FP_NAN + #define FP_QNAN FP_NAN + +@@ -560,11 +715,6 @@ + /* Legacy API: please use C99 lround() instead. */ + extern long int roundtol ( double ); + +-/* +- * XOPEN/SVID +- */ +-#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +-#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) + #if !defined(__cplusplus) + /* used by matherr below */ + struct exception { +@@ -592,19 +742,12 @@ + #define TLOSS 5 + #define PLOSS 6 + +-#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +-#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +- +-#if !defined( __STRICT_ANSI__) && !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) +- + /* Legacy API: please use C99 isfinite() instead. */ + extern int finite ( double ); + + /* Legacy API: please use C99 tgamma() instead. */ + extern double gamma ( double ); + +-#if (!defined(_XOPEN_SOURCE) || defined(_DARWIN_C_SOURCE)) +- + #if !defined(__cplusplus) + extern int matherr ( struct exception * ); + #endif +@@ -633,14 +776,8 @@ + extern double lgamma_r ( double, int * ) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; + extern long double lgammal_r ( long double, int * ) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER; + #endif /* _REENTRANT */ +- +-#endif /* (!_XOPEN_SOURCE || _DARWIN_C_SOURCE) */ +-#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ +- +-#endif /* __WANT_EXTENSIONS__ */ + +-#ifdef __cplusplus +-} +-#endif ++#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */ + +-#endif /* __MATH__ */ ++__END_DECLS ++#endif /* __MATH_H__ */ diff --git a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix index 38b13f784a3..998bc867e75 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix @@ -1,11 +1,19 @@ -{ lib, stdenv, appleDerivation', launchd, bootstrap_cmds, xnu, xpc, ppp, IOKit, eap8021x, Security +{ lib, stdenv, runCommand, appleDerivation', launchd, bootstrap_cmds, swift-corelibs-foundation, xnu, xpc, ppp, IOKit, eap8021x, Security , headersOnly ? false }: +let + privateHeaders = runCommand "swift-corelibs-foundation-private" { } '' + mkdir -p $out/include/CoreFoundation + + cp ${swift-corelibs-foundation}/Library/Frameworks/CoreFoundation.framework/PrivateHeaders/* \ + $out/include/CoreFoundation + ''; +in appleDerivation' stdenv { meta.broken = stdenv.cc.nativeLibc; nativeBuildInputs = lib.optionals (!headersOnly) [ bootstrap_cmds ]; - buildInputs = lib.optionals (!headersOnly) [ launchd ppp xpc IOKit eap8021x ]; + buildInputs = lib.optionals (!headersOnly) [ privateHeaders launchd ppp xpc IOKit eap8021x ]; propagatedBuildInputs = lib.optionals (!headersOnly) [ Security ]; @@ -13,7 +21,6 @@ appleDerivation' stdenv { NIX_CFLAGS_COMPILE = toString [ "-ISystemConfiguration.framework/Headers" "-I${xnu}/Library/Frameworks/System.framework/Versions/B/PrivateHeaders" - "-D_DNS_SD_LIBDISPATCH" # Needed for DNSServiceSetDispatchQueue to be available ]; }; @@ -23,11 +30,6 @@ appleDerivation' stdenv { substituteInPlace SystemConfiguration.fproj/SCNetworkReachability.c \ --replace ''$'#define\tHAVE_VPN_STATUS' "" - - # Our neutered CoreFoundation doesn't have this function, but I think we'll live... - substituteInPlace SystemConfiguration.fproj/SCNetworkConnectionPrivate.c \ - --replace 'CFPreferencesAppValueIsForced(serviceID, USER_PREFERENCES_APPLICATION_ID)' 'FALSE' \ - --replace 'CFPreferencesAppValueIsForced(userPrivate->serviceID, USER_PREFERENCES_APPLICATION_ID)' 'FALSE' ''; dontBuild = headersOnly; diff --git a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix index 30d123ab804..e4431c68c9a 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix @@ -5,12 +5,17 @@ let xnu-src = if stdenv.isAarch64 then macosPackages_11_0_1.xnu.src else xnu.src; arch = if stdenv.isAarch64 then "arm" else "i386"; in appleDerivation { + patches = [ + # Fixes a build failure with newer versions of clang that make implicit int an error. + ./fix-implicit-int.patch + ]; + nativeBuildInputs = [ xcbuildHook ]; buildInputs = [ libutil ]; env.NIX_CFLAGS_COMPILE = "-I."; NIX_LDFLAGS = "-lutil"; - patchPhase = '' + prePatch = '' # ugly hacks for missing headers # most are bsd related - probably should make this a drv unpackFile ${Libc.src} diff --git a/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/fix-implicit-int.patch b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/fix-implicit-int.patch new file mode 100644 index 00000000000..df0fff930da --- /dev/null +++ b/pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/fix-implicit-int.patch @@ -0,0 +1,11 @@ +diff -ur a/diskdev_cmds.xcodeproj/project.pbxproj b/diskdev_cmds.xcodeproj/project.pbxproj +--- a/quota.tproj/quota.c 2021-10-06 01:13:40.000000000 -0400 ++++ b/quota.tproj/quota.c 2023-10-27 08:24:05.960965958 -0400 +@@ -115,6 +115,7 @@ + + int + main(argc, argv) ++ int argc; + char *argv[]; + { + int ngroups; diff --git a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix index 72ef086f599..6a3bddc211e 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix @@ -32,6 +32,7 @@ appleDerivation { ]; meta = { + mainProgram = "iconv"; platforms = lib.platforms.darwin; }; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix b/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix index 4082f5b760c..0ba4caee628 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/mDNSResponder/default.nix @@ -4,6 +4,9 @@ appleDerivation' stdenvNoCC { dontBuild = true; installPhase = '' mkdir -p $out/include - cp mDNSShared/dns_sd.h $out/include + # TODO: Do this only for 765.50.9 once there is a way to apply version-specific + # logic in a source-release derivation. + substitute mDNSShared/dns_sd.h $out/include/dns_sd.h \ + --replace '#define _DNS_SD_LIBDISPATCH 0' '#define _DNS_SD_LIBDISPATCH 1' ''; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix b/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix index c99523d6c86..c6fc0094303 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/text_cmds/default.nix @@ -20,7 +20,12 @@ appleDerivation { done ''; - env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=format-security" ]; # hardeningDisable doesn't cut it + env.NIX_CFLAGS_COMPILE = toString [ + # hardeningDisable doesn't cut it + "-Wno-error=format-security" + # Required to build with clang 16 + "-Wno-error=deprecated-non-prototype" + ]; meta = { platforms = lib.platforms.darwin; diff --git a/pkgs/os-specific/darwin/coconutbattery/default.nix b/pkgs/os-specific/darwin/coconutbattery/default.nix index 69302baa92e..4850b2b4c04 100644 --- a/pkgs/os-specific/darwin/coconutbattery/default.nix +++ b/pkgs/os-specific/darwin/coconutbattery/default.nix @@ -5,11 +5,11 @@ stdenvNoCC.mkDerivation (finalAttrs: { pname = "coconutbattery"; - version = "3.9.12"; + version = "3.9.14"; src = fetchzip { url = "https://coconut-flavour.com/downloads/coconutBattery_${builtins.replaceStrings [ "." ] [ "" ] finalAttrs.version}.zip"; - hash = "sha256-8WxGjZbxUqchSIfvpK2RLifn7/TD5nau5hgMzLUiV2o="; + hash = "sha256-zKSPKwDBwxlyNJFurCLLGtba9gpizJCjOOAd81vdD5Q="; }; dontPatch = true; diff --git a/pkgs/os-specific/darwin/dark-mode-notify/default.nix b/pkgs/os-specific/darwin/dark-mode-notify/default.nix deleted file mode 100644 index 31d1a2c8d8b..00000000000 --- a/pkgs/os-specific/darwin/dark-mode-notify/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ lib -, fetchFromGitHub -, stdenv -, swift -, swiftpm -, darwin -}: - -stdenv.mkDerivation (final: { - pname = "dark-mode-notify"; - version = "unstable-2022-07-18"; - - src = fetchFromGitHub { - owner = "bouk"; - repo = "dark-mode-notify"; - rev = "4d7fe211f81c5b67402fad4bed44995344a260d1"; - hash = "sha256-LsAQ5v5jgJw7KsJnQ3Mh6+LNj1EMHICMoD5WzF3hRmU="; - }; - - nativeBuildInputs = [ - swift - swiftpm - ]; - - buildInputs = with darwin.apple_sdk.frameworks; [ - Foundation - Cocoa - ]; - - makeFlags = [ "prefix=$(out)" ]; - - meta = { - description = "Run a script whenever dark mode changes in macOS"; - homepage = "https://github.com/bouk/dark-mode-notify"; - # Doesn't build on x86_64 because of some CoreGraphics issue, even with SDK 11.0 - platforms = [ "aarch64-darwin" ]; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ YorikSar ]; - }; -}) diff --git a/pkgs/os-specific/darwin/ios-deploy/default.nix b/pkgs/os-specific/darwin/ios-deploy/default.nix index 6567093700d..c405ac8e1c8 100644 --- a/pkgs/os-specific/darwin/ios-deploy/default.nix +++ b/pkgs/os-specific/darwin/ios-deploy/default.nix @@ -1,35 +1,62 @@ -{ lib, stdenvNoCC, rsync, fetchFromGitHub }: +{ lib +, stdenv +, fetchFromGitHub +, darwin +, testers +}: -# Note this is impure, using system XCode to build ios-deploy. We -# should have a special flag for users to enable this. - -let version = "1.11.0"; -in stdenvNoCC.mkDerivation { +let + privateFrameworks = "/Library/Apple/System/Library/PrivateFrameworks"; +in +stdenv.mkDerivation (finalAttrs: { pname = "ios-deploy"; - inherit version; + version = "1.12.2"; + src = fetchFromGitHub { owner = "ios-control"; repo = "ios-deploy"; - rev = version; - sha256 = "0hqwikdrcnslx4kkw9b0n7n443gzn2gbrw15pp2fnkcw5s0698sc"; + rev = finalAttrs.version; + hash = "sha256-TVGC+f+1ow3b93CK3PhIL70le5SZxxb2ug5OkIg8XCA="; }; - nativeBuildInputs = [ rsync ]; + + buildInputs = [ + darwin.apple_sdk.frameworks.Foundation + ]; + buildPhase = '' - LD=$CC - tmp=$(mktemp -d) - ln -s /usr/bin/xcodebuild $tmp - export PATH="$PATH:$tmp" - xcodebuild -configuration Release SYMROOT=build OBJROOT=$tmp - ''; - checkPhase = '' - xcodebuild test -scheme ios-deploy-tests -configuration Release SYMROOT=build + runHook preBuild + + awk '{ print "\""$0"\\n\""}' src/scripts/lldb.py >> src/ios-deploy/lldb.py.h + clang src/ios-deploy/ios-deploy.m \ + -framework Foundation \ + -F${privateFrameworks} -framework MobileDevice \ + -o ios-deploy + + runHook postBuild ''; + installPhase = '' - install -D build/Release/ios-deploy $out/bin/ios-deploy + runHook preInstall + + install -Dm755 ios-deploy $out/bin/ios-deploy + + runHook postInstall ''; + + __impureHostDeps = [ + privateFrameworks + ]; + + passthru.tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + }; + meta = { + description = "Install and debug iPhone apps from the command line, without using Xcode"; + homepage = "https://github.com/ios-control/ios-deploy"; + license = lib.licenses.gpl3Plus; + mainProgram = "ios-deploy"; + maintainers = with lib.maintainers; [ wegank ]; platforms = lib.platforms.darwin; - description = "Install and debug iOS apps from the command line. Designed to work on un-jailbroken devices"; - license = lib.licenses.gpl3; }; -} +}) diff --git a/pkgs/os-specific/darwin/moltenvk/default.nix b/pkgs/os-specific/darwin/moltenvk/default.nix index 41f929fe90f..2293720d7fa 100644 --- a/pkgs/os-specific/darwin/moltenvk/default.nix +++ b/pkgs/os-specific/darwin/moltenvk/default.nix @@ -109,7 +109,7 @@ stdenv.mkDerivation (finalAttrs: { -configuration Release \ -project MoltenVKShaderConverter.xcodeproj \ -scheme MoltenVKShaderConverter \ - -arch ${stdenv.targetPlatform.darwinArch} + -arch ${stdenv.hostPlatform.darwinArch} declare -A products=( [MoltenVKShaderConverter]=bin [libMoltenVKShaderConverter.a]=lib ) for product in "''${!products[@]}"; do cp MoltenVKShaderConverter-*/Build/Products/Release/$product "$build/''${products[$product]}/$product" @@ -127,7 +127,7 @@ stdenv.mkDerivation (finalAttrs: { -configuration Release \ -project MoltenVK.xcodeproj \ -scheme MoltenVK-macOS \ - -arch ${stdenv.targetPlatform.darwinArch} + -arch ${stdenv.hostPlatform.darwinArch} cp MoltenVK-*/Build/Products/Release/dynamic/libMoltenVK.dylib "$build/lib/libMoltenVK.dylib" popd ''; diff --git a/pkgs/os-specific/darwin/raycast/default.nix b/pkgs/os-specific/darwin/raycast/default.nix index 4824bcff4f8..94476ef303e 100644 --- a/pkgs/os-specific/darwin/raycast/default.nix +++ b/pkgs/os-specific/darwin/raycast/default.nix @@ -6,12 +6,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { pname = "raycast"; - version = "1.57.1"; + version = "1.61.2"; src = fetchurl { name = "Raycast.dmg"; url = "https://releases.raycast.com/releases/${finalAttrs.version}/download?build=universal"; - hash = "sha256-ePHaNujW39LjMc+R2TZ1favJXeroHpbeuRNwmv8HgXc="; + hash = "sha256-MHJbVIVVDcuXig3E52wCnegt1mmRh9+kYbEL6MWjdqQ="; }; dontPatch = true; diff --git a/pkgs/os-specific/darwin/rectangle/default.nix b/pkgs/os-specific/darwin/rectangle/default.nix index b59c6051de7..590e6427d19 100644 --- a/pkgs/os-specific/darwin/rectangle/default.nix +++ b/pkgs/os-specific/darwin/rectangle/default.nix @@ -7,11 +7,11 @@ stdenvNoCC.mkDerivation rec { pname = "rectangle"; - version = "0.71"; + version = "0.74"; src = fetchurl { url = "https://github.com/rxhanson/Rectangle/releases/download/v${version}/Rectangle${version}.dmg"; - hash = "sha256-QsvEBTuLh5GyVzNTKaJAVwPNtYCc/3yH+U8VgXE4nk0="; + hash = "sha256-ERfzgw8R39dOc9F/dgcgCKbEVFNChC5LqDFBDzbS+Wg="; }; sourceRoot = "."; diff --git a/pkgs/os-specific/darwin/sketchybar/default.nix b/pkgs/os-specific/darwin/sketchybar/default.nix index 069fac3d59f..9b3ef924dd0 100644 --- a/pkgs/os-specific/darwin/sketchybar/default.nix +++ b/pkgs/os-specific/darwin/sketchybar/default.nix @@ -2,6 +2,7 @@ , stdenv , fetchFromGitHub , AppKit +, Carbon , CoreAudio , CoreWLAN , CoreVideo @@ -21,17 +22,18 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "sketchybar"; - version = "2.16.3"; + version = "2.19.4"; src = fetchFromGitHub { owner = "FelixKratz"; repo = "SketchyBar"; rev = "v${finalAttrs.version}"; - hash = "sha256-PCAGIcO7lvIAEFXlJn/e9zG5kxvDABshxFbu/bXWX7o="; + hash = "sha256-6MqTyCqFv5suQgQ5a9t1mDA2njjFFgk67Kp7xO5OXoA="; }; buildInputs = [ AppKit + Carbon CoreAudio CoreWLAN CoreVideo diff --git a/pkgs/os-specific/darwin/skhd/default.nix b/pkgs/os-specific/darwin/skhd/default.nix index fa6e1aa01e9..f979f7ec020 100644 --- a/pkgs/os-specific/darwin/skhd/default.nix +++ b/pkgs/os-specific/darwin/skhd/default.nix @@ -26,6 +26,8 @@ stdenv.mkDerivation (finalAttrs: { "BUILD_PATH=$(out)/bin" ]; + env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; + postInstall = '' mkdir -p $out/Library/LaunchDaemons cp ${./org.nixos.skhd.plist} $out/Library/LaunchDaemons/org.nixos.skhd.plist diff --git a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix index d77976773c6..5c593b1488e 100644 --- a/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix +++ b/pkgs/os-specific/darwin/swift-corelibs/corefoundation.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, fetchurl, makeSetupHook, cmake, ninja, pkg-config, launchd, libdispatch, python3, libxml2, objc4, icu }: +{ lib, stdenv, fetchFromGitHub, fetchurl, makeSetupHook, cmake, pkg-config, launchd, libdispatch, python3Minimal, libxml2, objc4, icu }: let # 10.12 adds a new sysdir.h that our version of CF in the main derivation depends on, but @@ -21,7 +21,7 @@ stdenv.mkDerivation { sha256 = "17kpql0f27xxz4jjw84vpas5f5sn4vdqwv10g151rc3rswbwln1z"; }; - nativeBuildInputs = [ cmake ninja pkg-config python3 ]; + nativeBuildInputs = [ cmake pkg-config python3Minimal ]; buildInputs = [ (lib.getDev launchd) libdispatch libxml2 objc4 icu ]; patches = [ diff --git a/pkgs/os-specific/darwin/utm/default.nix b/pkgs/os-specific/darwin/utm/default.nix index d3aea920972..f7055d378cb 100644 --- a/pkgs/os-specific/darwin/utm/default.nix +++ b/pkgs/os-specific/darwin/utm/default.nix @@ -7,11 +7,11 @@ stdenvNoCC.mkDerivation rec { pname = "utm"; - version = "4.3.5"; + version = "4.4.4"; src = fetchurl { url = "https://github.com/utmapp/UTM/releases/download/v${version}/UTM.dmg"; - hash = "sha256-aDIjf4TqhSIgYaJulI5FgXxlNiZ1qcNY+Typ7+S5Hc8="; + hash = "sha256-SyrqkNWRUKQS3D17XYsC/dcCKlPLGNNsG5obEiHE1Lk="; }; nativeBuildInputs = [ undmg makeWrapper ]; diff --git a/pkgs/os-specific/darwin/yabai/default.nix b/pkgs/os-specific/darwin/yabai/default.nix index 14d3ccbc046..841746957c7 100644 --- a/pkgs/os-specific/darwin/yabai/default.nix +++ b/pkgs/os-specific/darwin/yabai/default.nix @@ -17,7 +17,7 @@ let pname = "yabai"; - version = "5.0.8"; + version = "6.0.1"; test-version = testers.testVersion { package = yabai; @@ -53,7 +53,7 @@ in src = fetchzip { url = "https://github.com/koekeishiya/yabai/releases/download/v${version}/yabai-v${version}.tar.gz"; - hash = "sha256-w4MTHHYWwBq0/WkemYIeV49aA/DzFxXITD8gF5St0Yo="; + hash = "sha256-CXkGVoJcGSkooxe7eIhwaM6FkOI45NVw5jdLJAzgFBM="; }; nativeBuildInputs = [ @@ -89,7 +89,7 @@ in owner = "koekeishiya"; repo = "yabai"; rev = "v${version}"; - hash = "sha256-VahfeKYz/cATb0RF9QykngMtRpCh392jY8aJuggpqMU="; + hash = "sha256-u+MkGd/rkT1RVkzC2IcAcFM9eClFdj3WBFnftUVwkwc="; }; nativeBuildInputs = [ |