···128128 # the system-fileio tests use canonicalizePath, which fails in the sandbox
129129 system-fileio = if pkgs.stdenv.isDarwin then dontCheck super.system-fileio else super.system-fileio;
130130131131- # Prevents needing to add `security_tool` as a run-time dependency for
132132- # everything using x509-system to give access to the `security` executable.
133133- x509-system = if pkgs.stdenv.hostPlatform.isDarwin && !pkgs.stdenv.cc.nativeLibc
134134- then let inherit (pkgs.darwin) security_tool;
135135- in pkgs.lib.overrideDerivation (addBuildDepend super.x509-system security_tool) (drv: {
136136- # darwin.security_tool is broken in Mojave (#45042)
137137-138138- # We will use the system provided security for now.
139139- # Beware this WILL break in sandboxes!
140140-141141- # TODO(matthewbauer): If someone really needs this to work in sandboxes,
142142- # I think we can add a propagatedImpureHost dep here, but I’m hoping to
143143- # get a proper fix available soonish.
144144- postPatch = (drv.postPatch or "") + ''
145145- substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security
146146- '';
147147- })
148148- else super.x509-system;
149149-150131 # https://github.com/NixOS/cabal2nix/issues/136 and https://github.com/NixOS/cabal2nix/issues/216
151132 gio = disableHardening (addPkgconfigDepend (addBuildTool super.gio self.buildHaskellPackages.gtk2hs-buildtools) pkgs.glib) ["fortify"];
152133 glib = disableHardening (addPkgconfigDepend (addBuildTool super.glib self.buildHaskellPackages.gtk2hs-buildtools) pkgs.glib) ["fortify"];
···11-{ stdenv, fetchurl, xar, xz, cpio, pkgs, python, lib }:
11+{ stdenv, fetchurl, xar, cpio, pkgs, python, pbzx, lib }:
2233let
44- # TODO: make this available to other packages and generalize the unpacking a bit
55- # from https://gist.github.com/pudquick/ff412bcb29c9c1fa4b8d
66- # This isn't needed until we get to SDK 10.11, but that presents other challenges
77- # unpbzx = fetchurl {
88- # url = "https://gist.githubusercontent.com/pudquick/ff412bcb29c9c1fa4b8d/raw/24b25538ea8df8d0634a2a6189aa581ccc6a5b4b/parse_pbzx2.py";
99- # sha256 = "0jgp6qbfl36i0jlz7as5zk2w20z4ca8wlrhdw49lwsld6wi3rfhc";
1010- # };
1111-124 # sadly needs to be exported because security_tool needs it
135 sdk = stdenv.mkDerivation rec {
1414- version = "10.10";
66+ version = "10.12";
157 name = "MacOS_SDK-${version}";
1681717- # This URL comes from https://swscan.apple.com/content/catalogs/others/index-10.10.merged-1.sucatalog, which we found by:
99+ # This URL comes from https://swscan.apple.com/content/catalogs/others/index-10.12.merged-1.sucatalog, which we found by:
1810 # 1. Google: site:swscan.apple.com and look for a name that seems appropriate for your version
1911 # 2. In the resulting file, search for a file called DevSDK ending in .pkg
2012 # 3. ???
2113 # 4. Profit
2214 src = fetchurl {
2323- url = "http://swcdn.apple.com/content/downloads/22/52/031-45139/hcjjv7cm4n6yqk56ict73qqw15ikm5iaql/DevSDK_OSX1010.pkg";
2424- sha256 = "08bxa93zw7r4vzs28j9giq2qyk3b68ky6jx1bb9850gflr3nvgq1";
1515+ url = "http://swcdn.apple.com/content/downloads/28/09/091-29862/pafhn2u002b9slnrxzy9p86rpedycnjhb5/DevSDK_OSX1012.pkg";
1616+ sha256 = "1sggc70rypqwcjwr7ciavw8sczwll16cwqxdxrbw7r2qvy3b0nhx";
2517 };
26182727- buildInputs = [ xar xz cpio python ];
1919+ buildInputs = [ xar cpio python pbzx ];
28202921 phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
3022 outputs = [ "out" "dev" "man" ];
···3729 start="$(pwd)"
3830 mkdir -p $out
3931 cd $out
4040- cat $start/Payload | gzip -d | cpio -idm
3232+ pbzx -n $start/Payload | cpio -idm
41334234 mv usr/* .
4335 rmdir usr
···11+/*
22+ * Copyright (c) 2010 Apple Inc. All rights reserved.
33+ *
44+ * @APPLE_LICENSE_HEADER_START@
55+ *
66+ * This file contains Original Code and/or Modifications of Original Code
77+ * as defined in and that are subject to the Apple Public Source License
88+ * Version 2.0 (the 'License'). You may not use this file except in
99+ * compliance with the License. Please obtain a copy of the License at
1010+ * http://www.opensource.apple.com/apsl/ and read it before using this
1111+ * file.
1212+ *
1313+ * The Original Code and all software distributed under the License are
1414+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1515+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
1616+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
1717+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
1818+ * Please see the License for the specific language governing rights and
1919+ * limitations under the License.
2020+ *
2121+ * @APPLE_LICENSE_HEADER_END@
2222+ */
2323+2424+/***********************************************************************
2525+ * Not to be installed in /usr/local/include
2626+ ***********************************************************************/
2727+2828+#ifndef _LIBC_CRASHREPORTERCLIENT_H
2929+#define _LIBC_CRASHREPORTERCLIENT_H
3030+3131+#include "stdint.h"
3232+3333+/* Fake the CrashReporterClient API */
3434+#define CRGetCrashLogMessage() 0
3535+#define CRSetCrashLogMessage(m) true
3636+3737+#define CRASH_REPORTER_CLIENT_HIDDEN __attribute__((visibility("hidden")))
3838+#define CRASHREPORTER_ANNOTATIONS_VERSION 4
3939+#define CRASHREPORTER_ANNOTATIONS_SECTION "__crash_info"
4040+4141+struct crashreporter_annotations_t {
4242+ uint64_t version; // unsigned long
4343+ uint64_t message; // char *
4444+ uint64_t signature_string; // char *
4545+ uint64_t backtrace; // char *
4646+ uint64_t message2; // char *
4747+ uint64_t thread; // uint64_t
4848+ uint64_t dialog_mode; // unsigned int
4949+};
5050+5151+#endif
···1111 export PRIVATE_HEADERS_FOLDER_PATH=include
1212 bash xcodescripts/headers.sh
13131414+ cp ${./CrashReporterClient.h} $out/include/CrashReporterClient.h
1515+1416 cp ${Libc_10-9}/include/NSSystemDirectories.h $out/include
15171618 # Ugh Apple stopped releasing this stuff so we need an older one...