Skip to content
Permalink
Browse files

Revert "Revert "darwin 10.12 commits""

This reverts commit 8505e71.
  • Loading branch information...
matthewbauer committed Feb 7, 2019
1 parent 4c3c8f4 commit d69cc779b520ea74a5b52fa5691f3f8fd7fe9cf3
Showing with 695 additions and 1,606 deletions.
  1. +0 −19 pkgs/development/haskell-modules/configuration-nix.nix
  2. +1 −0 pkgs/development/tools/xcbuild/toolchains.nix
  3. +7 −15 pkgs/os-specific/darwin/apple-sdk/default.nix
  4. +51 −0 pkgs/os-specific/darwin/apple-source-releases/Libc/CrashReporterClient.h
  5. +2 −0 pkgs/os-specific/darwin/apple-source-releases/Libc/default.nix
  6. +12 −8 pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
  7. +27 −0 pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_c_symbols
  8. +158 −0 pkgs/os-specific/darwin/apple-source-releases/Libsystem/system_kernel_symbols
  9. +116 −0 pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix
  10. +11 −108 pkgs/os-specific/darwin/apple-source-releases/Security/default.nix
  11. +0 −42 pkgs/os-specific/darwin/apple-source-releases/SmartCardServices/default.nix
  12. +91 −0 pkgs/os-specific/darwin/apple-source-releases/adv_cmds/boot.nix
  13. +31 −72 pkgs/os-specific/darwin/apple-source-releases/adv_cmds/default.nix
  14. +0 −59 pkgs/os-specific/darwin/apple-source-releases/adv_cmds/xcode.nix
  15. +1 −0 pkgs/os-specific/darwin/apple-source-releases/bootstrap_cmds/default.nix
  16. +56 −83 pkgs/os-specific/darwin/apple-source-releases/default.nix
  17. +2 −2 pkgs/os-specific/darwin/apple-source-releases/diskdev_cmds/default.nix
  18. +41 −38 pkgs/os-specific/darwin/apple-source-releases/dtrace/default.nix
  19. +0 −47 pkgs/os-specific/darwin/apple-source-releases/dtrace/xcode.nix
  20. +2 −2 pkgs/os-specific/darwin/apple-source-releases/file_cmds/default.nix
  21. +8 −0 pkgs/os-specific/darwin/apple-source-releases/hfs/default.nix
  22. +0 −11 pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_csp/GNUmakefile
  23. +0 −31 pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_csp/default.nix
  24. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_cspdl/GNUmakefile
  25. +0 −16 pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_cspdl/default.nix
  26. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_file_dl/GNUmakefile
  27. +0 −17 pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_file_dl/default.nix
  28. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_x509_cl/GNUmakefile
  29. +0 −18 pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_x509_cl/default.nix
  30. +0 −11 pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_x509_tp/GNUmakefile
  31. +0 −19 pkgs/os-specific/darwin/apple-source-releases/libsecurity_apple_x509_tp/default.nix
  32. +0 −11 pkgs/os-specific/darwin/apple-source-releases/libsecurity_asn1/GNUmakefile
  33. +0 −14 pkgs/os-specific/darwin/apple-source-releases/libsecurity_asn1/default.nix
  34. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cdsa_client/GNUmakefile
  35. +0 −8 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cdsa_client/default.nix
  36. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cdsa_plugin/GNUmakefile
  37. +0 −15 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cdsa_plugin/default.nix
  38. +0 −13 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cdsa_utilities/GNUmakefile
  39. +0 −13 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cdsa_utilities/default.nix
  40. +0 −19 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cdsa_utilities/handletemplates.patch
  41. +0 −13 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cdsa_utils/GNUmakefile
  42. +0 −8 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cdsa_utils/default.nix
  43. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_codesigning/GNUmakefile
  44. +0 −33 pkgs/os-specific/darwin/apple-source-releases/libsecurity_codesigning/default.nix
  45. +0 −11 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cssm/GNUmakefile
  46. +0 −14 pkgs/os-specific/darwin/apple-source-releases/libsecurity_cssm/default.nix
  47. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_filedb/GNUmakefile
  48. +0 −13 pkgs/os-specific/darwin/apple-source-releases/libsecurity_filedb/default.nix
  49. +0 −63 pkgs/os-specific/darwin/apple-source-releases/libsecurity_generic/default.nix
  50. +0 −128 pkgs/os-specific/darwin/apple-source-releases/libsecurity_generic/impure_deps.nix
  51. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_keychain/GNUmakefile
  52. +0 −43 pkgs/os-specific/darwin/apple-source-releases/libsecurity_keychain/default.nix
  53. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_mds/GNUmakefile
  54. +0 −11 pkgs/os-specific/darwin/apple-source-releases/libsecurity_mds/default.nix
  55. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_ocspd/GNUmakefile
  56. +0 −20 pkgs/os-specific/darwin/apple-source-releases/libsecurity_ocspd/default.nix
  57. +0 −11 pkgs/os-specific/darwin/apple-source-releases/libsecurity_pkcs12/GNUmakefile
  58. +0 −15 pkgs/os-specific/darwin/apple-source-releases/libsecurity_pkcs12/default.nix
  59. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_sd_cspdl/GNUmakefile
  60. +0 −10 pkgs/os-specific/darwin/apple-source-releases/libsecurity_sd_cspdl/default.nix
  61. +0 −11 pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/GNUmakefile
  62. +0 −28 pkgs/os-specific/darwin/apple-source-releases/libsecurity_utilities/default.nix
  63. +0 −11 pkgs/os-specific/darwin/apple-source-releases/libsecurityd/GNUmakefile
  64. +0 −23 pkgs/os-specific/darwin/apple-source-releases/libsecurityd/default.nix
  65. +0 −79 pkgs/os-specific/darwin/apple-source-releases/libsecurityd/xdr-arity.patch
  66. +23 −3 pkgs/os-specific/darwin/apple-source-releases/libutil/default.nix
  67. +0 −29 pkgs/os-specific/darwin/apple-source-releases/libutil/new.nix
  68. +0 −8 pkgs/os-specific/darwin/apple-source-releases/security_dotmac_tp/GNUmakefile
  69. +0 −4 pkgs/os-specific/darwin/apple-source-releases/security_dotmac_tp/default.nix
  70. +0 −32 pkgs/os-specific/darwin/apple-source-releases/security_systemkeychain/default.nix
  71. +2 −2 pkgs/os-specific/darwin/apple-source-releases/top/default.nix
  72. +50 −43 pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
  73. +3 −0 pkgs/os-specific/darwin/darling/default.nix
  74. +0 −14 pkgs/os-specific/darwin/security-tool/GNUmakefile
  75. +0 −101 pkgs/os-specific/darwin/security-tool/default.nix
  76. +0 −4 pkgs/top-level/darwin-packages.nix
@@ -128,25 +128,6 @@ self: super: builtins.intersectAttrs super {
# the system-fileio tests use canonicalizePath, which fails in the sandbox
system-fileio = if pkgs.stdenv.isDarwin then dontCheck super.system-fileio else super.system-fileio;

# Prevents needing to add `security_tool` as a run-time dependency for
# everything using x509-system to give access to the `security` executable.
x509-system = if pkgs.stdenv.hostPlatform.isDarwin && !pkgs.stdenv.cc.nativeLibc
then let inherit (pkgs.darwin) security_tool;
in pkgs.lib.overrideDerivation (addBuildDepend super.x509-system security_tool) (drv: {
# darwin.security_tool is broken in Mojave (#45042)

# We will use the system provided security for now.
# Beware this WILL break in sandboxes!

# TODO(matthewbauer): If someone really needs this to work in sandboxes,
# I think we can add a propagatedImpureHost dep here, but I’m hoping to
# get a proper fix available soonish.
postPatch = (drv.postPatch or "") + ''
substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security
'';
})
else super.x509-system;

# https://github.com/NixOS/cabal2nix/issues/136 and https://github.com/NixOS/cabal2nix/issues/216
gio = disableHardening (addPkgconfigDepend (addBuildTool super.gio self.buildHaskellPackages.gtk2hs-buildtools) pkgs.glib) ["fortify"];
glib = disableHardening (addPkgconfigDepend (addBuildTool super.glib self.buildHaskellPackages.gtk2hs-buildtools) pkgs.glib) ["fortify"];
@@ -67,6 +67,7 @@ runCommand "Toolchains" {} (''
done
ln -s ${buildPackages.darwin.bootstrap_cmds}/bin/mig $toolchain/bin
mkdir -p $toolchain/libexec
ln -s ${buildPackages.darwin.bootstrap_cmds}/libexec/migcom $toolchain/libexec
ln -s ${mkdep-darwin-src} $toolchain/bin/mkdep
'')
@@ -1,30 +1,22 @@
{ stdenv, fetchurl, xar, xz, cpio, pkgs, python, lib }:
{ stdenv, fetchurl, xar, cpio, pkgs, python, pbzx, lib }:

let
# TODO: make this available to other packages and generalize the unpacking a bit
# from https://gist.github.com/pudquick/ff412bcb29c9c1fa4b8d
# This isn't needed until we get to SDK 10.11, but that presents other challenges
# unpbzx = fetchurl {
# url = "https://gist.githubusercontent.com/pudquick/ff412bcb29c9c1fa4b8d/raw/24b25538ea8df8d0634a2a6189aa581ccc6a5b4b/parse_pbzx2.py";
# sha256 = "0jgp6qbfl36i0jlz7as5zk2w20z4ca8wlrhdw49lwsld6wi3rfhc";
# };

# sadly needs to be exported because security_tool needs it
sdk = stdenv.mkDerivation rec {
version = "10.10";
version = "10.12";
name = "MacOS_SDK-${version}";

# This URL comes from https://swscan.apple.com/content/catalogs/others/index-10.10.merged-1.sucatalog, which we found by:
# This URL comes from https://swscan.apple.com/content/catalogs/others/index-10.12.merged-1.sucatalog, which we found by:
# 1. Google: site:swscan.apple.com and look for a name that seems appropriate for your version
# 2. In the resulting file, search for a file called DevSDK ending in .pkg
# 3. ???
# 4. Profit
src = fetchurl {
url = "http://swcdn.apple.com/content/downloads/22/52/031-45139/hcjjv7cm4n6yqk56ict73qqw15ikm5iaql/DevSDK_OSX1010.pkg";
sha256 = "08bxa93zw7r4vzs28j9giq2qyk3b68ky6jx1bb9850gflr3nvgq1";
url = "http://swcdn.apple.com/content/downloads/28/09/091-29862/pafhn2u002b9slnrxzy9p86rpedycnjhb5/DevSDK_OSX1012.pkg";
sha256 = "1sggc70rypqwcjwr7ciavw8sczwll16cwqxdxrbw7r2qvy3b0nhx";
};

buildInputs = [ xar xz cpio python ];
buildInputs = [ xar cpio python pbzx ];

phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
outputs = [ "out" "dev" "man" ];
@@ -37,7 +29,7 @@ let
start="$(pwd)"
mkdir -p $out
cd $out
cat $start/Payload | gzip -d | cpio -idm
pbzx -n $start/Payload | cpio -idm
mv usr/* .
rmdir usr
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2010 Apple Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/

/***********************************************************************
* Not to be installed in /usr/local/include
***********************************************************************/

#ifndef _LIBC_CRASHREPORTERCLIENT_H
#define _LIBC_CRASHREPORTERCLIENT_H

#include "stdint.h"

/* Fake the CrashReporterClient API */
#define CRGetCrashLogMessage() 0
#define CRSetCrashLogMessage(m) true

#define CRASH_REPORTER_CLIENT_HIDDEN __attribute__((visibility("hidden")))
#define CRASHREPORTER_ANNOTATIONS_VERSION 4
#define CRASHREPORTER_ANNOTATIONS_SECTION "__crash_info"

struct crashreporter_annotations_t {
uint64_t version; // unsigned long
uint64_t message; // char *
uint64_t signature_string; // char *
uint64_t backtrace; // char *
uint64_t message2; // char *
uint64_t thread; // uint64_t
uint64_t dialog_mode; // unsigned int
};

#endif
@@ -11,6 +11,8 @@ appleDerivation {
export PRIVATE_HEADERS_FOLDER_PATH=include
bash xcodescripts/headers.sh
cp ${./CrashReporterClient.h} $out/include/CrashReporterClient.h
cp ${Libc_10-9}/include/NSSystemDirectories.h $out/include
# Ugh Apple stopped releasing this stuff so we need an older one...
@@ -1,9 +1,11 @@
{ stdenv, appleDerivation, cpio, xnu, Libc, Libm, libdispatch, cctools, Libinfo,
dyld, Csu, architecture, libclosure, CarbonHeaders, ncurses, CommonCrypto, copyfile,
removefile, libresolv, Libnotify, libplatform, libpthread, mDNSResponder, launchd, libutil }:
{ stdenv, appleDerivation, cpio, xnu, Libc, Libm, libdispatch, cctools, Libinfo
, dyld, Csu, architecture, libclosure, CarbonHeaders, ncurses, CommonCrypto
, copyfile, removefile, libresolv, Libnotify, libplatform, libpthread
, mDNSResponder, launchd, libutil, hfs }:

appleDerivation rec {
phases = [ "unpackPhase" "installPhase" ];
dontBuild = true;
dontFixup = true;

nativeBuildInputs = [ cpio ];

@@ -17,19 +19,21 @@ appleDerivation rec {
cp ${xnu}/Library/Frameworks/Kernel.framework/Versions/A/Headers/Availability*.h $out/include
cp ${xnu}/Library/Frameworks/Kernel.framework/Versions/A/Headers/stdarg.h $out/include
for dep in ${Libc} ${Libm} ${Libinfo} ${dyld} ${architecture} ${libclosure} ${CarbonHeaders} \
${libdispatch} ${ncurses.dev} ${CommonCrypto} ${copyfile} ${removefile} ${libresolv} \
${Libnotify} ${libplatform} ${mDNSResponder} ${launchd} ${libutil} ${libpthread}; do
for dep in ${Libc} ${Libm} ${Libinfo} ${dyld} ${architecture} \
${libclosure} ${CarbonHeaders} ${libdispatch} ${ncurses.dev} \
${CommonCrypto} ${copyfile} ${removefile} ${libresolv} \
${Libnotify} ${libplatform} ${mDNSResponder} ${launchd} \
${libutil} ${libpthread} ${hfs}; do
(cd $dep/include && find . -name '*.h' | cpio -pdm $out/include)
done
(cd ${cctools.dev}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o)
cat <<EOF > $out/include/TargetConditionals.h
#ifndef __TARGETCONDITIONALS__
#define __TARGETCONDITIONALS__
#define TARGET_OS_MAC 1
#define TARGET_OS_OSX 1
#define TARGET_OS_WIN32 0
#define TARGET_OS_UNIX 0
#define TARGET_OS_EMBEDDED 0
@@ -232,6 +232,8 @@ __os_assert_log_ctx
__os_assumes_log
__os_assumes_log_ctx
__os_avoid_tail_call
__os_crash
__os_crash_callback
__os_debug_log
__os_debug_log_error_str
__putenvp
@@ -263,6 +265,7 @@ __unsetenvp
__utmpxname
_a64l
_abort
_abort_report_np
_abs
_acl_add_flag_np
_acl_add_perm
@@ -345,6 +348,7 @@ _backtrace
_backtrace_symbols
_backtrace_symbols_fd
_basename
_basename_r
_bcmp
_bcopy
_brk
@@ -377,8 +381,12 @@ _chmodx_np
_clearerr
_clearerr_unlocked
_clock
_clock_getres
_clock_gettime
_clock_gettime_nsec_np
_clock_port
_clock_sem
_clock_settime
_closedir
_compat_mode
_confstr
@@ -411,6 +419,7 @@ _digittoint
_digittoint_l
_dirfd
_dirname
_dirname_r
_div
_dprintf
_dprintf_l
@@ -771,8 +780,12 @@ _mergesort_b
_mkdirx_np
_mkdtemp
_mkfifox_np
_mkostemp
_mkostemps
_mkpath_np
_mkpathat_np
_mkstemp
_mkstemp_dprotected_np
_mkstemps
_mktemp
_mktime
@@ -805,6 +818,7 @@ _nice
_nl_langinfo
_nl_langinfo_l
_nrand48
_nvis
_off32
_off64
_offtime
@@ -959,6 +973,7 @@ _sleep
_sleep$NOCANCEL
_snprintf
_snprintf_l
_snvis
_sockatmark
_sprintf
_sprintf_l
@@ -988,6 +1003,7 @@ _strcoll_l
_strcpy
_strcspn
_strdup
_strenvisx
_strerror
_strerror_r
_strfmon
@@ -1006,14 +1022,23 @@ _strncpy
_strndup
_strnlen
_strnstr
_strnunvis
_strnunvisx
_strnvis
_strnvisx
_strpbrk
_strptime
_strptime_l
_strrchr
_strsenvisx
_strsep
_strsignal
_strsnvis
_strsnvisx
_strspn
_strstr
_strsvis
_strsvisx
_strtod
_strtod_l
_strtof
@@ -1046,6 +1071,7 @@ _strvisx
_strxfrm
_strxfrm_l
_suboptarg
_svis
_swab
_swprintf
_swprintf_l
@@ -1087,6 +1113,7 @@ _timelocal
_timeoff
_times
_timezone
_timingsafe_bcmp
_tmpfile
_tmpnam
_toascii

0 comments on commit d69cc77

Please sign in to comment.
You can’t perform that action at this time.