uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
19
pkgs/os-specific/darwin/CoreSymbolication/default.nix
Normal file
19
pkgs/os-specific/darwin/CoreSymbolication/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{ fetchFromGitHub, stdenv }:
|
||||
|
||||
# Reverse engineered CoreSymbolication to make dtrace buildable
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "CoreSymbolication";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
repo = name;
|
||||
owner = "matthewbauer";
|
||||
rev = "671fcb66c82eac1827f3f53dc4cc4e9b1b94da0a";
|
||||
sha256 = "0qpw46gwgjxiwqqjxksb8yghp2q8dwad6hzaf4zl82xpvk9n5ahj";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
cp -r CoreSymbolication $out/include
|
||||
'';
|
||||
}
|
||||
36
pkgs/os-specific/darwin/DarwinTools/default.nix
Normal file
36
pkgs/os-specific/darwin/DarwinTools/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib, stdenv, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "DarwinTools";
|
||||
version = "1";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://opensource.apple.com/tarballs/DarwinTools/DarwinTools-${version}.tar.gz";
|
||||
sha256 = "0hh4jl590jv3v830p77r3jcrnpndy7p2b8ajai3ldpnx2913jfhp";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./sw_vers-CFPriv.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace gcc cc
|
||||
'';
|
||||
|
||||
configurePhase = ''
|
||||
export SRCROOT=.
|
||||
export SYMROOT=.
|
||||
export DSTROOT=$out
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mv $out/usr/* $out
|
||||
rmdir $out/usr
|
||||
'';
|
||||
|
||||
meta = {
|
||||
maintainers = [ lib.maintainers.matthewbauer ];
|
||||
platforms = lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
19
pkgs/os-specific/darwin/DarwinTools/sw_vers-CFPriv.patch
Normal file
19
pkgs/os-specific/darwin/DarwinTools/sw_vers-CFPriv.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
--- a/sw_vers.c 2021-04-19 13:06:50.131346864 +0900
|
||||
+++ b/sw_vers.c 2021-04-19 13:07:32.481967474 +0900
|
||||
@@ -28,7 +28,15 @@
|
||||
*/
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
-#include <CoreFoundation/CFPriv.h>
|
||||
+
|
||||
+// Avoid dependency on CoreFoundation/CFPriv, which no longer appears to be
|
||||
+// part of the upstream sdk.
|
||||
+
|
||||
+CFDictionaryRef _CFCopyServerVersionDictionary(void);
|
||||
+CFDictionaryRef _CFCopySystemVersionDictionary(void);
|
||||
+extern CFStringRef _kCFSystemVersionProductNameKey;
|
||||
+extern CFStringRef _kCFSystemVersionProductVersionKey;
|
||||
+extern CFStringRef _kCFSystemVersionBuildVersionKey;
|
||||
|
||||
void usage(char *progname) {
|
||||
fprintf(stderr, "Usage: %s [-productName|-productVersion|-buildVersion]\n", progname);
|
||||
181
pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix
Normal file
181
pkgs/os-specific/darwin/apple-sdk-11.0/apple_sdk.nix
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
{ lib, stdenvNoCC, buildPackages, fetchurl, xar, cpio, pkgs, python3, pbzx, MacOSX-SDK }:
|
||||
|
||||
# TODO: reorganize to make this just frameworks, and move libs to default.nix
|
||||
|
||||
let
|
||||
stdenv = stdenvNoCC;
|
||||
|
||||
standardFrameworkPath = name: private:
|
||||
"/System/Library/${lib.optionalString private "Private"}Frameworks/${name}.framework";
|
||||
|
||||
mkDepsRewrites = deps:
|
||||
let
|
||||
mergeRewrites = x: y: {
|
||||
prefix = lib.mergeAttrs (x.prefix or {}) (y.prefix or {});
|
||||
const = lib.mergeAttrs (x.const or {}) (y.const or {});
|
||||
};
|
||||
|
||||
rewriteArgs = { prefix ? {}, const ? {} }: lib.concatLists (
|
||||
(lib.mapAttrsToList (from: to: [ "-p" "${from}:${to}" ]) prefix) ++
|
||||
(lib.mapAttrsToList (from: to: [ "-c" "${from}:${to}" ]) const)
|
||||
);
|
||||
|
||||
rewrites = depList: lib.fold mergeRewrites {}
|
||||
(map (dep: dep.tbdRewrites)
|
||||
(lib.filter (dep: dep ? tbdRewrites) depList));
|
||||
in
|
||||
lib.escapeShellArgs (rewriteArgs (rewrites (builtins.attrValues deps)));
|
||||
|
||||
mkFramework = { name, deps, private ? false }:
|
||||
let self = stdenv.mkDerivation {
|
||||
pname = "apple-${lib.optionalString private "private-"}framework-${name}";
|
||||
version = MacOSX-SDK.version;
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
# because we copy files from the system
|
||||
preferLocalBuild = true;
|
||||
|
||||
disallowedRequisites = [ MacOSX-SDK ];
|
||||
|
||||
nativeBuildInputs = [ buildPackages.darwin.rewrite-tbd ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/Library/Frameworks
|
||||
|
||||
cp -r ${MacOSX-SDK}${standardFrameworkPath name private} $out/Library/Frameworks
|
||||
|
||||
# Fix and check tbd re-export references
|
||||
chmod u+w -R $out
|
||||
find $out -name '*.tbd' -type f | while read tbd; do
|
||||
echo "Fixing re-exports in $tbd"
|
||||
rewrite-tbd \
|
||||
-p ${standardFrameworkPath name private}/:$out/Library/Frameworks/${name}.framework/ \
|
||||
${mkDepsRewrites deps} \
|
||||
-r ${builtins.storeDir} \
|
||||
"$tbd"
|
||||
done
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = builtins.attrValues deps;
|
||||
|
||||
passthru = {
|
||||
tbdRewrites = {
|
||||
prefix."${standardFrameworkPath name private}/" = "${self}/Library/Frameworks/${name}.framework/";
|
||||
};
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Apple SDK framework ${name}";
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
};
|
||||
};
|
||||
in self;
|
||||
|
||||
framework = name: deps: mkFramework { inherit name deps; private = false; };
|
||||
privateFramework = name: deps: mkFramework { inherit name deps; private = true; };
|
||||
in rec {
|
||||
libs = {
|
||||
xpc = stdenv.mkDerivation {
|
||||
name = "apple-lib-xpc";
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
pushd $out/include >/dev/null
|
||||
cp -r "${MacOSX-SDK}/usr/include/xpc" $out/include/xpc
|
||||
cp "${MacOSX-SDK}/usr/include/launch.h" $out/include/launch.h
|
||||
popd >/dev/null
|
||||
'';
|
||||
};
|
||||
|
||||
Xplugin = stdenv.mkDerivation {
|
||||
name = "apple-lib-Xplugin";
|
||||
dontUnpack = true;
|
||||
|
||||
propagatedBuildInputs = with frameworks; [
|
||||
OpenGL ApplicationServices Carbon IOKit CoreGraphics CoreServices CoreText
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include $out/lib
|
||||
ln -s "${MacOSX-SDK}/include/Xplugin.h" $out/include/Xplugin.h
|
||||
cp ${MacOSX-SDK}/usr/lib/libXplugin.1.tbd $out/lib
|
||||
ln -s libXplugin.1.tbd $out/lib/libXplugin.tbd
|
||||
'';
|
||||
};
|
||||
|
||||
utmp = stdenv.mkDerivation {
|
||||
name = "apple-lib-utmp";
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
pushd $out/include >/dev/null
|
||||
ln -s "${MacOSX-SDK}/include/utmp.h"
|
||||
ln -s "${MacOSX-SDK}/include/utmpx.h"
|
||||
popd >/dev/null
|
||||
'';
|
||||
};
|
||||
|
||||
sandbox = stdenv.mkDerivation {
|
||||
name = "apple-lib-sandbox";
|
||||
|
||||
dontUnpack = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include $out/lib
|
||||
ln -s "${MacOSX-SDK}/usr/include/sandbox.h" $out/include/sandbox.h
|
||||
cp "${MacOSX-SDK}/usr/lib/libsandbox.1.tbd" $out/lib
|
||||
ln -s libsandbox.1.tbd $out/lib/libsandbox.tbd
|
||||
'';
|
||||
};
|
||||
|
||||
libDER = stdenv.mkDerivation {
|
||||
name = "apple-lib-libDER";
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
cp -r ${MacOSX-SDK}/usr/include/libDER $out/include
|
||||
'';
|
||||
};
|
||||
|
||||
simd = stdenv.mkDerivation {
|
||||
name = "apple-lib-simd";
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
cp -r ${MacOSX-SDK}/usr/include/simd $out/include
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
overrides = super: {
|
||||
CoreFoundation = lib.overrideDerivation super.CoreFoundation (drv: {
|
||||
setupHook = ./cf-setup-hook.sh;
|
||||
});
|
||||
|
||||
# This framework doesn't exist in newer SDKs (somewhere around 10.13), but
|
||||
# there are references to it in nixpkgs.
|
||||
QuickTime = throw "QuickTime framework not available";
|
||||
|
||||
# Seems to be appropriate given https://developer.apple.com/forums/thread/666686
|
||||
JavaVM = super.JavaNativeFoundation;
|
||||
};
|
||||
|
||||
bareFrameworks = (
|
||||
lib.mapAttrs framework (import ./frameworks.nix {
|
||||
inherit frameworks libs;
|
||||
inherit (pkgs.darwin) libobjc Libsystem;
|
||||
inherit (pkgs.darwin.apple_sdk) libnetwork;
|
||||
})
|
||||
) // (
|
||||
lib.mapAttrs privateFramework (import ./private-frameworks.nix {
|
||||
inherit frameworks;
|
||||
})
|
||||
);
|
||||
|
||||
frameworks = bareFrameworks // overrides bareFrameworks;
|
||||
}
|
||||
6
pkgs/os-specific/darwin/apple-sdk-11.0/cf-setup-hook.sh
Normal file
6
pkgs/os-specific/darwin/apple-sdk-11.0/cf-setup-hook.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
forceLinkCoreFoundationFramework() {
|
||||
NIX_CFLAGS_COMPILE="-F@out@/Library/Frameworks${NIX_CFLAGS_COMPILE:+ }${NIX_CFLAGS_COMPILE-}"
|
||||
NIX_LDFLAGS+=" @out@/Library/Frameworks/CoreFoundation.framework/CoreFoundation"
|
||||
}
|
||||
|
||||
preConfigureHooks+=(forceLinkCoreFoundationFramework)
|
||||
58
pkgs/os-specific/darwin/apple-sdk-11.0/default.nix
Normal file
58
pkgs/os-specific/darwin/apple-sdk-11.0/default.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{ stdenvNoCC, fetchurl, newScope, pkgs
|
||||
, xar, cpio, python3, pbzx }:
|
||||
|
||||
let
|
||||
MacOSX-SDK = stdenvNoCC.mkDerivation rec {
|
||||
pname = "MacOSX-SDK";
|
||||
version = "11.0.0";
|
||||
|
||||
# https://swscan.apple.com/content/catalogs/others/index-11-10.15-10.14-10.13-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
|
||||
src = fetchurl {
|
||||
url = "http://swcdn.apple.com/content/downloads/46/21/001-89745-A_56FM390IW5/v1um2qppgfdnam2e9cdqcqu2r6k8aa3lis/CLTools_macOSNMOS_SDK.pkg";
|
||||
sha256 = "0n425smj4q1vxbza8fzwnk323fyzbbq866q32w288c44hl5yhwsf";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
darwinDontCodeSign = true;
|
||||
|
||||
nativeBuildInputs = [ cpio pbzx ];
|
||||
|
||||
outputs = [ "out" ];
|
||||
|
||||
unpackPhase = ''
|
||||
pbzx $src | cpio -idm
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cd Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
|
||||
|
||||
mkdir $out
|
||||
cp -r System usr $out/
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit version;
|
||||
};
|
||||
};
|
||||
|
||||
callPackage = newScope (packages // pkgs.darwin // { inherit MacOSX-SDK; });
|
||||
|
||||
packages = {
|
||||
inherit (callPackage ./apple_sdk.nix {}) frameworks libs;
|
||||
|
||||
# TODO: this is nice to be private. is it worth the callPackage above?
|
||||
# Probably, I don't think that callPackage costs much at all.
|
||||
inherit MacOSX-SDK;
|
||||
|
||||
Libsystem = callPackage ./libSystem.nix {};
|
||||
LibsystemCross = pkgs.darwin.Libsystem;
|
||||
libcharset = callPackage ./libcharset.nix {};
|
||||
libunwind = callPackage ./libunwind.nix {};
|
||||
libnetwork = callPackage ./libnetwork.nix {};
|
||||
objc4 = callPackage ./libobjc.nix {};
|
||||
|
||||
# questionable aliases
|
||||
configd = pkgs.darwin.apple_sdk.frameworks.SystemConfiguration;
|
||||
IOKit = pkgs.darwin.apple_sdk.frameworks.IOKit;
|
||||
};
|
||||
in packages
|
||||
195
pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix
Normal file
195
pkgs/os-specific/darwin/apple-sdk-11.0/frameworks.nix
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
{ frameworks, libs, libobjc, Libsystem, libnetwork }: with frameworks; with libs;
|
||||
{
|
||||
AGL = { inherit Carbon OpenGL; };
|
||||
AVFoundation = { inherit ApplicationServices AVFCapture AVFCore CoreGraphics simd UniformTypeIdentifiers; };
|
||||
AVKit = {};
|
||||
Accelerate = { inherit CoreWLAN IOBluetooth; };
|
||||
Accessibility = {};
|
||||
Accounts = {};
|
||||
AdSupport = {};
|
||||
AddressBook = { inherit AddressBookCore Carbon ContactsPersistence libobjc; };
|
||||
AppKit = { inherit ApplicationServices AudioToolbox AudioUnit Foundation QuartzCore UIFoundation; };
|
||||
AppTrackingTransparency = {};
|
||||
AppleScriptKit = {};
|
||||
AppleScriptObjC = {};
|
||||
ApplicationServices = { inherit ColorSync CoreGraphics CoreServices CoreText ImageIO; };
|
||||
AudioToolbox = { inherit AudioToolboxCore CoreAudio CoreMIDI; };
|
||||
AudioUnit = { inherit AudioToolbox Carbon CoreAudio; };
|
||||
AudioVideoBridging = { inherit Foundation; };
|
||||
AuthenticationServices = {};
|
||||
AutomaticAssessmentConfiguration = {};
|
||||
Automator = {};
|
||||
BackgroundTasks = {};
|
||||
BusinessChat = {};
|
||||
CFNetwork = {};
|
||||
CalendarStore = {};
|
||||
CallKit = {};
|
||||
Carbon = { inherit ApplicationServices CoreServices Foundation IOKit QuartzCore Security libobjc; };
|
||||
ClassKit = {};
|
||||
CloudKit = { inherit CoreLocation; };
|
||||
Cocoa = { inherit AppKit CoreData; };
|
||||
Collaboration = {};
|
||||
ColorSync = {};
|
||||
Combine = {};
|
||||
Contacts = {};
|
||||
ContactsUI = {};
|
||||
CoreAudio = { inherit IOKit CoreAudioTypes; };
|
||||
CoreAudioKit = { inherit AudioUnit; };
|
||||
CoreAudioTypes = {};
|
||||
CoreBluetooth = {};
|
||||
CoreData = { inherit CloudKit; };
|
||||
CoreDisplay = {};
|
||||
CoreFoundation = { inherit libobjc; };
|
||||
CoreGraphics = { inherit Accelerate IOKit IOSurface SystemConfiguration; };
|
||||
CoreHaptics = {};
|
||||
CoreImage = {};
|
||||
CoreLocation = {};
|
||||
CoreMIDI = {};
|
||||
CoreMIDIServer = { inherit CoreMIDI; };
|
||||
CoreML = {};
|
||||
CoreMedia = { inherit ApplicationServices AudioToolbox AudioUnit CoreAudio CoreGraphics CoreVideo; };
|
||||
CoreMediaIO = { inherit CoreMedia; };
|
||||
CoreMotion = {};
|
||||
CoreServices = { inherit CFNetwork CoreAudio CoreData CoreFoundation DiskArbitration NetFS OpenDirectory Security ServiceManagement; };
|
||||
CoreSpotlight = {};
|
||||
CoreTelephony = {};
|
||||
CoreText = { inherit CoreGraphics; };
|
||||
CoreVideo = { inherit ApplicationServices CoreGraphics IOSurface OpenGL; };
|
||||
CoreWLAN = { inherit SecurityFoundation; };
|
||||
CryptoKit = {};
|
||||
CryptoTokenKit = {};
|
||||
DVDPlayback = {};
|
||||
DeveloperToolsSupport = {};
|
||||
DeviceCheck = {};
|
||||
DirectoryService = {};
|
||||
DiscRecording = { inherit CoreServices IOKit libobjc; };
|
||||
DiscRecordingUI = {};
|
||||
DiskArbitration = { inherit IOKit; };
|
||||
DriverKit = {};
|
||||
EventKit = {};
|
||||
ExceptionHandling = {};
|
||||
ExecutionPolicy = {};
|
||||
ExternalAccessory = {};
|
||||
FWAUserLib = {};
|
||||
FileProvider = {};
|
||||
FileProviderUI = {};
|
||||
FinderSync = {};
|
||||
ForceFeedback = { inherit IOKit; };
|
||||
Foundation = { inherit ApplicationServices CoreFoundation Security SystemConfiguration libobjc; };
|
||||
GLKit = {};
|
||||
GLUT = { inherit OpenGL; };
|
||||
GSS = {};
|
||||
GameController = {};
|
||||
GameKit = { inherit Cocoa Foundation GameCenterFoundation GameCenterUI GameCenterUICore GameController GameplayKit Metal MetalKit ModelIO ReplayKit SceneKit SpriteKit; };
|
||||
GameplayKit = {};
|
||||
HIDDriverKit = {};
|
||||
Hypervisor = {};
|
||||
ICADevices = { inherit Carbon IOBluetooth libobjc; };
|
||||
IMServicePlugIn = {};
|
||||
IOBluetooth = { inherit CoreBluetooth IOKit; };
|
||||
IOBluetoothUI = { inherit IOBluetooth; };
|
||||
IOKit = {};
|
||||
# `IOSurface` should depend on `Libsystem` (in place of `xpc`) but this currently causes build
|
||||
# issues due to incompatibility issues between `Libsystem` and `libcxx`.
|
||||
IOSurface = { inherit IOKit xpc; };
|
||||
IOUSBHost = {};
|
||||
IdentityLookup = {};
|
||||
ImageCaptureCore = {};
|
||||
ImageIO = { inherit CoreGraphics; };
|
||||
InputMethodKit = { inherit Carbon; };
|
||||
InstallerPlugins = {};
|
||||
InstantMessage = {};
|
||||
Intents = {};
|
||||
JavaNativeFoundation = {};
|
||||
JavaRuntimeSupport = {};
|
||||
JavaScriptCore = { inherit libobjc; };
|
||||
Kerberos = {};
|
||||
Kernel = { inherit IOKit; };
|
||||
KernelManagement = {};
|
||||
LDAP = {};
|
||||
LatentSemanticMapping = { inherit Carbon; };
|
||||
LinkPresentation = { inherit URLFormatting; };
|
||||
LocalAuthentication = {};
|
||||
MLCompute = {};
|
||||
MapKit = {};
|
||||
MediaAccessibility = { inherit CoreGraphics CoreText QuartzCore; };
|
||||
MediaLibrary = {};
|
||||
MediaPlayer = {};
|
||||
MediaToolbox = { inherit AudioToolbox AudioUnit CoreMedia; };
|
||||
Message = {};
|
||||
Metal = {};
|
||||
MetalKit = { inherit Metal ModelIO; };
|
||||
MetalPerformanceShaders = {};
|
||||
MetalPerformanceShadersGraph = {};
|
||||
MetricKit = { inherit SignpostMetrics; };
|
||||
ModelIO = {};
|
||||
MultipeerConnectivity = {};
|
||||
NaturalLanguage = {};
|
||||
NearbyInteraction = {};
|
||||
NetFS = {};
|
||||
Network = { inherit libnetwork; };
|
||||
NetworkExtension = { inherit Network; };
|
||||
NetworkingDriverKit = {};
|
||||
NotificationCenter = {};
|
||||
OSAKit = { inherit Carbon; };
|
||||
OSLog = {};
|
||||
OpenAL = {};
|
||||
OpenCL = { inherit IOSurface OpenGL; };
|
||||
OpenDirectory = {};
|
||||
OpenGL = {};
|
||||
PCIDriverKit = {};
|
||||
PCSC = { inherit CoreData; };
|
||||
PDFKit = {};
|
||||
ParavirtualizedGraphics = {};
|
||||
PassKit = { inherit PassKitCore; };
|
||||
PencilKit = {};
|
||||
Photos = {};
|
||||
PhotosUI = {};
|
||||
PreferencePanes = {};
|
||||
PushKit = {};
|
||||
Python = {};
|
||||
QTKit = { inherit CoreMedia CoreMediaIO MediaToolbox VideoToolbox; };
|
||||
Quartz = { inherit QTKit QuartzCore QuickLook PDFKit; };
|
||||
QuartzCore = { inherit ApplicationServices CoreImage CoreVideo Metal OpenCL libobjc; };
|
||||
QuickLook = { inherit ApplicationServices; };
|
||||
QuickLookThumbnailing = {};
|
||||
RealityKit = {};
|
||||
ReplayKit = {};
|
||||
Ruby = {};
|
||||
SafariServices = {};
|
||||
SceneKit = {};
|
||||
ScreenSaver = {};
|
||||
ScreenTime = {};
|
||||
ScriptingBridge = {};
|
||||
Security = { inherit IOKit libDER; };
|
||||
SecurityFoundation = { inherit Security; };
|
||||
SecurityInterface = { inherit Security SecurityFoundation; };
|
||||
SensorKit = {};
|
||||
ServiceManagement = { inherit Security; };
|
||||
Social = {};
|
||||
SoundAnalysis = {};
|
||||
Speech = {};
|
||||
SpriteKit = {};
|
||||
StoreKit = {};
|
||||
SwiftUI = {};
|
||||
SyncServices = {};
|
||||
System = {};
|
||||
SystemConfiguration = { inherit Security; };
|
||||
SystemExtensions = {};
|
||||
TWAIN = { inherit Carbon; };
|
||||
Tcl = {};
|
||||
Tk = {};
|
||||
USBDriverKit = {};
|
||||
UniformTypeIdentifiers = {};
|
||||
UserNotifications = {};
|
||||
UserNotificationsUI = {};
|
||||
VideoDecodeAcceleration = { inherit CoreVideo; };
|
||||
VideoSubscriberAccount = {};
|
||||
VideoToolbox = { inherit CoreMedia CoreVideo; };
|
||||
Virtualization = {};
|
||||
Vision = {};
|
||||
WebKit = { inherit ApplicationServices Carbon JavaScriptCore OpenGL libobjc; };
|
||||
WidgetKit = {};
|
||||
iTunesLibrary = {};
|
||||
vmnet = {};
|
||||
}
|
||||
78
pkgs/os-specific/darwin/apple-sdk-11.0/libSystem.nix
Normal file
78
pkgs/os-specific/darwin/apple-sdk-11.0/libSystem.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{ stdenvNoCC, buildPackages, MacOSX-SDK }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "libSystem";
|
||||
version = MacOSX-SDK.version;
|
||||
|
||||
dontBuild = true;
|
||||
dontUnpack = true;
|
||||
|
||||
nativeBuildInputs = [ buildPackages.darwin.rewrite-tbd ];
|
||||
|
||||
includeDirs = [
|
||||
"CommonCrypto" "_types" "architecture" "arpa" "atm" "bank" "bsd" "bsm"
|
||||
"corecrypto" "corpses" "default_pager" "device" "dispatch" "hfs" "i386"
|
||||
"iokit" "kern" "libkern" "mach" "mach-o" "mach_debug" "machine" "malloc"
|
||||
"miscfs" "net" "netinet" "netinet6" "netkey" "nfs" "os" "osfmk" "pexpert"
|
||||
"platform" "protocols" "pthread" "rpc" "rpcsvc" "secure" "security"
|
||||
"servers" "sys" "uuid" "vfs" "voucher" "xlocale"
|
||||
] ++ [
|
||||
"arm" "xpc" "arm64"
|
||||
];
|
||||
|
||||
csu = [
|
||||
"bundle1.o" "crt0.o" "crt1.10.5.o" "crt1.10.6.o" "crt1.o" "dylib1.10.5.o"
|
||||
"dylib1.o" "gcrt1.o" "lazydylib1.o"
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/{include,lib}
|
||||
|
||||
for dir in $includeDirs; do
|
||||
from=${MacOSX-SDK}/usr/include/$dir
|
||||
if [ -e "$from" ]; then
|
||||
cp -dr $from $out/include
|
||||
else
|
||||
echo "Header directory '$from' doesn't exist: skipping"
|
||||
fi
|
||||
done
|
||||
|
||||
cp -d \
|
||||
${MacOSX-SDK}/usr/include/*.h \
|
||||
$out/include
|
||||
|
||||
rm $out/include/tk*.h $out/include/tcl*.h
|
||||
|
||||
cp -dr \
|
||||
${MacOSX-SDK}/usr/lib/libSystem.* \
|
||||
${MacOSX-SDK}/usr/lib/system \
|
||||
$out/lib
|
||||
|
||||
# Extra libraries
|
||||
for name in c dbm dl info m mx poll proc pthread rpcsvc util gcc_s.1 resolv; do
|
||||
cp -d \
|
||||
${MacOSX-SDK}/usr/lib/lib$name.tbd \
|
||||
${MacOSX-SDK}/usr/lib/lib$name.*.tbd \
|
||||
$out/lib
|
||||
done
|
||||
|
||||
for f in $csu; do
|
||||
from=${MacOSX-SDK}/usr/lib/$f
|
||||
if [ -e "$from" ]; then
|
||||
cp -d $from $out/lib
|
||||
else
|
||||
echo "Csu file '$from' doesn't exist: skipping"
|
||||
fi
|
||||
done
|
||||
|
||||
chmod u+w -R $out/lib
|
||||
find $out -name '*.tbd' -type f | while read tbd; do
|
||||
rewrite-tbd \
|
||||
-c /usr/lib/libsystem.dylib:$out/lib/libsystem.dylib \
|
||||
-p /usr/lib/system/:$out/lib/system/ \
|
||||
-r ${builtins.storeDir} \
|
||||
"$tbd"
|
||||
done
|
||||
'';
|
||||
}
|
||||
|
||||
16
pkgs/os-specific/darwin/apple-sdk-11.0/libcharset.nix
Normal file
16
pkgs/os-specific/darwin/apple-sdk-11.0/libcharset.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ stdenvNoCC, buildPackages, MacOSX-SDK }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "libcharset";
|
||||
version = MacOSX-SDK.version;
|
||||
|
||||
dontUnpack = true;
|
||||
dontBuild = true;
|
||||
|
||||
nativeBuildInputs = [ buildPackages.darwin.checkReexportsHook ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/{include,lib}
|
||||
cp ${MacOSX-SDK}/usr/lib/libcharset* $out/lib
|
||||
'';
|
||||
}
|
||||
20
pkgs/os-specific/darwin/apple-sdk-11.0/libnetwork.nix
Normal file
20
pkgs/os-specific/darwin/apple-sdk-11.0/libnetwork.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ stdenvNoCC, buildPackages, MacOSX-SDK }:
|
||||
|
||||
let self = stdenvNoCC.mkDerivation {
|
||||
pname = "libnetwork";
|
||||
version = MacOSX-SDK.version;
|
||||
|
||||
dontUnpack = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib
|
||||
cp ${MacOSX-SDK}/usr/lib/libnetwork* $out/lib
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tbdRewrites = {
|
||||
const."/usr/lib/libnetwork.dylib" = "${self}/lib/libnetwork.dylib";
|
||||
};
|
||||
};
|
||||
}; in self
|
||||
21
pkgs/os-specific/darwin/apple-sdk-11.0/libobjc.nix
Normal file
21
pkgs/os-specific/darwin/apple-sdk-11.0/libobjc.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ stdenvNoCC, MacOSX-SDK, libcharset }:
|
||||
|
||||
let self = stdenvNoCC.mkDerivation {
|
||||
pname = "libobjc";
|
||||
version = MacOSX-SDK.version;
|
||||
|
||||
dontUnpack = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/{include,lib}
|
||||
cp -r ${MacOSX-SDK}/usr/include/objc $out/include
|
||||
cp ${MacOSX-SDK}/usr/lib/libobjc* $out/lib
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tbdRewrites = {
|
||||
const."/usr/lib/libobjc.A.dylib" = "${self}/lib/libobjc.A.dylib";
|
||||
};
|
||||
};
|
||||
}; in self
|
||||
24
pkgs/os-specific/darwin/apple-sdk-11.0/libunwind.nix
Normal file
24
pkgs/os-specific/darwin/apple-sdk-11.0/libunwind.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ stdenvNoCC, buildPackages, MacOSX-SDK }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "libunwind";
|
||||
version = MacOSX-SDK.version;
|
||||
|
||||
dontUnpack = true;
|
||||
dontBuild = true;
|
||||
|
||||
nativeBuildInputs = [ buildPackages.darwin.checkReexportsHook ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include/mach-o
|
||||
|
||||
cp \
|
||||
${MacOSX-SDK}/usr/include/libunwind.h \
|
||||
${MacOSX-SDK}/usr/include/unwind.h \
|
||||
$out/include
|
||||
|
||||
cp \
|
||||
${MacOSX-SDK}/usr/include/mach-o/compact_unwind_encoding.h \
|
||||
$out/include/mach-o
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
{ frameworks }: with frameworks;
|
||||
# generated by hand to avoid exposing all private frameworks
|
||||
# frameworks here are only the necessary ones used by public frameworks.
|
||||
{
|
||||
AVFCapture = {};
|
||||
AVFCore = {};
|
||||
AddressBookCore = { inherit ContactsPersistence; };
|
||||
AudioToolboxCore = {};
|
||||
ContactsPersistence = {};
|
||||
UIFoundation = {};
|
||||
GameCenterFoundation = {};
|
||||
GameCenterUI = {};
|
||||
GameCenterUICore = {};
|
||||
URLFormatting = {};
|
||||
SignpostMetrics = {};
|
||||
PassKitCore = {};
|
||||
SkyLight = {};
|
||||
|
||||
# Also expose CoreSymbolication; used by `root` package.
|
||||
CoreSymbolication = {};
|
||||
}
|
||||
9
pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh
Normal file
9
pkgs/os-specific/darwin/apple-sdk/cf-setup-hook.sh
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
linkSystemCoreFoundationFramework() {
|
||||
NIX_CFLAGS_COMPILE="-F@out@/Library/Frameworks${NIX_CFLAGS_COMPILE:+ }${NIX_CFLAGS_COMPILE-}"
|
||||
# gross! many symbols (such as _OBJC_CLASS_$_NSArray) are defined in system CF, but not
|
||||
# in the opensource release
|
||||
# if the package needs private headers, we assume they also want to link with system CF
|
||||
NIX_LDFLAGS+=" @out@/Library/Frameworks/CoreFoundation.framework/CoreFoundation"
|
||||
}
|
||||
|
||||
preConfigureHooks+=(linkSystemCoreFoundationFramework)
|
||||
339
pkgs/os-specific/darwin/apple-sdk/default.nix
Normal file
339
pkgs/os-specific/darwin/apple-sdk/default.nix
Normal file
|
|
@ -0,0 +1,339 @@
|
|||
{ stdenv, fetchurl, xar, cpio, pkgs, python3, pbzx, lib, darwin-stubs, print-reexports }:
|
||||
|
||||
let
|
||||
# sadly needs to be exported because security_tool needs it
|
||||
sdk = stdenv.mkDerivation rec {
|
||||
pname = "MacOS_SDK";
|
||||
version = "10.12";
|
||||
|
||||
# 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/33/36/041-90419-A_7JJ4H9ZHO2/xs88ob5wjz6riz7g6764twblnvksusg4ps/DevSDK_OSX1012.pkg";
|
||||
sha256 = "13xq34sb7383b37hwy076gnhf96prpk1b4087p87xnwswxbrisih";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ xar cpio python3 pbzx ];
|
||||
|
||||
outputs = [ "out" "dev" "man" ];
|
||||
|
||||
unpackPhase = ''
|
||||
xar -x -f $src
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
start="$(pwd)"
|
||||
mkdir -p $out
|
||||
cd $out
|
||||
pbzx -n $start/Payload | cpio -idm
|
||||
|
||||
mv usr/* .
|
||||
rmdir usr
|
||||
|
||||
mv System/* .
|
||||
rmdir System
|
||||
|
||||
pushd lib
|
||||
cp ${darwin-stubs}/usr/lib/libcups*.tbd .
|
||||
ln -s libcups.2.tbd libcups.tbd
|
||||
ln -s libcupscgi.1.tbd libcupscgi.tbd
|
||||
ln -s libcupsimage.2.tbd libcupsimage.tbd
|
||||
ln -s libcupsmime.1.tbd libcupsmime.tbd
|
||||
ln -s libcupsppdc.1.tbd libcupsppdc.tbd
|
||||
popd
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Apple SDK ${version}";
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
};
|
||||
};
|
||||
|
||||
mkFrameworkSubs = name: deps:
|
||||
let
|
||||
deps' = deps // { "${name}" = placeholder "out"; };
|
||||
substArgs = lib.concatMap (x: [ "--subst-var-by" x deps'."${x}" ]) (lib.attrNames deps');
|
||||
in lib.escapeShellArgs substArgs;
|
||||
|
||||
framework = name: deps: stdenv.mkDerivation {
|
||||
name = "apple-framework-${name}";
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
# because we copy files from the system
|
||||
preferLocalBuild = true;
|
||||
|
||||
disallowedRequisites = [ sdk ];
|
||||
|
||||
nativeBuildInputs = [ print-reexports ];
|
||||
|
||||
extraTBDFiles = [];
|
||||
|
||||
installPhase = ''
|
||||
linkFramework() {
|
||||
local path="$1"
|
||||
local nested_path="$1"
|
||||
if [ "$path" == "JavaNativeFoundation.framework" ]; then
|
||||
local nested_path="JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework"
|
||||
fi
|
||||
if [ "$path" == "JavaRuntimeSupport.framework" ]; then
|
||||
local nested_path="JavaVM.framework/Versions/A/Frameworks/JavaRuntimeSupport.framework"
|
||||
fi
|
||||
local name="$(basename "$path" .framework)"
|
||||
local current="$(readlink "/System/Library/Frameworks/$nested_path/Versions/Current")"
|
||||
if [ -z "$current" ]; then
|
||||
current=A
|
||||
fi
|
||||
|
||||
local dest="$out/Library/Frameworks/$path"
|
||||
|
||||
mkdir -p "$dest/Versions/$current"
|
||||
pushd "$dest/Versions/$current" >/dev/null
|
||||
|
||||
if [ -d "${sdk.out}/Library/Frameworks/$nested_path/Versions/$current/Headers" ]; then
|
||||
cp -R "${sdk.out}/Library/Frameworks/$nested_path/Versions/$current/Headers" .
|
||||
elif [ -d "${sdk.out}/Library/Frameworks/$name.framework/Versions/$current/Headers" ]; then
|
||||
current="$(readlink "/System/Library/Frameworks/$name.framework/Versions/Current")"
|
||||
cp -R "${sdk.out}/Library/Frameworks/$name.framework/Versions/$current/Headers" .
|
||||
fi
|
||||
|
||||
local tbd_source=${darwin-stubs}/System/Library/Frameworks/$nested_path/Versions/$current
|
||||
if [ "${name}" != "Kernel" ]; then
|
||||
# The Kernel.framework has headers but no actual library component.
|
||||
cp -v $tbd_source/*.tbd .
|
||||
fi
|
||||
|
||||
if [ -d "$tbd_source/Libraries" ]; then
|
||||
mkdir Libraries
|
||||
cp -v $tbd_source/Libraries/*.tbd Libraries/
|
||||
fi
|
||||
|
||||
ln -s -L "/System/Library/Frameworks/$nested_path/Versions/$current/Resources"
|
||||
|
||||
if [ -f "/System/Library/Frameworks/$nested_path/module.map" ]; then
|
||||
ln -s "/System/Library/Frameworks/$nested_path/module.map"
|
||||
fi
|
||||
|
||||
pushd "${sdk.out}/Library/Frameworks/$nested_path/Versions/$current" >/dev/null
|
||||
local children=$(echo Frameworks/*.framework)
|
||||
popd >/dev/null
|
||||
|
||||
for child in $children; do
|
||||
childpath="$path/Versions/$current/$child"
|
||||
linkFramework "$childpath"
|
||||
done
|
||||
|
||||
pushd ../.. >/dev/null
|
||||
ln -s "$current" Versions/Current
|
||||
ln -s Versions/Current/* .
|
||||
popd >/dev/null
|
||||
|
||||
popd >/dev/null
|
||||
}
|
||||
|
||||
linkFramework "${name}.framework"
|
||||
|
||||
# linkFramework is recursive, the rest of the processing is not.
|
||||
|
||||
local tbd_source=${darwin-stubs}/System/Library/Frameworks/${name}.framework
|
||||
for tbd in $extraTBDFiles; do
|
||||
local tbd_dest_dir=$out/Library/Frameworks/${name}.framework/$(dirname "$tbd")
|
||||
mkdir -p "$tbd_dest_dir"
|
||||
cp -v "$tbd_source/$tbd" "$tbd_dest_dir"
|
||||
done
|
||||
|
||||
# Fix and check tbd re-export references
|
||||
find $out -name '*.tbd' | while read tbd; do
|
||||
echo "Fixing re-exports in $tbd"
|
||||
substituteInPlace "$tbd" ${mkFrameworkSubs name deps}
|
||||
|
||||
echo "Checking re-exports in $tbd"
|
||||
print-reexports "$tbd" | while read target; do
|
||||
local expected="''${target%.dylib}.tbd"
|
||||
if ! [ -e "$expected" ]; then
|
||||
echo -e "Re-export missing:\n\t$target\n\t(expected $expected)"
|
||||
echo -e "While processing\n\t$tbd"
|
||||
exit 1
|
||||
else
|
||||
echo "Re-exported target $target ok"
|
||||
fi
|
||||
done
|
||||
done
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = builtins.attrValues deps;
|
||||
|
||||
# don't use pure CF for dylibs that depend on frameworks
|
||||
setupHook = ./framework-setup-hook.sh;
|
||||
|
||||
# Not going to be more specific than this for now
|
||||
__propagatedImpureHostDeps = lib.optionals (name != "Kernel") [
|
||||
# The setup-hook ensures that everyone uses the impure CoreFoundation who uses these SDK frameworks, so let's expose it
|
||||
"/System/Library/Frameworks/CoreFoundation.framework"
|
||||
"/System/Library/Frameworks/${name}.framework"
|
||||
"/System/Library/Frameworks/${name}.framework/${name}"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Apple SDK framework ${name}";
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
};
|
||||
};
|
||||
|
||||
tbdOnlyFramework = name: { private ? true }: stdenv.mkDerivation {
|
||||
name = "apple-framework-${name}";
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/Library/Frameworks/
|
||||
cp -r ${darwin-stubs}/System/Library/${lib.optionalString private "Private"}Frameworks/${name}.framework \
|
||||
$out/Library/Frameworks
|
||||
|
||||
cd $out/Library/Frameworks/${name}.framework
|
||||
|
||||
versions=(./Versions/*)
|
||||
if [ "''${#versions[@]}" != 1 ]; then
|
||||
echo "Unable to determine current version of framework ${name}"
|
||||
exit 1
|
||||
fi
|
||||
current=$(basename ''${versions[0]})
|
||||
|
||||
chmod u+w -R .
|
||||
ln -s "$current" Versions/Current
|
||||
ln -s Versions/Current/* .
|
||||
|
||||
# NOTE there's no re-export checking here, this is probably wrong
|
||||
'';
|
||||
};
|
||||
in rec {
|
||||
libs = {
|
||||
xpc = stdenv.mkDerivation {
|
||||
name = "apple-lib-xpc";
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
pushd $out/include >/dev/null
|
||||
cp -r "${lib.getDev sdk}/include/xpc" $out/include/xpc
|
||||
cp "${lib.getDev sdk}/include/launch.h" $out/include/launch.h
|
||||
popd >/dev/null
|
||||
'';
|
||||
};
|
||||
|
||||
Xplugin = stdenv.mkDerivation {
|
||||
name = "apple-lib-Xplugin";
|
||||
dontUnpack = true;
|
||||
|
||||
# Not enough
|
||||
__propagatedImpureHostDeps = [ "/usr/lib/libXplugin.1.dylib" ];
|
||||
|
||||
propagatedBuildInputs = with frameworks; [
|
||||
OpenGL ApplicationServices Carbon IOKit CoreGraphics CoreServices CoreText
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include $out/lib
|
||||
ln -s "${lib.getDev sdk}/include/Xplugin.h" $out/include/Xplugin.h
|
||||
cp ${darwin-stubs}/usr/lib/libXplugin.1.tbd $out/lib
|
||||
ln -s libXplugin.1.tbd $out/lib/libXplugin.tbd
|
||||
'';
|
||||
};
|
||||
|
||||
utmp = stdenv.mkDerivation {
|
||||
name = "apple-lib-utmp";
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
pushd $out/include >/dev/null
|
||||
ln -s "${lib.getDev sdk}/include/utmp.h"
|
||||
ln -s "${lib.getDev sdk}/include/utmpx.h"
|
||||
popd >/dev/null
|
||||
'';
|
||||
};
|
||||
|
||||
sandbox = stdenv.mkDerivation {
|
||||
name = "apple-lib-sandbox";
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include $out/lib
|
||||
ln -s "${lib.getDev sdk}/include/sandbox.h" $out/include/sandbox.h
|
||||
cp "${darwin-stubs}/usr/lib/libsandbox.1.tbd" $out/lib
|
||||
ln -s libsandbox.1.tbd $out/lib/libsandbox.tbd
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
overrides = super: {
|
||||
AppKit = lib.overrideDerivation super.AppKit (drv: {
|
||||
__propagatedImpureHostDeps = drv.__propagatedImpureHostDeps or [] ++ [
|
||||
"/System/Library/PrivateFrameworks/"
|
||||
];
|
||||
});
|
||||
|
||||
Carbon = lib.overrideDerivation super.Carbon (drv: {
|
||||
extraTBDFiles = [ "Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering.tbd" ];
|
||||
});
|
||||
|
||||
CoreFoundation = lib.overrideDerivation super.CoreFoundation (drv: {
|
||||
setupHook = ./cf-setup-hook.sh;
|
||||
});
|
||||
|
||||
CoreMedia = lib.overrideDerivation super.CoreMedia (drv: {
|
||||
__propagatedImpureHostDeps = drv.__propagatedImpureHostDeps or [] ++ [
|
||||
"/System/Library/Frameworks/CoreImage.framework"
|
||||
];
|
||||
});
|
||||
|
||||
CoreMIDI = lib.overrideDerivation super.CoreMIDI (drv: {
|
||||
__propagatedImpureHostDeps = drv.__propagatedImpureHostDeps or [] ++ [
|
||||
"/System/Library/PrivateFrameworks/"
|
||||
];
|
||||
setupHook = ./private-frameworks-setup-hook.sh;
|
||||
});
|
||||
|
||||
IMServicePlugIn = lib.overrideDerivation super.IMServicePlugIn (drv: {
|
||||
extraTBDFiles = [ "Versions/A/Frameworks/IMServicePlugInSupport.framework/Versions/A/IMServicePlugInSupport.tbd" ];
|
||||
});
|
||||
|
||||
Security = lib.overrideDerivation super.Security (drv: {
|
||||
setupHook = ./security-setup-hook.sh;
|
||||
});
|
||||
|
||||
QuartzCore = lib.overrideDerivation super.QuartzCore (drv: {
|
||||
installPhase = drv.installPhase + ''
|
||||
f="$out/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h"
|
||||
substituteInPlace "$f" \
|
||||
--replace "QuartzCore/../Frameworks/CoreImage.framework/Headers" "CoreImage"
|
||||
'';
|
||||
});
|
||||
|
||||
MetalKit = lib.overrideDerivation super.MetalKit (drv: {
|
||||
installPhase = drv.installPhase + ''
|
||||
mkdir -p $out/include/simd
|
||||
cp ${lib.getDev sdk}/include/simd/*.h $out/include/simd/
|
||||
'';
|
||||
});
|
||||
|
||||
WebKit = lib.overrideDerivation super.WebKit (drv: {
|
||||
extraTBDFiles = [
|
||||
"Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore.tbd"
|
||||
"Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy.tbd"
|
||||
];
|
||||
});
|
||||
} // lib.genAttrs [ "ContactsPersistence" "CoreSymbolication" "GameCenter" "SkyLight" "UIFoundation" ] (x: tbdOnlyFramework x {});
|
||||
|
||||
bareFrameworks = lib.mapAttrs framework (import ./frameworks.nix {
|
||||
inherit frameworks libs;
|
||||
inherit (pkgs.darwin) libobjc;
|
||||
});
|
||||
|
||||
frameworks = bareFrameworks // overrides bareFrameworks;
|
||||
|
||||
inherit sdk;
|
||||
}
|
||||
42
pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh
Normal file
42
pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# On macOS, frameworks are linked to the system CoreFoundation but
|
||||
# dynamic libraries built with nix use a pure version of CF this
|
||||
# causes segfaults for binaries that depend on it at runtime. This
|
||||
# can be solved in two ways.
|
||||
# 1. Rewrite references to the pure CF using this setup hook, this
|
||||
# works for the simple case but this can still cause problems if other
|
||||
# dependencies (eg. python) use the pure CF.
|
||||
# 2. Create a wrapper for the binary that sets DYLD_FRAMEWORK_PATH to
|
||||
# /System/Library/Frameworks. This will make everything load the
|
||||
# system's CoreFoundation framework while still keeping the
|
||||
# dependencies pure for other packages.
|
||||
|
||||
fixupOutputHooks+=('fixDarwinFrameworksIn $prefix')
|
||||
|
||||
fixDarwinFrameworks() {
|
||||
local systemPrefix='/System/Library/Frameworks'
|
||||
|
||||
for fn in "$@"; do
|
||||
if [ -L "$fn" ]; then continue; fi
|
||||
echo "$fn: fixing dylib"
|
||||
|
||||
for framework in $(otool -L "$fn" | awk '/CoreFoundation\.framework/ {print $1}'); do
|
||||
install_name_tool -change "$framework" "$systemPrefix/CoreFoundation.framework/Versions/A/CoreFoundation" "$fn" >&2
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
fixDarwinFrameworksIn() {
|
||||
local dir="$1"
|
||||
fixDarwinFrameworks $(find "$dir" -name "*.dylib")
|
||||
}
|
||||
|
||||
|
||||
# This configures the stdenv to use /System/Library/Frameworks/CoreFoundation.framework
|
||||
# instead of the nix version by including the system frameworks path
|
||||
# as an rpath entry when creating binaries.
|
||||
|
||||
useSystemCoreFoundationFramework () {
|
||||
export NIX_COREFOUNDATION_RPATH=/System/Library/Frameworks
|
||||
}
|
||||
|
||||
addEnvHooks "$hostOffset" useSystemCoreFoundationFramework
|
||||
129
pkgs/os-specific/darwin/apple-sdk/frameworks.nix
Normal file
129
pkgs/os-specific/darwin/apple-sdk/frameworks.nix
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
# Current as of 10.12
|
||||
# Epic weird knot-tying happening here.
|
||||
# TODO: clean up the process for generating this and include it
|
||||
|
||||
{ frameworks, libs, libobjc, }:
|
||||
|
||||
with frameworks; with libs; {
|
||||
AGL = { inherit Carbon OpenGL; };
|
||||
AVFoundation = { inherit ApplicationServices CoreGraphics CoreMedia MediaToolbox; };
|
||||
AVKit = {};
|
||||
Accounts = {};
|
||||
AddressBook = { inherit libobjc Carbon ContactsPersistence; };
|
||||
AppKit = { inherit ApplicationServices AudioToolbox AudioUnit Foundation QuartzCore UIFoundation; };
|
||||
AppKitScripting = {};
|
||||
AppleScriptKit = {};
|
||||
AppleScriptObjC = {};
|
||||
AudioToolbox = { inherit CoreAudio CoreMIDI; };
|
||||
AudioUnit = { inherit AudioToolbox Carbon CoreAudio; };
|
||||
AudioVideoBridging = { inherit Foundation; };
|
||||
Automator = {};
|
||||
CFNetwork = {};
|
||||
CalendarStore = {};
|
||||
Cocoa = { inherit AppKit CoreData; };
|
||||
Collaboration = {};
|
||||
# Impure version of CoreFoundation, this should not be used unless another
|
||||
# framework includes headers that are not available in the pure version.
|
||||
CoreFoundation = {};
|
||||
CoreAudio = { inherit IOKit; };
|
||||
CoreAudioKit = { inherit AudioUnit; };
|
||||
CoreData = {};
|
||||
CoreGraphics = { inherit Accelerate IOKit IOSurface SystemConfiguration; };
|
||||
CoreImage = {};
|
||||
CoreLocation = {};
|
||||
CoreMIDI = {};
|
||||
CoreMIDIServer = { inherit CoreMIDI; };
|
||||
CoreMedia = { inherit ApplicationServices AudioToolbox AudioUnit CoreAudio CoreGraphics CoreVideo; };
|
||||
CoreMediaIO = { inherit CoreMedia; };
|
||||
CoreText = { inherit CoreGraphics; };
|
||||
CoreVideo = { inherit ApplicationServices CoreGraphics IOSurface OpenGL; };
|
||||
CoreWLAN = { inherit SecurityFoundation; };
|
||||
DVDPlayback = {};
|
||||
DirectoryService = {};
|
||||
DiscRecording = { inherit libobjc CoreServices IOKit; };
|
||||
DiscRecordingUI = {};
|
||||
DiskArbitration = { inherit IOKit; };
|
||||
EventKit = {};
|
||||
ExceptionHandling = {};
|
||||
FWAUserLib = {};
|
||||
ForceFeedback = { inherit IOKit; };
|
||||
Foundation = { inherit libobjc CoreFoundation Security ApplicationServices SystemConfiguration; };
|
||||
GLKit = {};
|
||||
GLUT = { inherit OpenGL; };
|
||||
GSS = {};
|
||||
GameCenter = {};
|
||||
GameController = {};
|
||||
GameKit = { inherit Cocoa Foundation GameCenter GameController GameplayKit Metal MetalKit ModelIO SceneKit SpriteKit; };
|
||||
GameplayKit = {};
|
||||
Hypervisor = {};
|
||||
ICADevices = { inherit libobjc Carbon IOBluetooth; };
|
||||
IMServicePlugIn = {};
|
||||
IOBluetoothUI = { inherit IOBluetooth; };
|
||||
IOKit = {};
|
||||
IOSurface = { inherit IOKit xpc; };
|
||||
ImageCaptureCore = {};
|
||||
ImageIO = { inherit CoreGraphics; };
|
||||
InputMethodKit = { inherit Carbon; };
|
||||
InstallerPlugins = {};
|
||||
InstantMessage = {};
|
||||
JavaFrameEmbedding = {};
|
||||
JavaNativeFoundation = {};
|
||||
JavaRuntimeSupport = {};
|
||||
JavaScriptCore = { inherit libobjc; };
|
||||
Kerberos = {};
|
||||
Kernel = { inherit IOKit; };
|
||||
LDAP = {};
|
||||
LatentSemanticMapping = { inherit Carbon; };
|
||||
LocalAuthentication = {};
|
||||
MapKit = {};
|
||||
MediaAccessibility = { inherit CoreGraphics CoreText QuartzCore; };
|
||||
MediaPlayer = {};
|
||||
MediaToolbox = { inherit AudioToolbox AudioUnit CoreMedia; };
|
||||
Metal = {};
|
||||
MetalKit = { inherit ModelIO Metal; };
|
||||
ModelIO = {};
|
||||
NetFS = {};
|
||||
OSAKit = { inherit Carbon; };
|
||||
OpenAL = {};
|
||||
OpenCL = { inherit IOSurface OpenGL; };
|
||||
OpenGL = {};
|
||||
PCSC = { inherit CoreData; };
|
||||
PreferencePanes = {};
|
||||
PubSub = {};
|
||||
QTKit = { inherit CoreMediaIO CoreMedia MediaToolbox QuickTime VideoToolbox; };
|
||||
QuickLook = { inherit ApplicationServices; };
|
||||
SceneKit = {};
|
||||
ScreenSaver = {};
|
||||
Scripting = {};
|
||||
ScriptingBridge = {};
|
||||
Security = { inherit IOKit; };
|
||||
SecurityFoundation = {};
|
||||
SecurityInterface = { inherit Security SecurityFoundation; };
|
||||
ServiceManagement = { inherit Security; };
|
||||
Social = {};
|
||||
SpriteKit = {};
|
||||
StoreKit = {};
|
||||
SyncServices = {};
|
||||
SystemConfiguration = { inherit Security; };
|
||||
TWAIN = { inherit Carbon; };
|
||||
Tcl = {};
|
||||
VideoDecodeAcceleration = { inherit CoreVideo; };
|
||||
VideoToolbox = { inherit CoreMedia CoreVideo; };
|
||||
WebKit = { inherit libobjc ApplicationServices Carbon JavaScriptCore OpenGL; };
|
||||
|
||||
# Umbrellas
|
||||
Accelerate = { inherit CoreWLAN IOBluetooth; };
|
||||
ApplicationServices = { inherit CoreGraphics CoreServices CoreText ImageIO; };
|
||||
Carbon = { inherit libobjc ApplicationServices CoreServices Foundation IOKit Security QuartzCore; };
|
||||
CoreBluetooth = {};
|
||||
# TODO: figure out which part of the umbrella depends on CoreFoundation and move it there.
|
||||
CoreServices = { inherit CFNetwork CoreFoundation CoreAudio CoreData DiskArbitration Security NetFS OpenDirectory ServiceManagement; };
|
||||
IOBluetooth = { inherit CoreBluetooth IOKit; };
|
||||
JavaVM = {};
|
||||
OpenDirectory = {};
|
||||
Quartz = { inherit QuartzCore QuickLook QTKit; };
|
||||
QuartzCore = { inherit libobjc ApplicationServices CoreVideo OpenCL CoreImage Metal; };
|
||||
QuickTime = { inherit ApplicationServices AudioUnit Carbon CoreAudio CoreServices OpenGL QuartzCore; };
|
||||
|
||||
vmnet = {};
|
||||
}
|
||||
256
pkgs/os-specific/darwin/apple-sdk/impure-deps.nix
Normal file
256
pkgs/os-specific/darwin/apple-sdk/impure-deps.nix
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
rec {
|
||||
CFNetwork = [
|
||||
"/System/Library/Frameworks/CFNetwork.framework"
|
||||
"/usr/lib/libsqlite3.dylib"
|
||||
"/usr/lib/libxml2.2.dylib"
|
||||
];
|
||||
ForceFeedback = [
|
||||
"/System/Library/Frameworks/ForceFeedback.framework"
|
||||
];
|
||||
AGL = [
|
||||
"/System/Library/Frameworks/AGL.framework"
|
||||
];
|
||||
IOKit = [
|
||||
"/System/Library/Frameworks/IOKit.framework"
|
||||
];
|
||||
JavaScriptCore = [
|
||||
"/System/Library/Frameworks/JavaScriptCore.framework"
|
||||
];
|
||||
QuickLook = [
|
||||
"/System/Library/Frameworks/QuickLook.framework"
|
||||
];
|
||||
Quartz = [
|
||||
"/System/Library/Frameworks/Quartz.framework"
|
||||
"/System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo"
|
||||
"/System/Library/PrivateFrameworks/CorePDF.framework/Versions/A/CorePDF"
|
||||
"/usr/lib/libspindump.dylib"
|
||||
];
|
||||
ImageCaptureCore = [
|
||||
"/System/Library/Frameworks/ImageCaptureCore.framework"
|
||||
];
|
||||
VideoToolbox = [
|
||||
"/System/Library/Frameworks/VideoToolbox.framework"
|
||||
"/System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA"
|
||||
];
|
||||
QuickTime = [
|
||||
"/System/Library/Frameworks/QuickTime.framework"
|
||||
];
|
||||
CoreMedia = [
|
||||
"/System/Library/Frameworks/CoreMedia.framework"
|
||||
];
|
||||
CoreMediaIO = [
|
||||
"/System/Library/Frameworks/CoreMediaIO.framework"
|
||||
"/System/Library/PrivateFrameworks/AppSandbox.framework/Versions/A/AppSandbox"
|
||||
"/System/Library/PrivateFrameworks/AppContainer.framework/Versions/A/AppContainer"
|
||||
"/System/Library/PrivateFrameworks/SecCodeWrapper.framework/Versions/A/SecCodeWrapper"
|
||||
"/System/Library/PrivateFrameworks/XPCService.framework/Versions/A/XPCService"
|
||||
"/usr/lib/libsandbox.1.dylib"
|
||||
"/usr/lib/libMatch.1.dylib"
|
||||
];
|
||||
MediaToolbox = [
|
||||
"/System/Library/Frameworks/MediaToolbox.framework"
|
||||
"/System/Library/PrivateFrameworks/CoreAUC.framework/Versions/A/CoreAUC"
|
||||
"/System/Library/PrivateFrameworks/NetworkStatistics.framework/Versions/A/NetworkStatistics"
|
||||
];
|
||||
QTKit = [
|
||||
"/System/Library/Frameworks/QTKit.framework"
|
||||
"/System/Library/PrivateFrameworks/CoreMediaAuthoring.framework/Versions/A/CoreMediaAuthoring"
|
||||
];
|
||||
OSAKit = [
|
||||
"/System/Library/Frameworks/OSAKit.framework"
|
||||
"/usr/lib/libexslt.0.dylib"
|
||||
];
|
||||
WebKit = [
|
||||
"/System/Library/Frameworks/WebKit.framework"
|
||||
];
|
||||
DiskArbitration = [
|
||||
"/System/Library/Frameworks/DiskArbitration.framework"
|
||||
];
|
||||
Security = [
|
||||
"/System/Library/Frameworks/Security.framework"
|
||||
"/usr/lib/libbsm.0.dylib"
|
||||
"/usr/lib/libbz2.1.0.dylib"
|
||||
"/usr/lib/libpam.2.dylib"
|
||||
"/usr/lib/libxar.1.dylib"
|
||||
"/usr/lib/libxml2.2.dylib"
|
||||
"/usr/lib/libsqlite3.dylib"
|
||||
];
|
||||
GSS = [
|
||||
"/System/Library/Frameworks/GSS.framework"
|
||||
];
|
||||
Kerberos = [
|
||||
"/System/Library/Frameworks/Kerberos.framework"
|
||||
];
|
||||
CoreServices = [
|
||||
"/System/Library/Frameworks/CoreServices.framework"
|
||||
"/System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore"
|
||||
"/System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC"
|
||||
"/System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling"
|
||||
"/usr/lib/libmecabra.dylib"
|
||||
"/usr/lib/libcmph.dylib"
|
||||
"/usr/lib/libiconv.2.dylib"
|
||||
"/usr/lib/libxslt.1.dylib"
|
||||
] ++ Foundation;
|
||||
IOSurface = [
|
||||
"/System/Library/Frameworks/IOSurface.framework"
|
||||
];
|
||||
CoreGraphics = [
|
||||
"/System/Library/Frameworks/CoreGraphics.framework"
|
||||
"/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport"
|
||||
"/usr/lib/libbsm.0.dylib"
|
||||
"/usr/lib/libz.1.dylib"
|
||||
];
|
||||
CoreText = [
|
||||
"/System/Library/Frameworks/CoreText.framework"
|
||||
];
|
||||
ImageIO = [
|
||||
"/System/Library/Frameworks/ImageIO.framework"
|
||||
];
|
||||
ApplicationServices = [
|
||||
"/System/Library/Frameworks/ApplicationServices.framework"
|
||||
"/usr/lib/libcups.2.dylib"
|
||||
"/usr/lib/libresolv.9.dylib"
|
||||
] ++ AudioToolbox;
|
||||
OpenGL = [
|
||||
"/System/Library/Frameworks/OpenGL.framework"
|
||||
];
|
||||
CoreVideo = [
|
||||
"/System/Library/Frameworks/CoreVideo.framework"
|
||||
];
|
||||
QuartzCore = [
|
||||
"/System/Library/Frameworks/QuartzCore.framework"
|
||||
"/System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport"
|
||||
];
|
||||
PCSC = [
|
||||
"/System/Library/Frameworks/PCSC.framework"
|
||||
];
|
||||
AppKit = [
|
||||
"/System/Library/Frameworks/AppKit.framework"
|
||||
"/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211"
|
||||
"/System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG"
|
||||
"/System/Library/PrivateFrameworks/AppleVPA.framework/Versions/A/AppleVPA"
|
||||
"/System/Library/PrivateFrameworks/Backup.framework/Versions/A/Backup"
|
||||
"/System/Library/PrivateFrameworks/ChunkingLibrary.framework/Versions/A/ChunkingLibrary"
|
||||
"/System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth"
|
||||
"/System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication"
|
||||
"/System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI"
|
||||
"/System/Library/PrivateFrameworks/CoreWiFi.framework/Versions/A/CoreWiFi"
|
||||
"/System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport"
|
||||
"/System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore"
|
||||
"/System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols"
|
||||
"/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv"
|
||||
"/System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/FaceCore"
|
||||
"/System/Library/PrivateFrameworks/GenerationalStorage.framework/Versions/A/GenerationalStorage"
|
||||
"/System/Library/PrivateFrameworks/Heimdal.framework/Heimdal"
|
||||
"/System/Library/PrivateFrameworks/Heimdal.framework/Versions/Current"
|
||||
"/System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal"
|
||||
"/System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices"
|
||||
"/System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling"
|
||||
"/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport"
|
||||
"/System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth"
|
||||
"/System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis"
|
||||
"/System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices"
|
||||
"/System/Library/PrivateFrameworks/Sharing.framework/Versions/A/Sharing"
|
||||
"/System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore"
|
||||
"/System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication"
|
||||
"/System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC"
|
||||
"/System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation"
|
||||
"/System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport"
|
||||
"/usr/lib/libCRFSuite.dylib"
|
||||
"/usr/lib/libOpenScriptingUtil.dylib"
|
||||
"/usr/lib/libarchive.2.dylib"
|
||||
"/usr/lib/libbsm.0.dylib"
|
||||
"/usr/lib/libbz2.1.0.dylib"
|
||||
"/usr/lib/libc++.1.dylib"
|
||||
"/usr/lib/libc++abi.dylib"
|
||||
"/usr/lib/libcmph.dylib"
|
||||
"/usr/lib/libcups.2.dylib"
|
||||
"/usr/lib/libextension.dylib"
|
||||
"/usr/lib/libheimdal-asn1.dylib"
|
||||
"/usr/lib/libiconv.2.dylib"
|
||||
"/usr/lib/libicucore.A.dylib"
|
||||
"/usr/lib/liblangid.dylib"
|
||||
"/usr/lib/liblzma.5.dylib"
|
||||
"/usr/lib/libmecabra.dylib"
|
||||
"/usr/lib/libpam.2.dylib"
|
||||
"/usr/lib/libresolv.9.dylib"
|
||||
"/usr/lib/libsqlite3.dylib"
|
||||
"/usr/lib/libxar.1.dylib"
|
||||
"/usr/lib/libxml2.2.dylib"
|
||||
"/usr/lib/libxslt.1.dylib"
|
||||
"/usr/lib/libz.1.dylib"
|
||||
];
|
||||
Foundation = [
|
||||
"/System/Library/Frameworks/Foundation.framework"
|
||||
"/usr/lib/libextension.dylib"
|
||||
"/usr/lib/libarchive.2.dylib"
|
||||
"/usr/lib/liblzma.5.dylib"
|
||||
"/usr/lib/liblangid.dylib"
|
||||
"/usr/lib/libCRFSuite.dylib"
|
||||
];
|
||||
CoreData = [
|
||||
"/System/Library/Frameworks/CoreData.framework"
|
||||
];
|
||||
Cocoa = [
|
||||
"/System/Library/Frameworks/Cocoa.framework"
|
||||
"/System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation"
|
||||
"/System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A"
|
||||
];
|
||||
Carbon = [
|
||||
"/System/Library/Frameworks/Carbon.framework"
|
||||
"/System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI"
|
||||
"/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv"
|
||||
"/System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices"
|
||||
"/System/Library/PrivateFrameworks/ChunkingLibrary.framework/Versions/A/ChunkingLibrary"
|
||||
"/System/Library/PrivateFrameworks/Sharing.framework/Versions/A/Sharing"
|
||||
"/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211"
|
||||
"/System/Library/PrivateFrameworks/GenerationalStorage.framework/Versions/A/GenerationalStorage"
|
||||
];
|
||||
CoreAudio = [
|
||||
"/System/Library/Frameworks/CoreAudio.framework"
|
||||
];
|
||||
AudioUnit = [
|
||||
"/System/Library/Frameworks/AudioUnit.framework"
|
||||
];
|
||||
CoreMIDI = [
|
||||
"/System/Library/Frameworks/CoreMIDI.framework"
|
||||
];
|
||||
AudioToolbox = [
|
||||
"/System/Library/Frameworks/AudioToolbox.framework"
|
||||
];
|
||||
SystemConfiguration = [
|
||||
"/System/Library/Frameworks/SystemConfiguration.framework"
|
||||
];
|
||||
NetFS = [
|
||||
"/System/Library/Frameworks/NetFS.framework"
|
||||
"/System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth"
|
||||
"/System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport"
|
||||
];
|
||||
Accelerate = [
|
||||
"/System/Library/Frameworks/Accelerate.framework"
|
||||
];
|
||||
OpenDirectory = [
|
||||
"/System/Library/Frameworks/OpenDirectory.framework"
|
||||
];
|
||||
ServiceManagement = [
|
||||
"/System/Library/Frameworks/ServiceManagement.framework"
|
||||
];
|
||||
OpenCL = [
|
||||
"/System/Library/Frameworks/OpenCL.framework"
|
||||
];
|
||||
CoreWLAN = [
|
||||
"/System/Library/Frameworks/CoreWLAN.framework"
|
||||
];
|
||||
IOBluetooth = [
|
||||
"/System/Library/Frameworks/IOBluetooth.framework"
|
||||
] ++ AudioUnit ++ CoreBluetooth;
|
||||
CoreBluetooth = [
|
||||
"/System/Library/Frameworks/CoreBluetooth.framework"
|
||||
];
|
||||
SecurityFoundation = [
|
||||
"/System/Library/Frameworks/SecurityFoundation.framework"
|
||||
];
|
||||
Kernel = [
|
||||
"/System/Library/Frameworks/Kernel.framework"
|
||||
];
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
addPrivateFrameworks() {
|
||||
flag="-F/System/Library/PrivateFrameworks"
|
||||
if [[ "${NIX_CFLAGS_COMPILE-}" != *$flag* ]]; then
|
||||
NIX_CFLAGS_COMPILE+=" $flag"
|
||||
fi
|
||||
}
|
||||
|
||||
addEnvHooks "$hostOffset" addPrivateFrameworks
|
||||
10
pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh
Normal file
10
pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
noDeprecatedDeclarations() {
|
||||
# Security.framework has about 2000 deprecated constants, all of which the user will be
|
||||
# warned about at compilation time
|
||||
flag="-Wno-deprecated-declarations"
|
||||
if [[ "${NIX_CFLAGS_COMPILE-}" != *$flag* ]]; then
|
||||
NIX_CFLAGS_COMPILE+=" $flag"
|
||||
fi
|
||||
}
|
||||
|
||||
addEnvHooks "$hostOffset" noDeprecatedDeclarations
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{ lib, appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
cp MacTypes.h $out/include
|
||||
cp ConditionalMacros.h $out/include
|
||||
|
||||
substituteInPlace $out/include/MacTypes.h \
|
||||
--replace "CarbonCore/" ""
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
{ lib, appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
installPhase = ''
|
||||
mkdir -p $out/include/CommonCrypto
|
||||
cp include/* $out/include/CommonCrypto
|
||||
'';
|
||||
|
||||
appleHeaders = ''
|
||||
CommonCrypto/CommonBaseXX.h
|
||||
CommonCrypto/CommonBigNum.h
|
||||
CommonCrypto/CommonCMACSPI.h
|
||||
CommonCrypto/CommonCRC.h
|
||||
CommonCrypto/CommonCrypto.h
|
||||
CommonCrypto/CommonCryptoError.h
|
||||
CommonCrypto/CommonCryptoPriv.h
|
||||
CommonCrypto/CommonCryptor.h
|
||||
CommonCrypto/CommonCryptorSPI.h
|
||||
CommonCrypto/CommonDH.h
|
||||
CommonCrypto/CommonDigest.h
|
||||
CommonCrypto/CommonDigestSPI.h
|
||||
CommonCrypto/CommonECCryptor.h
|
||||
CommonCrypto/CommonHMAC.h
|
||||
CommonCrypto/CommonHMacSPI.h
|
||||
CommonCrypto/CommonKeyDerivation.h
|
||||
CommonCrypto/CommonKeyDerivationSPI.h
|
||||
CommonCrypto/CommonNumerics.h
|
||||
CommonCrypto/CommonRSACryptor.h
|
||||
CommonCrypto/CommonRandom.h
|
||||
CommonCrypto/CommonRandomSPI.h
|
||||
CommonCrypto/CommonSymmetricKeywrap.h
|
||||
CommonCrypto/aes.h
|
||||
CommonCrypto/lionCompat.h
|
||||
CommonCrypto/module.modulemap
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
{ lib, appleDerivation', stdenv }:
|
||||
|
||||
appleDerivation' stdenv {
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace /usr/lib /lib \
|
||||
--replace /usr/local/lib /lib \
|
||||
--replace /usr/bin "" \
|
||||
--replace /bin/ "" \
|
||||
--replace "CC = " "#" \
|
||||
--replace "SDK_DIR = " "SDK_DIR = . #" \
|
||||
|
||||
# Mac OS didn't support rpaths back before 10.5, but we don't care about it.
|
||||
substituteInPlace Makefile \
|
||||
--replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.6 \
|
||||
--replace -mmacosx-version-min=10.5 -mmacosx-version-min=10.6
|
||||
'';
|
||||
|
||||
installFlags = [ "DSTROOT=$(out)" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Apple's common startup stubs for darwin";
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
{ appleDerivation, lib, stdenv, buildPackages, python3 }:
|
||||
|
||||
let
|
||||
formatVersionNumeric = version:
|
||||
let
|
||||
versionParts = lib.versions.splitVersion version;
|
||||
major = lib.toInt (lib.elemAt versionParts 0);
|
||||
minor = lib.toInt (lib.elemAt versionParts 1);
|
||||
patch = if lib.length versionParts > 2 then lib.toInt (lib.elemAt versionParts 2) else 0;
|
||||
in toString (major * 10000 + minor * 100 + patch);
|
||||
in
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ python3 ];
|
||||
|
||||
depsBuildBuild = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace makefile \
|
||||
--replace "/usr/bin/" "" \
|
||||
--replace "xcrun --sdk macosx --find" "echo -n" \
|
||||
--replace "xcrun --sdk macosx.internal --show-sdk-path" "echo -n /dev/null" \
|
||||
--replace "-install_name " "-install_name $out"
|
||||
|
||||
substituteInPlace icuSources/config/mh-darwin \
|
||||
--replace "-install_name " "-install_name $out/"
|
||||
|
||||
# drop using impure /var/db/timezone/icutz
|
||||
substituteInPlace makefile \
|
||||
--replace '-DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\"' ""
|
||||
|
||||
# FIXME: This will cause `ld: warning: OS version (12.0) too small, changing to 13.0.0`, APPLE should fix it.
|
||||
substituteInPlace makefile \
|
||||
--replace "ZIPPERING_LDFLAGS=-Wl,-iosmac_version_min,12.0" "ZIPPERING_LDFLAGS="
|
||||
|
||||
# skip test for missing encodingSamples data
|
||||
substituteInPlace icuSources/test/cintltst/ucsdetst.c \
|
||||
--replace "&TestMailFilterCSS" "NULL"
|
||||
|
||||
patchShebangs icuSources
|
||||
'' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
|
||||
|
||||
# This looks like a bug in the makefile. It defines ENV_BUILDHOST to
|
||||
# propagate the correct value of CC, CXX, etc, but has the following double
|
||||
# expansion that results in the empty string.
|
||||
substituteInPlace makefile \
|
||||
--replace '$($(ENV_BUILDHOST))' '$(ENV_BUILDHOST)'
|
||||
'';
|
||||
|
||||
# APPLE is using makefile to save its default configuration and call ./configure, so we hack makeFlags
|
||||
# instead of configuring ourself, trying to stay abreast of APPLE.
|
||||
dontConfigure = true;
|
||||
makeFlags = [
|
||||
"DSTROOT=$(out)"
|
||||
|
||||
# remove /usr prefix on include and lib
|
||||
"PRIVATE_HDR_PREFIX="
|
||||
"libdir=/lib/"
|
||||
|
||||
"DATA_INSTALL_DIR=/share/icu/"
|
||||
"DATA_LOOKUP_DIR=$(DSTROOT)$(DATA_INSTALL_DIR)"
|
||||
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # darwin* platform properties are only defined on darwin
|
||||
# hack to use our lower macos version
|
||||
"MAC_OS_X_VERSION_MIN_REQUIRED=${formatVersionNumeric stdenv.hostPlatform.darwinMinVersion}"
|
||||
"ICU_TARGET_VERSION=-m${stdenv.hostPlatform.darwinPlatform}-version-min=${stdenv.hostPlatform.darwinMinVersion}"
|
||||
]
|
||||
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
||||
"CROSS_BUILD=YES"
|
||||
"BUILD_TYPE="
|
||||
"RC_ARCHS=${stdenv.hostPlatform.darwinArch}"
|
||||
"HOSTCC=cc"
|
||||
"HOSTCXX=c++"
|
||||
"CC=${stdenv.cc.targetPrefix}cc"
|
||||
"CXX=${stdenv.cc.targetPrefix}c++"
|
||||
"HOSTISYSROOT="
|
||||
"OSX_HOST_VERSION_MIN_STRING=${stdenv.buildPlatform.darwinMinVersion}"
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
checkTarget = "check";
|
||||
|
||||
postInstall = ''
|
||||
# we don't need all those in usr/local
|
||||
rm -rf $out/usr
|
||||
'';
|
||||
}
|
||||
190
pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix
Normal file
190
pkgs/os-specific/darwin/apple-source-releases/IOKit/default.nix
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
{ lib, appleDerivation', stdenv, IOKitSrcs, xnu, darwin-stubs }:
|
||||
|
||||
# Someday it'll make sense to split these out into their own packages, but today is not that day.
|
||||
appleDerivation' stdenv {
|
||||
srcs = lib.attrValues IOKitSrcs;
|
||||
sourceRoot = ".";
|
||||
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
|
||||
__propagatedImpureHostDeps = [
|
||||
"/System/Library/Frameworks/IOKit.framework/IOKit"
|
||||
"/System/Library/Frameworks/IOKit.framework/Resources"
|
||||
"/System/Library/Frameworks/IOKit.framework/Versions"
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/Library/Frameworks/IOKit.framework
|
||||
|
||||
###### IMPURITIES
|
||||
ln -s /System/Library/Frameworks/IOKit.framework/Resources \
|
||||
$out/Library/Frameworks/IOKit.framework
|
||||
|
||||
###### STUBS
|
||||
cp ${darwin-stubs}/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit.tbd \
|
||||
$out/Library/Frameworks/IOKit.framework
|
||||
|
||||
###### HEADERS
|
||||
|
||||
export dest=$out/Library/Frameworks/IOKit.framework/Headers
|
||||
mkdir -p $dest
|
||||
|
||||
pushd $dest
|
||||
mkdir audio avc DV firewire graphics hid hidsystem i2c kext ndrvsupport
|
||||
mkdir network ps pwr_mgt sbp2 scsi serial storage stream usb video
|
||||
popd
|
||||
|
||||
# root: complete
|
||||
cp IOKitUser-*/IOCFBundle.h $dest
|
||||
cp IOKitUser-*/IOCFPlugIn.h $dest
|
||||
cp IOKitUser-*/IOCFSerialize.h $dest
|
||||
cp IOKitUser-*/IOCFUnserialize.h $dest
|
||||
cp IOKitUser-*/IOCFURLAccess.h $dest
|
||||
cp IOKitUser-*/IODataQueueClient.h $dest
|
||||
cp IOKitUser-*/IOKitLib.h $dest
|
||||
cp IOKitUser-*/iokitmig.h $dest
|
||||
cp ${xnu}/Library/PrivateFrameworks/IOKit.framework/Versions/A/Headers/*.h $dest
|
||||
|
||||
# audio: complete
|
||||
cp IOAudioFamily-*/IOAudioDefines.h $dest/audio
|
||||
cp IOKitUser-*/audio.subproj/IOAudioLib.h $dest/audio
|
||||
cp IOAudioFamily-*/IOAudioTypes.h $dest/audio
|
||||
|
||||
# avc: complete
|
||||
cp IOFireWireAVC-*/IOFireWireAVC/IOFireWireAVCConsts.h $dest/avc
|
||||
cp IOFireWireAVC-*/IOFireWireAVCLib/IOFireWireAVCLib.h $dest/avc
|
||||
|
||||
# DV: complete
|
||||
cp IOFWDVComponents-*/DVFamily.h $dest/DV
|
||||
|
||||
# firewire: complete
|
||||
cp IOFireWireFamily-*/IOFireWireFamily.kmodproj/IOFireWireFamilyCommon.h $dest/firewire
|
||||
cp IOFireWireFamily-*/IOFireWireLib.CFPlugInProj/IOFireWireLib.h $dest/firewire
|
||||
cp IOFireWireFamily-*/IOFireWireLib.CFPlugInProj/IOFireWireLibIsoch.h $dest/firewire
|
||||
cp IOFireWireFamily-*/IOFireWireFamily.kmodproj/IOFWIsoch.h $dest/firewire
|
||||
|
||||
# graphics: missing AppleGraphicsDeviceControlUserCommand.h
|
||||
cp IOGraphics-*/IOGraphicsFamily/IOKit/graphics/IOAccelClientConnect.h $dest/graphics
|
||||
cp IOGraphics-*/IOGraphicsFamily/IOKit/graphics/IOAccelSurfaceConnect.h $dest/graphics
|
||||
cp IOGraphics-*/IOGraphicsFamily/IOKit/graphics/IOAccelTypes.h $dest/graphics
|
||||
cp IOGraphics-*/IOGraphicsFamily/IOKit/graphics/IOFramebufferShared.h $dest/graphics
|
||||
cp IOGraphics-*/IOGraphicsFamily/IOKit/graphics/IOGraphicsEngine.h $dest/graphics
|
||||
cp IOGraphics-*/IOGraphicsFamily/IOKit/graphics/IOGraphicsInterface.h $dest/graphics
|
||||
cp IOGraphics-*/IOGraphicsFamily/IOKit/graphics/IOGraphicsInterfaceTypes.h $dest/graphics
|
||||
cp IOKitUser-*/graphics.subproj/IOGraphicsLib.h $dest/graphics
|
||||
cp IOGraphics-*/IOGraphicsFamily/IOKit/graphics/IOGraphicsTypes.h $dest/graphics
|
||||
|
||||
# hid: complete
|
||||
cp IOKitUser-*/hid.subproj/IOHIDBase.h $dest/hid
|
||||
cp IOKitUser-*/hid.subproj/IOHIDDevice.h $dest/hid
|
||||
cp IOKitUser-*/hid.subproj/IOHIDDevicePlugIn.h $dest/hid
|
||||
cp IOKitUser-*/hid.subproj/IOHIDElement.h $dest/hid
|
||||
cp IOKitUser-*/hid.subproj/IOHIDLib.h $dest/hid
|
||||
cp IOKitUser-*/hid.subproj/IOHIDManager.h $dest/hid
|
||||
cp IOKitUser-*/hid.subproj/IOHIDQueue.h $dest/hid
|
||||
cp IOKitUser-*/hid.subproj/IOHIDTransaction.h $dest/hid
|
||||
cp IOKitUser-*/hid.subproj/IOHIDValue.h $dest/hid
|
||||
cp IOHIDFamily-*/IOHIDFamily/IOHIDKeys.h $dest/hid
|
||||
cp IOHIDFamily-*/IOHIDFamily/IOHIDUsageTables.h $dest/hid
|
||||
cp IOHIDFamily-*/IOHIDLib/IOHIDLibObsolete.h $dest/hid
|
||||
|
||||
# hidsystem: complete
|
||||
cp IOHIDFamily-*/IOHIDSystem/IOKit/hidsystem/ev_keymap.h $dest/hidsystem
|
||||
cp IOKitUser-*/hidsystem.subproj/event_status_driver.h $dest/hidsystem
|
||||
cp IOKitUser-*/hidsystem.subproj/IOHIDLib.h $dest/hidsystem
|
||||
cp IOHIDFamily-*/IOHIDSystem/IOKit/hidsystem/IOHIDParameter.h $dest/hidsystem
|
||||
cp IOHIDFamily-*/IOHIDSystem/IOKit/hidsystem/IOHIDShared.h $dest/hidsystem
|
||||
cp IOHIDFamily-*/IOHIDSystem/IOKit/hidsystem/IOHIDTypes.h $dest/hidsystem
|
||||
cp IOHIDFamily-*/IOHIDSystem/IOKit/hidsystem/IOLLEvent.h $dest/hidsystem
|
||||
|
||||
|
||||
# i2c: complete
|
||||
cp IOGraphics-*/IOGraphicsFamily/IOKit/i2c/IOI2CInterface.h $dest/i2c
|
||||
|
||||
# kext: complete
|
||||
cp IOKitUser-*/kext.subproj/KextManager.h $dest/kext
|
||||
|
||||
# ndrvsupport: complete
|
||||
cp IOGraphics-*/IONDRVSupport/IOKit/ndrvsupport/IOMacOSTypes.h $dest/ndrvsupport
|
||||
cp IOGraphics-*/IONDRVSupport/IOKit/ndrvsupport/IOMacOSVideo.h $dest/ndrvsupport
|
||||
|
||||
# network: complete
|
||||
cp IONetworkingFamily-*/IOEthernetController.h $dest/network
|
||||
cp IONetworkingFamily-*/IOEthernetInterface.h $dest/network
|
||||
cp IONetworkingFamily-*/IOEthernetStats.h $dest/network
|
||||
cp IONetworkingFamily-*/IONetworkController.h $dest/network
|
||||
cp IONetworkingFamily-*/IONetworkData.h $dest/network
|
||||
cp IONetworkingFamily-*/IONetworkInterface.h $dest/network
|
||||
cp IOKitUser-*/network.subproj/IONetworkLib.h $dest/network
|
||||
cp IONetworkingFamily-*/IONetworkMedium.h $dest/network
|
||||
cp IONetworkingFamily-*/IONetworkStack.h $dest/network
|
||||
cp IONetworkingFamily-*/IONetworkStats.h $dest/network
|
||||
cp IONetworkingFamily-*/IONetworkUserClient.h $dest/network
|
||||
|
||||
# ps: missing IOUPSPlugIn.h
|
||||
cp IOKitUser-*/ps.subproj/IOPowerSources.h $dest/ps
|
||||
cp IOKitUser-*/ps.subproj/IOPSKeys.h $dest/ps
|
||||
|
||||
# pwr_mgt: complete
|
||||
cp IOKitUser-*/pwr_mgt.subproj/IOPMKeys.h $dest/pwr_mgt
|
||||
cp IOKitUser-*/pwr_mgt.subproj/IOPMLib.h $dest/pwr_mgt
|
||||
cp ${xnu}/Library/PrivateFrameworks/IOKit.framework/Versions/A/Headers/pwr_mgt/*.h $dest/pwr_mgt
|
||||
cp IOKitUser-*/pwr_mgt.subproj/IOPMLibPrivate.h $dest/pwr_mgt # Private
|
||||
|
||||
# sbp2: complete
|
||||
cp IOFireWireSBP2-*/IOFireWireSBP2Lib/IOFireWireSBP2Lib.h $dest/sbp2
|
||||
|
||||
# scsi: omitted for now
|
||||
|
||||
# serial: complete
|
||||
cp IOSerialFamily-*/IOSerialFamily.kmodproj/IOSerialKeys.h $dest/serial
|
||||
cp IOSerialFamily-*/IOSerialFamily.kmodproj/ioss.h $dest/serial
|
||||
|
||||
# storage: complete
|
||||
# Needs ata subdirectory
|
||||
cp IOStorageFamily-*/IOAppleLabelScheme.h $dest/storage
|
||||
cp IOStorageFamily-*/IOApplePartitionScheme.h $dest/storage
|
||||
cp IOBDStorageFamily-*/IOBDBlockStorageDevice.h $dest/storage
|
||||
cp IOBDStorageFamily-*/IOBDMedia.h $dest/storage
|
||||
cp IOBDStorageFamily-*/IOBDMediaBSDClient.h $dest/storage
|
||||
cp IOBDStorageFamily-*/IOBDTypes.h $dest/storage
|
||||
cp IOStorageFamily-*/IOBlockStorageDevice.h $dest/storage
|
||||
cp IOStorageFamily-*/IOBlockStorageDriver.h $dest/storage
|
||||
cp IOCDStorageFamily-*/IOCDBlockStorageDevice.h $dest/storage
|
||||
cp IOCDStorageFamily-*/IOCDMedia.h $dest/storage
|
||||
cp IOCDStorageFamily-*/IOCDMediaBSDClient.h $dest/storage
|
||||
cp IOCDStorageFamily-*/IOCDPartitionScheme.h $dest/storage
|
||||
cp IOCDStorageFamily-*/IOCDTypes.h $dest/storage
|
||||
cp IODVDStorageFamily-*/IODVDBlockStorageDevice.h $dest/storage
|
||||
cp IODVDStorageFamily-*/IODVDMedia.h $dest/storage
|
||||
cp IODVDStorageFamily-*/IODVDMediaBSDClient.h $dest/storage
|
||||
cp IODVDStorageFamily-*/IODVDTypes.h $dest/storage
|
||||
cp IOStorageFamily-*/IOFDiskPartitionScheme.h $dest/storage
|
||||
cp IOStorageFamily-*/IOFilterScheme.h $dest/storage
|
||||
cp IOFireWireSerialBusProtocolTransport-*/IOFireWireStorageCharacteristics.h $dest/storage
|
||||
cp IOStorageFamily-*/IOGUIDPartitionScheme.h $dest/storage
|
||||
cp IOStorageFamily-*/IOMedia.h $dest/storage
|
||||
cp IOStorageFamily-*/IOMediaBSDClient.h $dest/storage
|
||||
cp IOStorageFamily-*/IOPartitionScheme.h $dest/storage
|
||||
cp IOStorageFamily-*/IOStorage.h $dest/storage
|
||||
cp IOStorageFamily-*/IOStorageCardCharacteristics.h $dest/storage
|
||||
cp IOStorageFamily-*/IOStorageDeviceCharacteristics.h $dest/storage
|
||||
cp IOStorageFamily-*/IOStorageProtocolCharacteristics.h $dest/storage
|
||||
|
||||
# stream: missing altogether
|
||||
|
||||
# usb: complete
|
||||
cp IOUSBFamily-630.4.5/IOUSBFamily/Headers/IOUSBLib.h $dest/usb
|
||||
cp IOUSBFamily-630.4.5/IOUSBUserClient/Headers/IOUSBUserClient.h $dest/usb
|
||||
cp IOUSBFamily-560.4.2/IOUSBFamily/Headers/USB.h $dest/usb # This file is empty in 630.4.5!
|
||||
cp IOUSBFamily-630.4.5/IOUSBFamily/Headers/USBSpec.h $dest/usb
|
||||
|
||||
# video: missing altogether
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
maintainers = with maintainers; [ joelteon copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
From 187d0e8847d080790b22724352e51de50d214dd8 Mon Sep 17 00:00:00 2001
|
||||
From: toonn <toonn@toonn.io>
|
||||
Date: Tue, 27 Jul 2021 15:12:14 +0200
|
||||
Subject: [PATCH] Define TARGET_OS_EMBEDDED in std{lib,io} if not defined
|
||||
|
||||
Originally attempted including `TargetConditionals.h` but this had
|
||||
knock-on effects, for example, breaking the zlib build because of
|
||||
`TARGET_OS_MAC` getting defined.
|
||||
|
||||
This should be the lowest impact solution and corresponds to the default
|
||||
behavior IIUC.
|
||||
---
|
||||
include/stdio.h | 3 +++
|
||||
include/stdlib.h | 3 +++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/include/stdio.h b/include/stdio.h
|
||||
index d0cf7a5..487496e 100644
|
||||
--- a/include/stdio.h
|
||||
+++ b/include/stdio.h
|
||||
@@ -351,6 +351,9 @@ __END_DECLS
|
||||
/* Additional functionality provided by:
|
||||
* POSIX.2-1992 C Language Binding Option
|
||||
*/
|
||||
+#ifndef TARGET_OS_EMBEDDED
|
||||
+# define TARGET_OS_EMBEDDED 0
|
||||
+#endif
|
||||
#if TARGET_OS_EMBEDDED
|
||||
#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg)
|
||||
#else
|
||||
diff --git a/include/stdlib.h b/include/stdlib.h
|
||||
index c04d3a7..0b454ba 100644
|
||||
--- a/include/stdlib.h
|
||||
+++ b/include/stdlib.h
|
||||
@@ -183,6 +183,9 @@ unsigned long long
|
||||
#ifndef LIBC_ALIAS_SYSTEM
|
||||
//End-Libc
|
||||
|
||||
+#ifndef TARGET_OS_EMBEDDED
|
||||
+# define TARGET_OS_EMBEDDED 0
|
||||
+#endif
|
||||
#if TARGET_OS_EMBEDDED
|
||||
#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg)
|
||||
#else
|
||||
--
|
||||
2.17.2 (Apple Git-113)
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ appleDerivation', stdenvNoCC, ed, unifdef }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
nativeBuildInputs = [ ed unifdef ];
|
||||
|
||||
installPhase = ''
|
||||
export SRCROOT=$PWD
|
||||
export DSTROOT=$out
|
||||
export PUBLIC_HEADERS_FOLDER_PATH=include
|
||||
export PRIVATE_HEADERS_FOLDER_PATH=include
|
||||
bash xcodescripts/headers.sh
|
||||
'';
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
{ appleDerivation', stdenvNoCC, ed, unifdef, Libc_old, Libc_10-9 }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
nativeBuildInputs = [ ed unifdef ];
|
||||
|
||||
patches = [
|
||||
./0001-Define-TARGET_OS_EMBEDDED-in-std-lib-io-if-not-defin.patch
|
||||
];
|
||||
|
||||
# TODO: asl.h actually comes from syslog project now
|
||||
installPhase = ''
|
||||
export SRCROOT=$PWD
|
||||
export DSTROOT=$out
|
||||
export PUBLIC_HEADERS_FOLDER_PATH=include
|
||||
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...
|
||||
cp ${Libc_old}/include/spawn.h $out/include
|
||||
cp ${Libc_old}/include/setjmp.h $out/include
|
||||
cp ${Libc_old}/include/ucontext.h $out/include
|
||||
cp ${Libc_old}/include/pthread*.h $out/include
|
||||
cp ${Libc_old}/include/sched.h $out/include
|
||||
cp -R ${Libc_old}/include/malloc $out/include
|
||||
|
||||
mkdir -p $out/include/libkern
|
||||
cp ${Libc_old}/include/asl.h $out/include
|
||||
cp ${Libc_old}/include/libproc.h $out/include
|
||||
cp ${Libc_old}/include/libkern/OSAtomic.h $out/include/libkern
|
||||
cp ${Libc_old}/include/libkern/OSCacheControl.h $out/include/libkern
|
||||
'';
|
||||
|
||||
appleHeaders = builtins.readFile ./headers.txt;
|
||||
}
|
||||
138
pkgs/os-specific/darwin/apple-source-releases/Libc/headers.txt
Normal file
138
pkgs/os-specific/darwin/apple-source-releases/Libc/headers.txt
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
CrashReporterClient.h
|
||||
NSSystemDirectories.h
|
||||
_locale.h
|
||||
_types.h
|
||||
_types/_intmax_t.h
|
||||
_types/_nl_item.h
|
||||
_types/_uint16_t.h
|
||||
_types/_uint32_t.h
|
||||
_types/_uint64_t.h
|
||||
_types/_uint8_t.h
|
||||
_types/_uintmax_t.h
|
||||
_types/_wctrans_t.h
|
||||
_types/_wctype_t.h
|
||||
_wctype.h
|
||||
_xlocale.h
|
||||
aio.h
|
||||
alloca.h
|
||||
ar.h
|
||||
arpa/ftp.h
|
||||
arpa/inet.h
|
||||
arpa/nameser_compat.h
|
||||
arpa/telnet.h
|
||||
arpa/tftp.h
|
||||
asl.h
|
||||
assert.h
|
||||
bitstring.h
|
||||
cpio.h
|
||||
crt_externs.h
|
||||
ctype.h
|
||||
db.h
|
||||
dirent.h
|
||||
disktab.h
|
||||
err.h
|
||||
errno.h
|
||||
execinfo.h
|
||||
fcntl.h
|
||||
fmtmsg.h
|
||||
fnmatch.h
|
||||
fsproperties.h
|
||||
fstab.h
|
||||
fts.h
|
||||
ftw.h
|
||||
get_compat.h
|
||||
getopt.h
|
||||
glob.h
|
||||
inttypes.h
|
||||
iso646.h
|
||||
langinfo.h
|
||||
libc.h
|
||||
libc_private.h
|
||||
libgen.h
|
||||
libkern/OSAtomic.h
|
||||
libkern/OSCacheControl.h
|
||||
libproc.h
|
||||
limits.h
|
||||
locale.h
|
||||
malloc/malloc.h
|
||||
memory.h
|
||||
monetary.h
|
||||
monitor.h
|
||||
mpool.h
|
||||
msgcat.h
|
||||
ndbm.h
|
||||
nl_types.h
|
||||
nlist.h
|
||||
os/assumes.h
|
||||
os/debug_private.h
|
||||
paths.h
|
||||
poll.h
|
||||
printf.h
|
||||
protocols/routed.h
|
||||
protocols/rwhod.h
|
||||
protocols/talkd.h
|
||||
protocols/timed.h
|
||||
pthread.h
|
||||
pthread_impl.h
|
||||
pthread_spis.h
|
||||
pthread_workqueue.h
|
||||
ranlib.h
|
||||
readpassphrase.h
|
||||
regex.h
|
||||
runetype.h
|
||||
sched.h
|
||||
search.h
|
||||
secure/_common.h
|
||||
secure/_stdio.h
|
||||
secure/_string.h
|
||||
semaphore.h
|
||||
setjmp.h
|
||||
sgtty.h
|
||||
signal.h
|
||||
spawn.h
|
||||
stab.h
|
||||
standards.h
|
||||
stddef.h
|
||||
stdint.h
|
||||
stdio.h
|
||||
stdlib.h
|
||||
strhash.h
|
||||
string.h
|
||||
stringlist.h
|
||||
strings.h
|
||||
struct.h
|
||||
sys/acl.h
|
||||
sys/rbtree.h
|
||||
sys/statvfs.h
|
||||
sysexits.h
|
||||
syslog.h
|
||||
tar.h
|
||||
termios.h
|
||||
time.h
|
||||
timeconv.h
|
||||
ttyent.h
|
||||
tzfile.h
|
||||
ucontext.h
|
||||
ulimit.h
|
||||
unistd.h
|
||||
util.h
|
||||
utime.h
|
||||
utmpx.h
|
||||
utmpx_thread.h
|
||||
vis.h
|
||||
wchar.h
|
||||
wctype.h
|
||||
wordexp.h
|
||||
xlocale.h
|
||||
xlocale/__wctype.h
|
||||
xlocale/_ctype.h
|
||||
xlocale/_inttypes.h
|
||||
xlocale/_langinfo.h
|
||||
xlocale/_monetary.h
|
||||
xlocale/_regex.h
|
||||
xlocale/_stdio.h
|
||||
xlocale/_stdlib.h
|
||||
xlocale/_string.h
|
||||
xlocale/_time.h
|
||||
xlocale/_wchar.h
|
||||
xlocale/_wctype.h
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
{ appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
installPhase = ''
|
||||
substituteInPlace xcodescripts/install_files.sh \
|
||||
--replace "/usr/local/" "/" \
|
||||
--replace "/usr/" "/" \
|
||||
--replace '-o "$INSTALL_OWNER" -g "$INSTALL_GROUP"' "" \
|
||||
--replace "ln -h" "ln -n"
|
||||
|
||||
export DSTROOT=$out
|
||||
sh xcodescripts/install_files.sh
|
||||
'';
|
||||
|
||||
appleHeaders = ''
|
||||
aliasdb.h
|
||||
bootparams.h
|
||||
configuration_profile.h
|
||||
grp.h
|
||||
ifaddrs.h
|
||||
ils.h
|
||||
kvbuf.h
|
||||
libinfo.h
|
||||
libinfo_muser.h
|
||||
membership.h
|
||||
membershipPriv.h
|
||||
netdb.h
|
||||
netdb_async.h
|
||||
ntsid.h
|
||||
printerdb.h
|
||||
pwd.h
|
||||
rpc/auth.h
|
||||
rpc/auth_unix.h
|
||||
rpc/clnt.h
|
||||
rpc/pmap_clnt.h
|
||||
rpc/pmap_prot.h
|
||||
rpc/pmap_rmt.h
|
||||
rpc/rpc.h
|
||||
rpc/rpc_msg.h
|
||||
rpc/svc.h
|
||||
rpc/svc_auth.h
|
||||
rpc/types.h
|
||||
rpc/xdr.h
|
||||
rpcsvc/yp_prot.h
|
||||
rpcsvc/ypclnt.h
|
||||
si_data.h
|
||||
si_module.h
|
||||
thread_data.h
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{ appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
|
||||
cp Source/Intel/math.h $out/include
|
||||
cp Source/Intel/fenv.h $out/include
|
||||
cp Source/complex.h $out/include
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{ appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
cp notify.h $out/include
|
||||
cp notify_keys.h $out/include
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
{ lib, appleDerivation, developer_cmds }:
|
||||
|
||||
appleDerivation {
|
||||
buildInputs = [ developer_cmds ];
|
||||
|
||||
installPhase = ''
|
||||
export DSTROOT=$out
|
||||
export SRCROOT=$PWD
|
||||
export OBJROOT=$PWD
|
||||
|
||||
. ./xcodescripts/install_rpcsvc.sh
|
||||
|
||||
mv $out/usr/* $out
|
||||
rmdir $out/usr/
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
maintainers = with maintainers; [ matthewbauer ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
{ lib, stdenv, buildPackages
|
||||
, appleDerivation', xnu, Libc, Libm, libdispatch, Libinfo
|
||||
, dyld, Csu, architecture, libclosure, CarbonHeaders, ncurses, CommonCrypto
|
||||
, copyfile, removefile, libresolvHeaders, libresolv, Libnotify, libplatform, libpthread
|
||||
, mDNSResponder, launchd, libutilHeaders, hfsHeaders, darling, darwin-stubs
|
||||
, headersOnly ? false
|
||||
, withLibresolv ? !headersOnly
|
||||
}:
|
||||
|
||||
appleDerivation' stdenv {
|
||||
dontBuild = true;
|
||||
dontFixup = true;
|
||||
|
||||
installPhase = ''
|
||||
export NIX_ENFORCE_PURITY=
|
||||
|
||||
mkdir -p $out/lib $out/include
|
||||
|
||||
function copyHierarchy () {
|
||||
mkdir -p $1
|
||||
while read f; do
|
||||
mkdir -p $1/$(dirname $f)
|
||||
cp --parents -pn $f $1
|
||||
done
|
||||
}
|
||||
|
||||
# Set up our include directories
|
||||
(cd ${xnu}/include && find . -name '*.h' -or -name '*.defs' | copyHierarchy $out/include)
|
||||
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} ${libresolvHeaders} \
|
||||
${Libnotify} ${libplatform} ${mDNSResponder} ${launchd} \
|
||||
${libutilHeaders} ${libpthread} ${hfsHeaders}; do
|
||||
(cd $dep/include && find . -name '*.h' | copyHierarchy $out/include)
|
||||
done
|
||||
|
||||
(cd ${buildPackages.darwin.cctools.dev}/include/mach-o && find . -name '*.h' | copyHierarchy $out/include/mach-o)
|
||||
|
||||
mkdir -p $out/include/os
|
||||
|
||||
cp ${darling.src}/src/libc/os/activity.h $out/include/os
|
||||
cp ${darling.src}/src/libc/os/log.h $out/include/os
|
||||
cp ${darling.src}/src/duct/include/os/trace.h $out/include/os
|
||||
|
||||
cat <<EOF > $out/include/os/availability.h
|
||||
#ifndef __OS_AVAILABILITY__
|
||||
#define __OS_AVAILABILITY__
|
||||
#include <AvailabilityInternal.h>
|
||||
|
||||
#if defined(__has_feature) && defined(__has_attribute) && __has_attribute(availability)
|
||||
#define API_AVAILABLE(...) __API_AVAILABLE_GET_MACRO(__VA_ARGS__, __API_AVAILABLE4, __API_AVAILABLE3, __API_AVAILABLE2, __API_AVAILABLE1)(__VA_ARGS__)
|
||||
#define API_DEPRECATED(...) __API_DEPRECATED_MSG_GET_MACRO(__VA_ARGS__, __API_DEPRECATED_MSG5, __API_DEPRECATED_MSG4, __API_DEPRECATED_MSG3, __API_DEPRECATED_MSG2, __API_DEPRECATED_MSG1)(__VA_ARGS__)
|
||||
#define API_DEPRECATED_WITH_REPLACEMENT(...) __API_DEPRECATED_REP_GET_MACRO(__VA_ARGS__, __API_DEPRECATED_REP5, __API_DEPRECATED_REP4, __API_DEPRECATED_REP3, __API_DEPRECATED_REP2, __API_DEPRECATED_REP1)(__VA_ARGS__)
|
||||
#define API_UNAVAILABLE(...) __API_UNAVAILABLE_GET_MACRO(__VA_ARGS__, __API_UNAVAILABLE3, __API_UNAVAILABLE2, __API_UNAVAILABLE1)(__VA_ARGS__)
|
||||
#else
|
||||
|
||||
#define API_AVAILABLE(...)
|
||||
#define API_DEPRECATED(...)
|
||||
#define API_DEPRECATED_WITH_REPLACEMENT(...)
|
||||
#define API_UNAVAILABLE(...)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
|
||||
cat <<EOF > $out/include/TargetConditionals.h
|
||||
#ifndef __TARGETCONDITIONALS__
|
||||
#define __TARGETCONDITIONALS__
|
||||
#define TARGET_OS_MAC 1
|
||||
#define TARGET_OS_WIN32 0
|
||||
#define TARGET_OS_UNIX 0
|
||||
#define TARGET_OS_OSX 1
|
||||
#define TARGET_OS_IPHONE 0
|
||||
#define TARGET_OS_IOS 0
|
||||
#define TARGET_OS_WATCH 0
|
||||
#define TARGET_OS_BRIDGE 0
|
||||
#define TARGET_OS_TV 0
|
||||
#define TARGET_OS_SIMULATOR 0
|
||||
#define TARGET_OS_EMBEDDED 0
|
||||
#define TARGET_OS_EMBEDDED_OTHER 0 /* Used in configd */
|
||||
#define TARGET_IPHONE_SIMULATOR TARGET_OS_SIMULATOR /* deprecated */
|
||||
#define TARGET_OS_NANO TARGET_OS_WATCH /* deprecated */
|
||||
#define TARGET_OS_LINUX 0
|
||||
|
||||
#define TARGET_CPU_PPC 0
|
||||
#define TARGET_CPU_PPC64 0
|
||||
#define TARGET_CPU_68K 0
|
||||
#define TARGET_CPU_X86 0
|
||||
#define TARGET_CPU_X86_64 1
|
||||
#define TARGET_CPU_ARM 0
|
||||
#define TARGET_CPU_ARM64 0
|
||||
#define TARGET_CPU_MIPS 0
|
||||
#define TARGET_CPU_SPARC 0
|
||||
#define TARGET_CPU_ALPHA 0
|
||||
#define TARGET_RT_MAC_CFM 0
|
||||
#define TARGET_RT_MAC_MACHO 1
|
||||
#define TARGET_RT_LITTLE_ENDIAN 1
|
||||
#define TARGET_RT_BIG_ENDIAN 0
|
||||
#define TARGET_RT_64_BIT 1
|
||||
#endif /* __TARGETCONDITIONALS__ */
|
||||
EOF
|
||||
'' + lib.optionalString (!headersOnly) ''
|
||||
|
||||
# The startup object files
|
||||
cp ${Csu}/lib/* $out/lib
|
||||
|
||||
cp -vr \
|
||||
${darwin-stubs}/usr/lib/libSystem.B.tbd \
|
||||
${darwin-stubs}/usr/lib/system \
|
||||
$out/lib
|
||||
|
||||
substituteInPlace $out/lib/libSystem.B.tbd \
|
||||
--replace "/usr/lib/system/" "$out/lib/system/"
|
||||
ln -s libSystem.B.tbd $out/lib/libSystem.tbd
|
||||
|
||||
# Set up links to pretend we work like a conventional unix (Apple's design, not mine!)
|
||||
for name in c dbm dl info m mx poll proc pthread rpcsvc util gcc_s.10.4 gcc_s.10.5; do
|
||||
ln -s libSystem.tbd $out/lib/lib$name.tbd
|
||||
done
|
||||
'' + lib.optionalString withLibresolv ''
|
||||
|
||||
# This probably doesn't belong here, but we want to stay similar to glibc, which includes resolv internally...
|
||||
cp ${libresolv}/lib/libresolv.9.dylib $out/lib/libresolv.9.dylib
|
||||
resolv_libSystem=$(${stdenv.cc.bintools.targetPrefix}otool -L "$out/lib/libresolv.9.dylib" | tail -n +3 | grep -o "$NIX_STORE.*-\S*") || true
|
||||
echo $libs
|
||||
|
||||
chmod +w $out/lib/libresolv.9.dylib
|
||||
${stdenv.cc.bintools.targetPrefix}install_name_tool \
|
||||
-id $out/lib/libresolv.9.dylib \
|
||||
-change "$resolv_libSystem" /usr/lib/libSystem.dylib \
|
||||
$out/lib/libresolv.9.dylib
|
||||
ln -s libresolv.9.dylib $out/lib/libresolv.dylib
|
||||
'';
|
||||
|
||||
appleHeaders = builtins.readFile ./headers.txt;
|
||||
|
||||
meta = with lib; {
|
||||
description = "The Mac OS libc/libSystem (tapi library with pure headers)";
|
||||
maintainers = with maintainers; [ copumpkin gridaphobe ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
1729
pkgs/os-specific/darwin/apple-source-releases/Libsystem/headers.txt
Normal file
1729
pkgs/os-specific/darwin/apple-source-releases/Libsystem/headers.txt
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1 @@
|
|||
_mach_init_routine
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{ appleDerivation, xcbuildHook, IOKit }:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook ];
|
||||
buildInputs = [ IOKit ];
|
||||
xcbuildFlags = [ "-target" "caffeinate" ];
|
||||
installPhase = ''
|
||||
install -D Products/Deployment/caffeinate $out/bin/caffeinate
|
||||
'';
|
||||
}
|
||||
117
pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix
Normal file
117
pkgs/os-specific/darwin/apple-source-releases/Security/boot.nix
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
{ appleDerivation', stdenv, darwin-stubs }:
|
||||
|
||||
appleDerivation' stdenv {
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
|
||||
__propagatedImpureHostDeps = [
|
||||
"/System/Library/Frameworks/Security.framework/Security"
|
||||
"/System/Library/Frameworks/Security.framework/Resources"
|
||||
"/System/Library/Frameworks/Security.framework/PlugIns"
|
||||
"/System/Library/Frameworks/Security.framework/XPCServices"
|
||||
"/System/Library/Frameworks/Security.framework/Versions"
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/Library/Frameworks/Security.framework
|
||||
|
||||
###### IMPURITIES
|
||||
ln -s /System/Library/Frameworks/Security.framework/{Resources,Plugins,XPCServices} \
|
||||
$out/Library/Frameworks/Security.framework
|
||||
|
||||
###### STUBS
|
||||
cp ${darwin-stubs}/System/Library/Frameworks/Security.framework/Versions/A/Security.tbd \
|
||||
$out/Library/Frameworks/Security.framework
|
||||
|
||||
###### HEADERS
|
||||
|
||||
export dest=$out/Library/Frameworks/Security.framework/Headers
|
||||
mkdir -p $dest
|
||||
|
||||
cp libsecurity_asn1/lib/SecAsn1Coder.h $dest
|
||||
cp libsecurity_asn1/lib/SecAsn1Templates.h $dest
|
||||
cp libsecurity_asn1/lib/SecAsn1Types.h $dest
|
||||
cp libsecurity_asn1/lib/oidsalg.h $dest
|
||||
cp libsecurity_asn1/lib/oidsattr.h $dest
|
||||
|
||||
cp libsecurity_authorization/lib/AuthSession.h $dest
|
||||
cp libsecurity_authorization/lib/Authorization.h $dest
|
||||
cp libsecurity_authorization/lib/AuthorizationDB.h $dest
|
||||
cp libsecurity_authorization/lib/AuthorizationPlugin.h $dest
|
||||
cp libsecurity_authorization/lib/AuthorizationTags.h $dest
|
||||
|
||||
cp libsecurity_cms/lib/CMSDecoder.h $dest
|
||||
cp libsecurity_cms/lib/CMSEncoder.h $dest
|
||||
|
||||
cp libsecurity_codesigning/lib/CSCommon.h $dest
|
||||
cp libsecurity_codesigning/lib/CodeSigning.h $dest
|
||||
cp libsecurity_codesigning/lib/SecCode.h $dest
|
||||
cp libsecurity_codesigning/lib/SecCodeHost.h $dest
|
||||
cp libsecurity_codesigning/lib/SecRequirement.h $dest
|
||||
cp libsecurity_codesigning/lib/SecStaticCode.h $dest
|
||||
cp libsecurity_codesigning/lib/SecTask.h $dest
|
||||
|
||||
cp libsecurity_cssm/lib/certextensions.h $dest
|
||||
cp libsecurity_cssm/lib/cssm.h $dest
|
||||
cp libsecurity_cssm/lib/cssmaci.h $dest
|
||||
cp libsecurity_cssm/lib/cssmapi.h $dest
|
||||
cp libsecurity_cssm/lib/cssmapple.h $dest
|
||||
cp libsecurity_cssm/lib/cssmcli.h $dest
|
||||
cp libsecurity_cssm/lib/cssmconfig.h $dest
|
||||
cp libsecurity_cssm/lib/cssmcspi.h $dest
|
||||
cp libsecurity_cssm/lib/cssmdli.h $dest
|
||||
cp libsecurity_cssm/lib/cssmerr.h $dest
|
||||
cp libsecurity_cssm/lib/cssmkrapi.h $dest
|
||||
cp libsecurity_cssm/lib/cssmkrspi.h $dest
|
||||
cp libsecurity_cssm/lib/cssmspi.h $dest
|
||||
cp libsecurity_cssm/lib/cssmtpi.h $dest
|
||||
cp libsecurity_cssm/lib/cssmtype.h $dest
|
||||
cp libsecurity_cssm/lib/eisl.h $dest
|
||||
cp libsecurity_cssm/lib/emmspi.h $dest
|
||||
cp libsecurity_cssm/lib/emmtype.h $dest
|
||||
cp libsecurity_cssm/lib/oidsbase.h $dest
|
||||
cp libsecurity_cssm/lib/oidscert.h $dest
|
||||
cp libsecurity_cssm/lib/oidscrl.h $dest
|
||||
cp libsecurity_cssm/lib/x509defs.h $dest
|
||||
|
||||
cp libsecurity_keychain/lib/SecACL.h $dest
|
||||
cp libsecurity_keychain/lib/SecAccess.h $dest
|
||||
cp libsecurity_keychain/lib/SecBase.h $dest
|
||||
cp libsecurity_keychain/lib/SecCertificate.h $dest
|
||||
cp libsecurity_keychain/lib/SecCertificatePriv.h $dest # Private
|
||||
cp libsecurity_keychain/lib/SecCertificateOIDs.h $dest
|
||||
cp libsecurity_keychain/lib/SecIdentity.h $dest
|
||||
cp libsecurity_keychain/lib/SecIdentitySearch.h $dest
|
||||
cp libsecurity_keychain/lib/SecImportExport.h $dest
|
||||
cp libsecurity_keychain/lib/SecItem.h $dest
|
||||
cp libsecurity_keychain/lib/SecKey.h $dest
|
||||
cp libsecurity_keychain/lib/SecKeychain.h $dest
|
||||
cp libsecurity_keychain/lib/SecKeychainItem.h $dest
|
||||
cp libsecurity_keychain/lib/SecKeychainSearch.h $dest
|
||||
cp libsecurity_keychain/lib/SecPolicy.h $dest
|
||||
cp libsecurity_keychain/lib/SecPolicySearch.h $dest
|
||||
cp libsecurity_keychain/lib/SecRandom.h $dest
|
||||
cp libsecurity_keychain/lib/SecTrust.h $dest
|
||||
cp libsecurity_keychain/lib/SecTrustSettings.h $dest
|
||||
cp libsecurity_keychain/lib/SecTrustedApplication.h $dest
|
||||
cp libsecurity_keychain/lib/Security.h $dest
|
||||
|
||||
cp libsecurity_manifest/lib/SecureDownload.h $dest
|
||||
|
||||
cp libsecurity_mds/lib/mds.h $dest
|
||||
cp libsecurity_mds/lib/mds_schema.h $dest
|
||||
|
||||
cp libsecurity_ssl/lib/CipherSuite.h $dest
|
||||
cp libsecurity_ssl/lib/SecureTransport.h $dest
|
||||
|
||||
cp libsecurity_transform/lib/SecCustomTransform.h $dest
|
||||
cp libsecurity_transform/lib/SecDecodeTransform.h $dest
|
||||
cp libsecurity_transform/lib/SecDigestTransform.h $dest
|
||||
cp libsecurity_transform/lib/SecEncodeTransform.h $dest
|
||||
cp libsecurity_transform/lib/SecEncryptTransform.h $dest
|
||||
cp libsecurity_transform/lib/SecReadTransform.h $dest
|
||||
cp libsecurity_transform/lib/SecSignVerifyTransform.h $dest
|
||||
cp libsecurity_transform/lib/SecTransform.h $dest
|
||||
cp libsecurity_transform/lib/SecTransformReadTransform.h $dest
|
||||
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
{ appleDerivation, xcbuildHook, xpc, dtrace, xnu }:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook dtrace ];
|
||||
# buildInputs = [ Foundation xpc darling ];
|
||||
buildInputs = [ xpc xnu ];
|
||||
|
||||
xcbuildFlags = [ "-target" "Security_frameworks_osx" ];
|
||||
|
||||
# NIX_CFLAGS_COMPILE = "-Wno-error -I${xnu}/include/libkern -DPRIVATE -I${xnu}/Library/Frameworks/System.framework/Headers";
|
||||
|
||||
preBuild = ''
|
||||
dtrace -h -C -s OSX/libsecurity_utilities/lib/security_utilities.d -o OSX/libsecurity_utilities/lib/utilities_dtrace.h
|
||||
|
||||
xcodebuild SYMROOT=$PWD/Products OBJROOT=$PWD/Intermediates -target copyHeadersToSystem
|
||||
NIX_CFLAGS_COMPILE+=" -F./Products/Release"
|
||||
ln -s $PWD/Products/Release/Security.bundle/Contents $PWD/Products/Release/Security.framework
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
{ lib, stdenv, buildPackages, appleDerivation, fetchzip, bsdmake, perl, flex, bison
|
||||
}:
|
||||
|
||||
# this derivation sucks
|
||||
# locale data was removed after adv_cmds-118, so our base is that because it's easier than
|
||||
# replicating the bizarre bsdmake file structure
|
||||
#
|
||||
# sadly adv_cmds-118 builds a mklocale and colldef that generate files that our libc can no
|
||||
# longer understand
|
||||
#
|
||||
# the more recent adv_cmds release is used for everything else in this package
|
||||
|
||||
let recentAdvCmds = fetchzip {
|
||||
url = "https://opensource.apple.com/tarballs/adv_cmds/adv_cmds-158.tar.gz";
|
||||
sha256 = "0z081kcprzg5jcvqivfnwvvv6wfxzkjg2jc2lagsf8c7j7vgm8nn";
|
||||
};
|
||||
|
||||
in appleDerivation {
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
nativeBuildInputs = [ bsdmake perl bison flex ];
|
||||
buildInputs = [ flex ];
|
||||
|
||||
patchPhase = ''
|
||||
substituteInPlace BSDmakefile \
|
||||
--replace chgrp true \
|
||||
--replace /Developer/Makefiles/bin/compress-man-pages.pl true \
|
||||
--replace "ps.tproj" "" --replace "gencat.tproj" "" --replace "md.tproj" "" \
|
||||
--replace "tabs.tproj" "" --replace "cap_mkdb.tproj" "" \
|
||||
--replace "!= tconf --test TARGET_OS_EMBEDDED" "= NO"
|
||||
|
||||
substituteInPlace Makefile --replace perl true
|
||||
|
||||
for subproject in colldef mklocale monetdef msgdef numericdef timedef; do
|
||||
substituteInPlace usr-share-locale.tproj/$subproject/BSDmakefile \
|
||||
--replace /usr/share/locale "" \
|
||||
--replace '-o ''${BINOWN} -g ''${BINGRP}' "" \
|
||||
--replace "rsync -a" "cp -r"
|
||||
done
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
cp -r --no-preserve=all ${recentAdvCmds}/colldef .
|
||||
pushd colldef
|
||||
mv locale/collate.h .
|
||||
flex -t -8 -i scan.l > scan.c
|
||||
yacc -d parse.y
|
||||
clang *.c -o colldef -lfl
|
||||
popd
|
||||
mv colldef/colldef colldef.tproj/colldef
|
||||
|
||||
cp -r --no-preserve=all ${recentAdvCmds}/mklocale .
|
||||
pushd mklocale
|
||||
flex -t -8 -i lex.l > lex.c
|
||||
yacc -d yacc.y
|
||||
clang *.c -o mklocale -lfl
|
||||
popd
|
||||
mv mklocale/mklocale mklocale.tproj/mklocale
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
bsdmake -C usr-share-locale.tproj
|
||||
|
||||
${stdenv.cc.targetPrefix}clang ${recentAdvCmds}/ps/*.c -o ps
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
bsdmake -C usr-share-locale.tproj install DESTDIR="$locale/share/locale"
|
||||
|
||||
# need to get rid of runtime dependency on flex
|
||||
# install -d 0755 $locale/bin
|
||||
# install -m 0755 colldef.tproj/colldef $locale/bin
|
||||
# install -m 0755 mklocale.tproj/mklocale $locale/bin
|
||||
|
||||
install -d 0755 $ps/bin
|
||||
install ps $ps/bin/ps
|
||||
touch "$out"
|
||||
'';
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"ps"
|
||||
"locale"
|
||||
];
|
||||
setOutputFlags = false;
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ gridaphobe ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
{ lib, appleDerivation, xcbuild, ncurses, libutil }:
|
||||
|
||||
appleDerivation {
|
||||
# We can't just run the root build, because https://github.com/facebook/xcbuild/issues/264
|
||||
|
||||
patchPhase = ''
|
||||
substituteInPlace adv_cmds.xcodeproj/project.pbxproj \
|
||||
--replace '/usr/lib/libtermcap.dylib' 'libncurses.dylib'
|
||||
'';
|
||||
|
||||
# pkill requires special private headers that are unavailable in
|
||||
# NixPkgs. These ones are needed:
|
||||
# - xpc/xpxc.h
|
||||
# - os/base_private.h
|
||||
# - _simple.h
|
||||
# We disable it here for now. TODO: build pkill inside adv_cmds
|
||||
buildPhase = ''
|
||||
targets=$(xcodebuild -list \
|
||||
| awk '/Targets:/{p=1;print;next} p&&/^\s*$/{p=0};p' \
|
||||
| tail -n +2 | sed 's/^[ \t]*//' \
|
||||
| grep -v -e Desktop -e Embedded -e mklocale -e pkill -e pgrep -e colldef)
|
||||
|
||||
for i in $targets; do
|
||||
xcodebuild SYMROOT=$PWD/Products OBJROOT=$PWD/Intermediates -target $i
|
||||
done
|
||||
'';
|
||||
|
||||
# temporary install phase until xcodebuild has "install" support
|
||||
installPhase = ''
|
||||
for f in Products/Release/*; do
|
||||
if [ -f $f ]; then
|
||||
install -D $f $out/bin/$(basename $f)
|
||||
fi
|
||||
done
|
||||
|
||||
mkdir -p $out/System/Library/LaunchDaemons
|
||||
install fingerd/finger.plist $out/System/Library/LaunchDaemons
|
||||
|
||||
# from variant_links.sh
|
||||
# ln -s $out/bin/pkill $out/bin/pgrep
|
||||
# ln -s $out/share/man/man1/pkill.1 $out/share/man/man1/pgrep.1
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ xcbuild ];
|
||||
buildInputs = [ ncurses libutil ];
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
{ lib, appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
dontBuild = true;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace '/bin/mkdir' 'mkdir' \
|
||||
--replace '/usr/bin/install' 'install'
|
||||
'';
|
||||
|
||||
installFlags = [ "EXPORT_DSTDIR=/include/architecture" ];
|
||||
|
||||
DSTROOT = "$(out)";
|
||||
|
||||
appleHeaders = ''
|
||||
architecture/alignment.h
|
||||
architecture/byte_order.h
|
||||
architecture/i386/alignment.h
|
||||
architecture/i386/asm_help.h
|
||||
architecture/i386/byte_order.h
|
||||
architecture/i386/cpu.h
|
||||
architecture/i386/desc.h
|
||||
architecture/i386/fpu.h
|
||||
architecture/i386/frame.h
|
||||
architecture/i386/io.h
|
||||
architecture/i386/pio.h
|
||||
architecture/i386/reg_help.h
|
||||
architecture/i386/sel.h
|
||||
architecture/i386/table.h
|
||||
architecture/i386/tss.h
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
{ lib, appleDerivation, xcbuildHook }:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook ];
|
||||
|
||||
# These PBXcp calls should be patched in xcbuild to allow them to
|
||||
# automatically be prefixed.
|
||||
patchPhase = ''
|
||||
substituteInPlace basic_cmds.xcodeproj/project.pbxproj \
|
||||
--replace "dstPath = /usr/share/man/man1;" "dstPath = $out/share/man/man1;" \
|
||||
--replace "dstPath = /usr/share/man/man5;" "dstPath = $out/share/man/man5;"
|
||||
'';
|
||||
|
||||
# temporary install phase until xcodebuild has "install" support
|
||||
installPhase = ''
|
||||
for f in Products/Release/*; do
|
||||
if [ -f $f ]; then
|
||||
install -D $f $out/bin/$(basename $f)
|
||||
fi
|
||||
done
|
||||
|
||||
for n in 1; do
|
||||
mkdir -p $out/share/man/man$n
|
||||
install */*.$n $out/share/man/man$n
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
{ lib, appleDerivation, stdenv, bison, flex }:
|
||||
|
||||
let
|
||||
|
||||
# Hard to get CC to pull this off without infinite recursion
|
||||
targetTargetPrefix = lib.optionalString
|
||||
(with stdenv; hostPlatform != targetPlatform)
|
||||
(stdenv.targetPlatform.config + "-");
|
||||
|
||||
in
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ bison flex ];
|
||||
|
||||
buildPhase = ''
|
||||
cd migcom.tproj
|
||||
|
||||
# redundant file, don't know why apple not removing it.
|
||||
rm handler.c
|
||||
|
||||
yacc -d parser.y
|
||||
flex --header-file=lexxer.yy.h -o lexxer.yy.c lexxer.l
|
||||
|
||||
$CC -std=gnu99 -Os -dead_strip -DMIG_VERSION=\"$pname-$version\" -I. -o migcom *.c
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/libexec $out/share/man/man1
|
||||
|
||||
chmod +x mig.sh
|
||||
cp mig.sh $out/bin/mig
|
||||
cp migcom $out/libexec
|
||||
ln -s $out/libexec/migcom $out/bin/migcom
|
||||
cp mig.1 $out/share/man/man1
|
||||
cp migcom.1 $out/share/man/man1
|
||||
|
||||
substituteInPlace $out/bin/mig \
|
||||
--replace 'arch=`/usr/bin/arch`' 'arch=${stdenv.targetPlatform.darwinArch}' \
|
||||
--replace '/usr/bin/' "" \
|
||||
--replace '/bin/rmdir' "rmdir" \
|
||||
--replace 'C=''${MIGCC}' "C=${targetTargetPrefix}cc"
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
{ lib, appleDerivation, makeWrapper }:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
patchPhase = ''
|
||||
substituteInPlace mk/bsd.prog.mk \
|
||||
--replace '-o ''${BINOWN} -g ''${BINGRP}' "" \
|
||||
--replace '-o ''${SCRIPTSOWN_''${.ALLSRC:T}}' "" \
|
||||
--replace '-g ''${SCRIPTSGRP_''${.ALLSRC:T}}' ""
|
||||
substituteInPlace mk/bsd.lib.mk --replace '-o ''${LIBOWN} -g ''${LIBGRP}' ""
|
||||
substituteInPlace mk/bsd.info.mk --replace '-o ''${INFOOWN} -g ''${INFOGRP}' ""
|
||||
substituteInPlace mk/bsd.doc.mk --replace '-o ''${BINOWN} -g ''${BINGRP}' ""
|
||||
substituteInPlace mk/bsd.man.mk --replace '-o ''${MANOWN} -g ''${MANGRP}' ""
|
||||
substituteInPlace mk/bsd.files.mk \
|
||||
--replace '-o ''${''${group}OWN_''${.ALLSRC:T}}' "" \
|
||||
--replace '-g ''${''${group}GRP_''${.ALLSRC:T}}' "" \
|
||||
--replace '-o ''${''${group}OWN} -g ''${''${group}GRP}' ""
|
||||
substituteInPlace mk/bsd.incs.mk \
|
||||
--replace '-o ''${''${group}OWN_''${.ALLSRC:T}}' "" \
|
||||
--replace '-g ''${''${group}GRP_''${.ALLSRC:T}}' "" \
|
||||
--replace '-o ''${''${group}OWN} -g ''${''${group}GRP}' ""
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
objs=()
|
||||
for file in $(find . -name '*.c'); do
|
||||
obj="$(basename "$file" .c).o"
|
||||
objs+=("$obj")
|
||||
$CC -c "$file" -o "$obj" -DDEFSHELLNAME='"sh"' -D__FBSDID=__RCSID -mdynamic-no-pic -g
|
||||
done
|
||||
$CC "''${objs[@]}" -o bsdmake
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -d 0644 $out/bin
|
||||
install -m 0755 bsdmake $out/bin
|
||||
install -d 0644 $out/share/mk
|
||||
install -m 0755 mk/* $out/share/mk
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
wrapProgram "$out/bin/bsdmake" --add-flags "-m $out/share/mk"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
{ lib, stdenv, appleDerivation', launchd, bootstrap_cmds, xnu, ppp, IOKit, eap8021x, Security
|
||||
, headersOnly ? false }:
|
||||
|
||||
appleDerivation' stdenv {
|
||||
meta.broken = stdenv.cc.nativeLibc;
|
||||
|
||||
nativeBuildInputs = lib.optionals (!headersOnly) [ bootstrap_cmds ];
|
||||
buildInputs = lib.optionals (!headersOnly) [ launchd ppp IOKit eap8021x ];
|
||||
|
||||
propagatedBuildInputs = lib.optionals (!headersOnly) [ Security ];
|
||||
|
||||
patchPhase = lib.optionalString (!headersOnly) ''
|
||||
HACK=$PWD/hack
|
||||
mkdir $HACK
|
||||
cp -r ${xnu}/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/net $HACK
|
||||
|
||||
|
||||
substituteInPlace SystemConfiguration.fproj/SCNetworkReachabilityInternal.h \
|
||||
--replace '#include <xpc/xpc.h>' ""
|
||||
|
||||
substituteInPlace SystemConfiguration.fproj/SCNetworkReachability.c \
|
||||
--replace ''$'#define\tHAVE_VPN_STATUS' ""
|
||||
|
||||
substituteInPlace SystemConfiguration.fproj/reachability/SCNetworkReachabilityServer_client.c \
|
||||
--replace '#include <xpc/xpc.h>' '#include "fake_xpc.h"' \
|
||||
--replace '#include <xpc/private.h>' "" \
|
||||
|
||||
# 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'
|
||||
|
||||
cat >SystemConfiguration.fproj/fake_xpc.h <<EOF
|
||||
typedef void *xpc_type_t;
|
||||
typedef void *xpc_object_t;
|
||||
typedef void *xpc_connection_t;
|
||||
|
||||
xpc_type_t xpc_get_type(xpc_object_t object);
|
||||
xpc_object_t xpc_dictionary_create(const char * const *keys, const xpc_object_t *values, size_t count);
|
||||
char *xpc_copy_description(xpc_object_t object);
|
||||
int64_t xpc_dictionary_get_int64(xpc_object_t xdict, const char *key);
|
||||
uint64_t xpc_dictionary_get_uint64(xpc_object_t xdict, const char *key);
|
||||
void xpc_connection_set_event_handler(xpc_connection_t connection, void *handler);
|
||||
|
||||
extern const struct _xpc_type_s _xpc_type_error;
|
||||
#define XPC_TYPE_ERROR (&_xpc_type_error)
|
||||
|
||||
extern const struct _xpc_type_s _xpc_type_dictionary;
|
||||
#define XPC_TYPE_DICTIONARY (&_xpc_type_dictionary)
|
||||
|
||||
extern const struct _xpc_type_s _xpc_type_array;
|
||||
#define XPC_TYPE_ARRAY (&_xpc_type_array)
|
||||
|
||||
extern const struct _xpc_dictionary_s _xpc_error_connection_interrupted;
|
||||
#define XPC_ERROR_CONNECTION_INTERRUPTED (&_xpc_error_connection_interrupted)
|
||||
|
||||
extern const struct _xpc_dictionary_s _xpc_error_connection_invalid;
|
||||
#define XPC_ERROR_CONNECTION_INVALID (&_xpc_error_connection_invalid)
|
||||
|
||||
extern const char *const _xpc_error_key_description;
|
||||
#define XPC_ERROR_KEY_DESCRIPTION _xpc_error_key_description
|
||||
|
||||
#define XPC_CONNECTION_MACH_SERVICE_PRIVILEGED (1 << 1)
|
||||
EOF
|
||||
'';
|
||||
|
||||
dontBuild = headersOnly;
|
||||
|
||||
buildPhase = ''
|
||||
pushd SystemConfiguration.fproj >/dev/null
|
||||
|
||||
mkdir -p SystemConfiguration.framework/Resources
|
||||
cp ../get-mobility-info SystemConfiguration.framework/Resources
|
||||
cp Info.plist SystemConfiguration.framework/Resources
|
||||
cp -r English.lproj SystemConfiguration.framework/Resources
|
||||
cp NetworkConfiguration.plist SystemConfiguration.framework/Resources
|
||||
|
||||
mkdir -p SystemConfiguration.framework/Headers
|
||||
mkdir -p SystemConfiguration.framework/PrivateHeaders
|
||||
|
||||
# The standard public headers
|
||||
cp SCSchemaDefinitions.h SystemConfiguration.framework/Headers
|
||||
cp SystemConfiguration.h SystemConfiguration.framework/Headers
|
||||
cp SCDynamicStore.h SystemConfiguration.framework/Headers
|
||||
cp SCDynamicStoreCopySpecific.h SystemConfiguration.framework/Headers
|
||||
cp SCPreferences.h SystemConfiguration.framework/Headers
|
||||
cp CaptiveNetwork.h SystemConfiguration.framework/Headers
|
||||
cp SCPreferencesPath.h SystemConfiguration.framework/Headers
|
||||
cp SCDynamicStoreKey.h SystemConfiguration.framework/Headers
|
||||
cp SCPreferencesSetSpecific.h SystemConfiguration.framework/Headers
|
||||
cp SCNetworkConfiguration.h SystemConfiguration.framework/Headers
|
||||
cp SCNetworkConnection.h SystemConfiguration.framework/Headers
|
||||
cp SCNetworkReachability.h SystemConfiguration.framework/Headers
|
||||
cp DHCPClientPreferences.h SystemConfiguration.framework/Headers
|
||||
cp SCNetwork.h SystemConfiguration.framework/Headers
|
||||
cp SCDynamicStoreCopyDHCPInfo.h SystemConfiguration.framework/Headers
|
||||
|
||||
# TODO: Do we want to preserve private headers or just make them public?
|
||||
cp SCDPlugin.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCDynamicStorePrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCDynamicStoreCopySpecificPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCDynamicStoreSetSpecificPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCValidation.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCPreferencesPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp DeviceOnHold.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp LinkConfiguration.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCPreferencesPathKey.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCPreferencesSetSpecificPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCNetworkConnectionPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCPreferencesGetSpecificPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCSchemaDefinitionsPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCNetworkConfigurationPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCPreferencesKeychainPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCNetworkSignature.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp SCNetworkSignaturePrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp VPNPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp VPNConfiguration.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp VPNTunnelPrivate.h SystemConfiguration.framework/PrivateHeaders
|
||||
cp VPNTunnel.h SystemConfiguration.framework/PrivateHeaders
|
||||
|
||||
mkdir derived
|
||||
|
||||
cat >derived/SystemConfiguration_vers.c <<EOF
|
||||
const unsigned char SystemConfigurationVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:SystemConfiguration PROJECT:configd-" "\n"; const double SystemConfigurationVersionNumber __attribute__ ((used)) = (double)0.;
|
||||
EOF
|
||||
|
||||
mig -arch x86_64 -header derived/shared_dns_info.h -user derived/shared_dns_infoUser.c -sheader /dev/null -server /dev/null ../dnsinfo/shared_dns_info.defs
|
||||
mig -arch x86_64 -header derived/config.h -user derived/configUser.c -sheader /dev/null -server /dev/null config.defs
|
||||
mig -arch x86_64 -header derived/helper.h -user derived/helperUser.c -sheader /dev/null -server /dev/null helper/helper.defs
|
||||
mig -arch x86_64 -header derived/pppcontroller.h -user derived/pppcontrollerUser.c -sheader /dev/null -server /dev/null pppcontroller.defs
|
||||
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCSchemaDefinitions.c -o SCSchemaDefinitions.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCD.c -o SCD.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDKeys.c -o SCDKeys.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDPrivate.c -o SCDPrivate.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDPlugin.c -o SCDPlugin.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c CaptiveNetwork.c -o CaptiveNetwork.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDOpen.c -o SCDOpen.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDList.c -o SCDList.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDAdd.c -o SCDAdd.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDGet.c -o SCDGet.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDSet.c -o SCDSet.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDRemove.c -o SCDRemove.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDNotify.c -o SCDNotify.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDNotifierSetKeys.c -o SCDNotifierSetKeys.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDNotifierAdd.c -o SCDNotifierAdd.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDNotifierRemove.c -o SCDNotifierRemove.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDNotifierGetChanges.c -o SCDNotifierGetChanges.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDNotifierWait.c -o SCDNotifierWait.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDNotifierInformViaCallback.c -o SCDNotifierInformViaCallback.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDNotifierInformViaFD.c -o SCDNotifierInformViaFD.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDNotifierInformViaSignal.c -o SCDNotifierInformViaSignal.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDNotifierCancel.c -o SCDNotifierCancel.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDSnapshot.c -o SCDSnapshot.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCP.c -o SCP.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPOpen.c -o SCPOpen.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPLock.c -o SCPLock.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPUnlock.c -o SCPUnlock.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPList.c -o SCPList.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPGet.c -o SCPGet.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPAdd.c -o SCPAdd.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPSet.c -o SCPSet.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPRemove.c -o SCPRemove.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPCommit.c -o SCPCommit.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPApply.c -o SCPApply.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPPath.c -o SCPPath.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDConsoleUser.c -o SCDConsoleUser.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCDHostName.c -o SCDHostName.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCLocation.c -o SCLocation.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCNetwork.c -o SCNetwork.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c derived/pppcontrollerUser.c -o pppcontrollerUser.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCNetworkConnection.c -o SCNetworkConnection.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCNetworkConnectionPrivate.c -o SCNetworkConnectionPrivate.o
|
||||
$CC -I. -Ihelper -Iderived -I../dnsinfo -F. -c SCNetworkReachability.c -o SCNetworkReachability.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCProxies.c -o SCProxies.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c DHCP.c -o DHCP.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c moh.c -o moh.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c DeviceOnHold.c -o DeviceOnHold.o
|
||||
$CC -I. -Ihelper -Iderived -I $HACK -F. -c LinkConfiguration.c -o LinkConfiguration.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c dy_framework.c -o dy_framework.o
|
||||
$CC -I. -Ihelper -Iderived -I $HACK -F. -c VLANConfiguration.c -o VLANConfiguration.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c derived/configUser.c -o configUser.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPreferencesPathKey.c -o SCPreferencesPathKey.o
|
||||
$CC -I. -Ihelper -Iderived -I../dnsinfo -F. -c derived/shared_dns_infoUser.c -o shared_dns_infoUser.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCNetworkConfigurationInternal.c -o SCNetworkConfigurationInternal.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCNetworkInterface.c -o SCNetworkInterface.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCNetworkProtocol.c -o SCNetworkProtocol.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCNetworkService.c -o SCNetworkService.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCNetworkSet.c -o SCNetworkSet.o
|
||||
$CC -I. -Ihelper -Iderived -I $HACK -F. -c BondConfiguration.c -o BondConfiguration.o
|
||||
$CC -I. -Ihelper -Iderived -I $HACK -F. -c BridgeConfiguration.c -o BridgeConfiguration.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c helper/SCHelper_client.c -o SCHelper_client.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCPreferencesKeychainPrivate.c -o SCPreferencesKeychainPrivate.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c SCNetworkSignature.c -o SCNetworkSignature.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c VPNPrivate.c -o VPNPrivate.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c VPNConfiguration.c -o VPNConfiguration.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c VPNTunnel.c -o VPNTunnel.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c derived/helperUser.c -o helperUser.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c reachability/SCNetworkReachabilityServer_client.c -o SCNetworkReachabilityServer_client.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c reachability/rb.c -o rb.o
|
||||
$CC -I. -Ihelper -Iderived -F. -c derived/SystemConfiguration_vers.c -o SystemConfiguration_vers.o
|
||||
|
||||
$CC -dynamiclib *.o -install_name $out/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration -dead_strip -framework CoreFoundation -single_module -o SystemConfiguration.framework/SystemConfiguration
|
||||
|
||||
popd >/dev/null
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
cp dnsinfo/*.h $out/include/
|
||||
'' + lib.optionalString (!headersOnly) ''
|
||||
mkdir -p $out/Library/Frameworks/
|
||||
mv SystemConfiguration.fproj/SystemConfiguration.framework $out/Library/Frameworks
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{ appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/include/
|
||||
cp copyfile.h $out/include/
|
||||
'';
|
||||
}
|
||||
315
pkgs/os-specific/darwin/apple-source-releases/default.nix
Normal file
315
pkgs/os-specific/darwin/apple-source-releases/default.nix
Normal file
|
|
@ -0,0 +1,315 @@
|
|||
{ lib, stdenv, fetchurl, fetchzip, pkgs }:
|
||||
|
||||
let
|
||||
# This attrset can in theory be computed automatically, but for that to work nicely we need
|
||||
# import-from-derivation to work properly. Currently it's rather ugly when we try to bootstrap
|
||||
# a stdenv out of something like this. With some care we can probably get rid of this, but for
|
||||
# now it's staying here.
|
||||
versions = {
|
||||
"osx-10.12.6" = {
|
||||
xnu = "3789.70.16";
|
||||
libiconv = "50";
|
||||
Libnotify = "165.20.1";
|
||||
objc4 = "709.1";
|
||||
dyld = "433.5";
|
||||
CommonCrypto = "60092.50.5";
|
||||
copyfile = "138";
|
||||
ppp = "838.50.1";
|
||||
libclosure = "67";
|
||||
Libinfo = "503.50.4";
|
||||
Libsystem = "1238.60.2";
|
||||
removefile = "45";
|
||||
libresolv = "64";
|
||||
libplatform = "126.50.8";
|
||||
mDNSResponder = "765.50.9";
|
||||
libutil = "47.30.1";
|
||||
libunwind = "35.3";
|
||||
Libc = "1158.50.2";
|
||||
dtrace = "209.50.12";
|
||||
libpthread = "218.60.3";
|
||||
hfs = "366.70.1";
|
||||
};
|
||||
"osx-10.11.6" = {
|
||||
PowerManagement = "572.50.1";
|
||||
dtrace = "168";
|
||||
xnu = "3248.60.10";
|
||||
libpthread = "138.10.4";
|
||||
libiconv = "44";
|
||||
Libnotify = "150.40.1";
|
||||
objc4 = "680";
|
||||
eap8021x = "222.40.1";
|
||||
dyld = "360.22";
|
||||
architecture = "268";
|
||||
CommonCrypto = "60075.50.1";
|
||||
copyfile = "127";
|
||||
Csu = "85";
|
||||
ppp = "809.50.2";
|
||||
libclosure = "65";
|
||||
Libinfo = "477.50.4";
|
||||
Libsystem = "1226.10.1";
|
||||
removefile = "41";
|
||||
libresolv = "60";
|
||||
|
||||
# Their release page is a bit of a mess here, so I'm going to lie a bit and say this version
|
||||
# is the right one, even though it isn't. The version I have here doesn't appear to be linked
|
||||
# to any OS releases, but Apple also doesn't mention mDNSResponder from 10.11 to 10.11.6, and
|
||||
# neither of those versions are publicly available.
|
||||
libplatform = "125";
|
||||
mDNSResponder = "625.41.2";
|
||||
|
||||
# IOKit contains a set of packages with different versions, so we don't have a general version
|
||||
IOKit = "";
|
||||
|
||||
libutil = "43";
|
||||
libunwind = "35.3";
|
||||
Librpcsvc = "26";
|
||||
developer_cmds= "62";
|
||||
network_cmds = "481.20.1";
|
||||
basic_cmds = "55";
|
||||
adv_cmds = "163";
|
||||
file_cmds = "264.1.1";
|
||||
shell_cmds = "187";
|
||||
system_cmds = "550.6";
|
||||
diskdev_cmds = "593";
|
||||
top = "108";
|
||||
text_cmds = "99";
|
||||
};
|
||||
"osx-10.11.5" = {
|
||||
Libc = "1082.50.1"; # 10.11.6 still unreleased :/
|
||||
};
|
||||
"osx-10.10.5" = {
|
||||
adv_cmds = "158";
|
||||
CF = "1153.18";
|
||||
ICU = "531.48";
|
||||
libdispatch = "442.1.4";
|
||||
Security = "57031.40.6";
|
||||
|
||||
IOAudioFamily = "203.3";
|
||||
IOFireWireFamily = "458";
|
||||
IOFWDVComponents = "207.4.1";
|
||||
IOFireWireAVC = "423";
|
||||
IOFireWireSBP2 = "427";
|
||||
IOFireWireSerialBusProtocolTransport = "251.0.1";
|
||||
IOGraphics = "485.40.1";
|
||||
IOHIDFamily = "606.40.1";
|
||||
IONetworkingFamily = "101";
|
||||
IOSerialFamily = "74.20.1";
|
||||
IOStorageFamily = "182.1.1";
|
||||
IOBDStorageFamily = "14";
|
||||
IOCDStorageFamily = "51";
|
||||
IODVDStorageFamily = "35";
|
||||
IOKitUser = "1050.20.2";
|
||||
};
|
||||
"osx-10.9.5" = {
|
||||
launchd = "842.92.1";
|
||||
libauto = "185.5";
|
||||
Libc = "997.90.3"; # We use this, but not from here
|
||||
Libsystem = "1197.1.1";
|
||||
Security = "55471.14.18";
|
||||
security_dotmac_tp = "55107.1";
|
||||
|
||||
IOStorageFamily = "172";
|
||||
};
|
||||
"osx-10.8.5" = {
|
||||
configd = "453.19";
|
||||
Libc = "825.40.1";
|
||||
IOUSBFamily = "630.4.5";
|
||||
};
|
||||
"osx-10.8.4" = {
|
||||
IOUSBFamily = "560.4.2";
|
||||
};
|
||||
"osx-10.7.4" = {
|
||||
Libm = "2026";
|
||||
};
|
||||
"osx-10.6.2" = {
|
||||
CarbonHeaders = "18.1";
|
||||
};
|
||||
"osx-10.5.8" = {
|
||||
adv_cmds = "119";
|
||||
};
|
||||
"dev-tools-7.0" = {
|
||||
bootstrap_cmds = "93";
|
||||
};
|
||||
"dev-tools-5.1" = {
|
||||
bootstrap_cmds = "86";
|
||||
};
|
||||
"dev-tools-3.2.6" = {
|
||||
bsdmake = "24";
|
||||
};
|
||||
};
|
||||
|
||||
fetchApple' = pname: version: sha256: let
|
||||
# When cross-compiling, fetchurl depends on libiconv, resulting
|
||||
# in an infinite recursion without this. It's not clear why this
|
||||
# worked fine when not cross-compiling
|
||||
fetch = if pname == "libiconv"
|
||||
then stdenv.fetchurlBoot
|
||||
else fetchurl;
|
||||
in fetch {
|
||||
url = "http://www.opensource.apple.com/tarballs/${pname}/${pname}-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
fetchApple = sdkName: sha256: pname: let
|
||||
version = versions.${sdkName}.${pname};
|
||||
in fetchApple' pname version sha256;
|
||||
|
||||
appleDerivation'' = stdenv: pname: version: sdkName: sha256: attrs: stdenv.mkDerivation ({
|
||||
inherit pname version;
|
||||
|
||||
src = if attrs ? srcs then null else (fetchApple' pname version sha256);
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# In rare cases, APPLE may drop some headers quietly on new release.
|
||||
doInstallCheck = attrs ? appleHeaders;
|
||||
passAsFile = [ "appleHeaders" ];
|
||||
installCheckPhase = ''
|
||||
cd $out/include
|
||||
|
||||
result=$(diff -u "$appleHeadersPath" <(find * -type f | sort) --label "Listed in appleHeaders" --label "Found in \$out/include" || true)
|
||||
|
||||
if [ -z "$result" ]; then
|
||||
echo "Apple header list is matched."
|
||||
else
|
||||
echo >&2 "\
|
||||
Apple header list is inconsistent, please ensure no header file is unexpectedly dropped.
|
||||
$result
|
||||
"
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
|
||||
} // attrs // {
|
||||
meta = (with lib; {
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
}) // (attrs.meta or {});
|
||||
});
|
||||
|
||||
IOKitSpecs = {
|
||||
IOAudioFamily = fetchApple "osx-10.10.5" "0ggq7za3iq8g02j16rj67prqhrw828jsw3ah3bxq8a1cvr55aqnq";
|
||||
IOFireWireFamily = fetchApple "osx-10.10.5" "059qa1m668kwvchl90cqcx35b31zaqdg61zi11y1imn5s389y2g1";
|
||||
IOFWDVComponents = fetchApple "osx-10.10.5" "1brr0yn6mxgapw3bvlhyissfksifzj2mqsvj9vmps6zwcsxjfw7m";
|
||||
IOFireWireAVC = fetchApple "osx-10.10.5" "194an37gbqs9s5s891lmw6prvd1m2362602s8lj5m89fp9h8mbal";
|
||||
IOFireWireSBP2 = fetchApple "osx-10.10.5" "1mym158kp46y1vfiq625b15ihh4jjbpimfm7d56wlw6l2syajqvi";
|
||||
IOFireWireSerialBusProtocolTransport = fetchApple "osx-10.10.5" "09kiq907qpk94zbij1mrcfcnyyc5ncvlxavxjrj4v5braxm78lhi";
|
||||
IOGraphics = fetchApple "osx-10.10.5" "1z0x3yrv0p8pfdqnvwf8rvrf9wip593lhm9q6yzbclz3fn53ad0p";
|
||||
IOHIDFamily = fetchApple "osx-10.10.5" "0yibagwk74imp3j3skjycm703s5ybdqw0qlsmnml6zwjpbrz5894";
|
||||
IONetworkingFamily = fetchApple "osx-10.10.5" "04as1hc8avncijf61mp9dmplz8vb1inhirkd1g74gah08lgrfs9j";
|
||||
IOSerialFamily = fetchApple "osx-10.10.5" "0jh12aanxcigqi9w6wqzbwjdin9m48zwrhdj3n4ki0h41sg89y91";
|
||||
IOStorageFamily = fetchApple "osx-10.9.5" "0w5yr8ppl82anwph2zba0ppjji6ipf5x410zhcm1drzwn4bbkxrj";
|
||||
IOBDStorageFamily = fetchApple "osx-10.10.5" "1rbvmh311n853j5qb6hfda94vym9wkws5w736w2r7dwbrjyppc1q";
|
||||
IOCDStorageFamily = fetchApple "osx-10.10.5" "1905sxwmpxdcnm6yggklc5zimx1558ygm3ycj6b34f9h48xfxzgy";
|
||||
IODVDStorageFamily = fetchApple "osx-10.10.5" "1fv82rn199mi998l41c0qpnlp3irhqp2rb7v53pxbx7cra4zx3i6";
|
||||
# There should be an IOStreamFamily project here, but they haven't released it :(
|
||||
IOUSBFamily = fetchApple "osx-10.8.5" "1znqb6frxgab9mkyv7csa08c26p9p0ip6hqb4wm9c7j85kf71f4j"; # This is from 10.8 :(
|
||||
IOUSBFamily_older = fetchApple "osx-10.8.4" "113lmpz8n6sibd27p42h8bl7a6c3myc6zngwri7gnvf8qlajzyml" "IOUSBFamily"; # This is even older :(
|
||||
IOKitUser = fetchApple "osx-10.10.5" "1jzndziv97bhjxmla8nib5fpcswbvsxr04447g251ls81rw313lb";
|
||||
# There should be an IOVideo here, but they haven't released it :(
|
||||
};
|
||||
|
||||
IOKitSrcs = lib.mapAttrs (name: value: if lib.isFunction value then value name else value) IOKitSpecs;
|
||||
|
||||
in
|
||||
|
||||
# darwin package set
|
||||
self:
|
||||
|
||||
let
|
||||
macosPackages_11_0_1 = import ./macos-11.0.1.nix { inherit applePackage'; };
|
||||
developerToolsPackages_11_3_1 = import ./developer-tools-11.3.1.nix { inherit applePackage'; };
|
||||
|
||||
applePackage' = namePath: version: sdkName: sha256:
|
||||
let
|
||||
pname = builtins.head (lib.splitString "/" namePath);
|
||||
appleDerivation' = stdenv: appleDerivation'' stdenv pname version sdkName sha256;
|
||||
appleDerivation = appleDerivation' stdenv;
|
||||
callPackage = self.newScope { inherit appleDerivation' appleDerivation; };
|
||||
in callPackage (./. + "/${namePath}");
|
||||
|
||||
applePackage = namePath: sdkName: sha256: let
|
||||
pname = builtins.head (lib.splitString "/" namePath);
|
||||
version = versions.${sdkName}.${pname};
|
||||
in applePackage' namePath version sdkName sha256;
|
||||
|
||||
# Only used for bootstrapping. It’s convenient because it was the last version to come with a real makefile.
|
||||
adv_cmds-boot = applePackage "adv_cmds/boot.nix" "osx-10.5.8" "102ssayxbg9wb35mdmhswbnw0bg7js3pfd8fcbic83c5q3bqa6c6" {};
|
||||
|
||||
in
|
||||
|
||||
developerToolsPackages_11_3_1 // macosPackages_11_0_1 // {
|
||||
# TODO: shorten this list, we should cut down to a minimum set of bootstrap or necessary packages here.
|
||||
|
||||
inherit (adv_cmds-boot) ps locale;
|
||||
architecture = applePackage "architecture" "osx-10.11.6" "1pbpjcd7is69hn8y29i98ci0byik826if8gnp824ha92h90w0fq3" {};
|
||||
bsdmake = applePackage "bsdmake" "dev-tools-3.2.6" "11a9kkhz5bfgi1i8kpdkis78lhc6b5vxmhd598fcdgra1jw4iac2" {};
|
||||
CarbonHeaders = applePackage "CarbonHeaders" "osx-10.6.2" "1zam29847cxr6y9rnl76zqmkbac53nx0szmqm9w5p469a6wzjqar" {};
|
||||
CommonCrypto = applePackage "CommonCrypto" "osx-10.12.6" "0sgsqjcxbdm2g2zfpc50mzmk4b4ldyw7xvvkwiayhpczg1fga4ff" {};
|
||||
configd = applePackage "configd" "osx-10.8.5" "1gxakahk8gallf16xmhxhprdxkh3prrmzxnmxfvj0slr0939mmr2" {
|
||||
Security = applePackage "Security/boot.nix" "osx-10.9.5" "1nv0dczf67dhk17hscx52izgdcyacgyy12ag0jh6nl5hmfzsn8yy" {};
|
||||
};
|
||||
copyfile = applePackage "copyfile" "osx-10.12.6" "0a70bvzndkava1a946cdq42lnjhg7i7b5alpii3lap6r5fkvas0n" {};
|
||||
Csu = applePackage "Csu" "osx-10.11.6" "0yh5mslyx28xzpv8qww14infkylvc1ssi57imhi471fs91sisagj" {};
|
||||
dtrace = applePackage "dtrace" "osx-10.12.6" "0hpd6348av463yqf70n3xkygwmf1i5zza8kps4zys52sviqz3a0l" {};
|
||||
dyld = applePackage "dyld" "osx-10.12.6" "0q4jmk78b5ajn33blh4agyq6v2a63lpb3fln78az0dy12bnp1qqk" {};
|
||||
eap8021x = applePackage "eap8021x" "osx-10.11.6" "0iw0qdib59hihyx2275rwq507bq2a06gaj8db4a8z1rkaj1frskh" {};
|
||||
IOKit = applePackage "IOKit" "osx-10.11.6" "0kcbrlyxcyirvg5p95hjd9k8a01k161zg0bsfgfhkb90kh2s8x00" { inherit IOKitSrcs; };
|
||||
launchd = applePackage "launchd" "osx-10.9.5" "0w30hvwqq8j5n90s3qyp0fccxflvrmmjnicjri4i1vd2g196jdgj" {};
|
||||
libauto = applePackage "libauto" "osx-10.9.5" "17z27yq5d7zfkwr49r7f0vn9pxvj95884sd2k6lq6rfaz9gxqhy3" {};
|
||||
Libc = applePackage "Libc" "osx-10.12.6" "183wcy1nlj2wkpfsx3k3lyv917mk8r2p72qw8lb89mbjsw3yw0xx" {
|
||||
Libc_10-9 = fetchzip {
|
||||
url = "http://www.opensource.apple.com/tarballs/Libc/Libc-997.90.3.tar.gz";
|
||||
sha256 = "1xchgxkxg5288r2b9yfrqji2gsgdap92k4wx2dbjwslixws12pq7";
|
||||
};
|
||||
Libc_old = applePackage "Libc/825_40_1.nix" "osx-10.8.5" "0xsx1im52gwlmcrv4lnhhhn9dyk5ci6g27k6yvibn9vj8fzjxwcf" {};
|
||||
};
|
||||
libclosure = applePackage "libclosure" "osx-10.11.6" "1zqy1zvra46cmqv6vsf1mcsz3a76r9bky145phfwh4ab6y15vjpq" {};
|
||||
libdispatch = applePackage "libdispatch" "osx-10.10.5" "0jsfbzp87lwk9snlby0hd4zvj7j894p5q3cw0wdx9ny1mcp3kdcj" {};
|
||||
libiconv = applePackage "libiconv" "osx-10.12.6" "1gg5h6z8sk851bhv87vyxzs54jmqz6lh57ny8j4s51j7srja0nly" {};
|
||||
Libinfo = applePackage "Libinfo" "osx-10.11.6" "0qjgkd4y8sjvwjzv5wwyzkb61pg8wwg95bkp721dgzv119dqhr8x" {};
|
||||
Libm = applePackage "Libm" "osx-10.7.4" "02sd82ig2jvvyyfschmb4gpz6psnizri8sh6i982v341x6y4ysl7" {};
|
||||
Libnotify = applePackage "Libnotify" "osx-10.12.6" "0p5qhvalf6j1w6n8xwywhn6dvbpzv74q5wqrgs8rwfpf74wg6s9z" {};
|
||||
libplatform = applePackage "libplatform" "osx-10.12.6" "0rh1f5ybvwz8s0nwfar8s0fh7jbgwqcy903cv2x8m15iq1x599yn" {};
|
||||
libpthread = applePackage "libpthread" "osx-10.12.6" "1j6541rcgjpas1fc77ip5krjgw4bvz6jq7bq7h9q7axb0jv2ns6c" {};
|
||||
libresolv = applePackage "libresolv" "osx-10.12.6" "077j6ljfh7amqpk2146rr7dsz5vasvr3als830mgv5jzl7l6vz88" {};
|
||||
Libsystem = applePackage "Libsystem" "osx-10.12.6" "1082ircc1ggaq3wha218vmfa75jqdaqidsy1bmrc4ckfkbr3bwx2" {};
|
||||
libutil = applePackage "libutil" "osx-10.12.6" "0lqdxaj82h8yjbjm856jjz9k2d96k0viimi881akfng08xk1246y" {};
|
||||
libunwind = applePackage "libunwind" "osx-10.12.6" "0miffaa41cv0lzf8az5k1j1ng8jvqvxcr4qrlkf3xyj479arbk1b" {};
|
||||
mDNSResponder = applePackage "mDNSResponder" "osx-10.12.6" "02ms1p8zlgmprzn65jzr7yaqxykh3zxjcrw0c06aayim6h0dsqfy" {};
|
||||
objc4 = applePackage "objc4" "osx-10.12.6" "1cj1vhbcs9pkmag2ms8wslagicnq9bxi2qjkszmp3ys7z7ccrbwz" {};
|
||||
ppp = applePackage "ppp" "osx-10.12.6" "1kcc2nc4x1kf8sz0a23i6nfpvxg381kipi0qdisrp8x9z2gbkxb8" {};
|
||||
removefile = applePackage "removefile" "osx-10.12.6" "0jzjxbmxgjzhssqd50z7kq9dlwrv5fsdshh57c0f8mdwcs19bsyx" {};
|
||||
xnu = applePackage "xnu" "osx-10.12.6" "1sjb0i7qzz840v2h4z3s4jyjisad4r5yyi6sg8pakv3wd81i5fg5" {
|
||||
python3 = pkgs.buildPackages.buildPackages.python3; # TODO(@Ericson2314) this shouldn't be needed.
|
||||
};
|
||||
hfs = applePackage "hfs" "osx-10.12.6" "1mj3xvqpq1mgd80b6kl1s04knqnap7hccr0gz8rjphalq14rbl5g" {};
|
||||
Librpcsvc = applePackage "Librpcsvc" "osx-10.11.6" "1zwfwcl9irxl1dlnf2b4v30vdybp0p0r6n6g1pd14zbdci1jcg2k" {};
|
||||
adv_cmds = applePackage "adv_cmds" "osx-10.11.6" "12gbv35i09aij9g90p6b3x2f3ramw43qcb2gjrg8lzkzmwvcyw9q" {};
|
||||
basic_cmds = applePackage "basic_cmds" "osx-10.11.6" "0hvab4b1v5q2x134hdkal0rmz5gsdqyki1vb0dbw4py1bqf0yaw9" {};
|
||||
developer_cmds = applePackage "developer_cmds" "osx-10.11.6" "1r9c2b6dcl22diqf90x58psvz797d3lxh4r2wppr7lldgbgn24di" {};
|
||||
diskdev_cmds = applePackage "diskdev_cmds" "osx-10.11.6" "1ssdyiaq5m1zfy96yy38yyknp682ki6bvabdqd5z18fa0rv3m2ar" {
|
||||
macosPackages_11_0_1 = macosPackages_11_0_1;
|
||||
};
|
||||
network_cmds = applePackage "network_cmds" "osx-10.11.6" "0lhi9wz84qr1r2ab3fb4nvmdg9gxn817n5ldg7zw9gnf3wwn42kw" {};
|
||||
file_cmds = applePackage "file_cmds" "osx-10.11.6" "1zfxbmasps529pnfdjvc13p7ws2cfx8pidkplypkswyff0nff4wp" {};
|
||||
shell_cmds = applePackage "shell_cmds" "osx-10.11.6" "0084k271v66h4jqp7q7rmjvv7w4mvhx3aq860qs8jbd30canm86n" {};
|
||||
system_cmds = applePackage "system_cmds" "osx-10.11.6" "1h46j2c5v02pkv5d9fyv6cpgyg0lczvwicrx6r9s210cl03l77jl" {};
|
||||
text_cmds = applePackage "text_cmds" "osx-10.11.6" "1f93m7dd0ghqb2hwh905mjhzblyfr7dwffw98xhgmv1mfdnigxg0" {};
|
||||
top = applePackage "top" "osx-10.11.6" "0i9120rfwapgwdvjbfg0ya143i29s1m8zbddsxh39pdc59xnsg5l" {};
|
||||
PowerManagement = applePackage "PowerManagement" "osx-10.11.6" "1llimhvp0gjffd47322lnjq7cqwinx0c5z7ikli04ad5srpa68mh" {};
|
||||
|
||||
# `configdHeaders` can’t use an override because `pkgs.darwin.configd` on aarch64-darwin will
|
||||
# be replaced by SystemConfiguration.framework from the macOS SDK.
|
||||
configdHeaders = applePackage "configd" "osx-10.8.5" "1gxakahk8gallf16xmhxhprdxkh3prrmzxnmxfvj0slr0939mmr2" {
|
||||
headersOnly = true;
|
||||
Security = null;
|
||||
};
|
||||
libutilHeaders = pkgs.darwin.libutil.override { headersOnly = true; };
|
||||
hfsHeaders = pkgs.darwin.hfs.override { headersOnly = true; };
|
||||
libresolvHeaders= pkgs.darwin.libresolv.override { headersOnly = true; };
|
||||
|
||||
# TODO(matthewbauer):
|
||||
# To be removed, once I figure out how to build a newer Security version.
|
||||
Security = applePackage "Security/boot.nix" "osx-10.9.5" "1nv0dczf67dhk17hscx52izgdcyacgyy12ag0jh6nl5hmfzsn8yy" {};
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
# Generated using: ./generate-sdk-packages.sh developer-tools 11.3.1
|
||||
|
||||
{ applePackage' }:
|
||||
|
||||
{
|
||||
bootstrap_cmds = applePackage' "bootstrap_cmds" "116" "developer-tools-11.3.1" "148xpqkf5xzpslqxch5l8h6vsz7sys8sdzk4ghbg9mkcivp8qa03" {};
|
||||
developer_cmds = applePackage' "developer_cmds" "66" "developer-tools-11.3.1" "0q08m4cxxwph7gxqravmx13l418p1i050bd46zwksn9j9zpw9mlr" {};
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
{ lib, appleDerivation, xcbuildHook, llvmPackages, makeWrapper }:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook makeWrapper ];
|
||||
|
||||
patches = [
|
||||
# The following copied from
|
||||
# https://github.com/Homebrew/homebrew-core/commit/712ed3e948868e17f96b7e59972b5f45d4faf688
|
||||
# is needed to build libvirt.
|
||||
./rpcgen-support-hyper-and-quad-types.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
makeWrapper ${llvmPackages.clang}/bin/clang $out/bin/clang-cpp --add-flags "--driver-mode=cpp"
|
||||
substituteInPlace rpcgen/rpc_main.c \
|
||||
--replace "/usr/bin/cpp" "$out/bin/clang-cpp"
|
||||
'';
|
||||
|
||||
# temporary install phase until xcodebuild has "install" support
|
||||
installPhase = ''
|
||||
for f in Products/Release/*; do
|
||||
if [ -f $f ]; then
|
||||
install -D $f $out/bin/$(basename $f)
|
||||
fi
|
||||
done
|
||||
|
||||
for n in 1; do
|
||||
mkdir -p $out/share/man/man$n
|
||||
install */*.$n $out/share/man/man$n
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
diff --git a/rpcgen/rpc_parse.c b/rpcgen/rpc_parse.c
|
||||
index 52edc9f..db0c1f1 100644
|
||||
--- a/rpcgen/rpc_parse.c
|
||||
+++ b/rpcgen/rpc_parse.c
|
||||
@@ -580,6 +580,10 @@ get_type(prefixp, typep, dkind)
|
||||
*typep = "long";
|
||||
(void) peekscan(TOK_INT, &tok);
|
||||
break;
|
||||
+ case TOK_HYPER:
|
||||
+ *typep = "int64_t";
|
||||
+ (void) peekscan(TOK_INT, &tok);
|
||||
+ break;
|
||||
case TOK_VOID:
|
||||
if (dkind != DEF_UNION && dkind != DEF_PROGRAM) {
|
||||
error("voids allowed only inside union and program definitions with one argument");
|
||||
@@ -592,6 +596,7 @@ get_type(prefixp, typep, dkind)
|
||||
case TOK_INT:
|
||||
case TOK_FLOAT:
|
||||
case TOK_DOUBLE:
|
||||
+ case TOK_QUAD:
|
||||
case TOK_BOOL:
|
||||
*typep = tok.str;
|
||||
break;
|
||||
@@ -622,6 +627,11 @@ unsigned_dec(typep)
|
||||
*typep = "u_long";
|
||||
(void) peekscan(TOK_INT, &tok);
|
||||
break;
|
||||
+ case TOK_HYPER:
|
||||
+ get_token(&tok);
|
||||
+ *typep = "u_int64_t";
|
||||
+ (void) peekscan(TOK_INT, &tok);
|
||||
+ break;
|
||||
case TOK_INT:
|
||||
get_token(&tok);
|
||||
*typep = "u_int";
|
||||
diff --git a/rpcgen/rpc_scan.c b/rpcgen/rpc_scan.c
|
||||
index a8df441..4130107 100644
|
||||
--- a/rpcgen/rpc_scan.c
|
||||
+++ b/rpcgen/rpc_scan.c
|
||||
@@ -419,8 +419,10 @@ static token symbols[] = {
|
||||
{TOK_UNSIGNED, "unsigned"},
|
||||
{TOK_SHORT, "short"},
|
||||
{TOK_LONG, "long"},
|
||||
+ {TOK_HYPER, "hyper"},
|
||||
{TOK_FLOAT, "float"},
|
||||
{TOK_DOUBLE, "double"},
|
||||
+ {TOK_QUAD, "quadruple"},
|
||||
{TOK_STRING, "string"},
|
||||
{TOK_PROGRAM, "program"},
|
||||
{TOK_VERSION, "version"},
|
||||
diff --git a/rpcgen/rpc_scan.h b/rpcgen/rpc_scan.h
|
||||
index bac2be4..e4c57c8 100644
|
||||
--- a/rpcgen/rpc_scan.h
|
||||
+++ b/rpcgen/rpc_scan.h
|
||||
@@ -66,9 +66,11 @@ enum tok_kind {
|
||||
TOK_INT,
|
||||
TOK_SHORT,
|
||||
TOK_LONG,
|
||||
+ TOK_HYPER,
|
||||
TOK_UNSIGNED,
|
||||
TOK_FLOAT,
|
||||
TOK_DOUBLE,
|
||||
+ TOK_QUAD,
|
||||
TOK_OPAQUE,
|
||||
TOK_CHAR,
|
||||
TOK_STRING,
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
{ lib, appleDerivation, xcbuildHook, Libc, stdenv, macosPackages_11_0_1, xnu
|
||||
, fetchurl, libutil }:
|
||||
|
||||
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 {
|
||||
nativeBuildInputs = [ xcbuildHook ];
|
||||
buildInputs = [ libutil ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-I.";
|
||||
NIX_LDFLAGS = "-lutil";
|
||||
patchPhase = ''
|
||||
# ugly hacks for missing headers
|
||||
# most are bsd related - probably should make this a drv
|
||||
unpackFile ${Libc.src}
|
||||
unpackFile ${xnu-src}
|
||||
mkdir System sys machine ${arch}
|
||||
cp xnu-*/bsd/sys/disklabel.h sys
|
||||
cp xnu-*/bsd/machine/disklabel.h machine
|
||||
cp xnu-*/bsd/${arch}/disklabel.h ${arch}
|
||||
cp -r xnu-*/bsd/sys System
|
||||
cp -r Libc-*/uuid System
|
||||
substituteInPlace diskdev_cmds.xcodeproj/project.pbxproj \
|
||||
--replace 'DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";' ""
|
||||
'';
|
||||
installPhase = ''
|
||||
install -D Products/Release/libdisk.a $out/lib/libdisk.a
|
||||
rm Products/Release/libdisk.a
|
||||
for f in Products/Release/*; do
|
||||
if [ -f $f ]; then
|
||||
install -D $f $out/bin/$(basename $f)
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
{ appleDerivation, xcbuildHook, CoreSymbolication
|
||||
, xnu, bison, flex, darling, stdenv, fixDarwinDylibNames }:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook flex bison fixDarwinDylibNames ];
|
||||
buildInputs = [ CoreSymbolication darling xnu ];
|
||||
# -fcommon: workaround build failure on -fno-common toolchains:
|
||||
# duplicate symbol '_kCSRegionMachHeaderName' in: libproc.o dt_module_apple.o
|
||||
NIX_CFLAGS_COMPILE = "-DCTF_OLD_VERSIONS -DPRIVATE -DYYDEBUG=1 -I${xnu}/Library/Frameworks/System.framework/Headers -Wno-error=implicit-function-declaration -fcommon";
|
||||
NIX_LDFLAGS = "-L./Products/Release";
|
||||
xcbuildFlags = [ "-target" "dtrace_frameworks" "-target" "dtrace" ];
|
||||
|
||||
doCheck = false;
|
||||
checkPhase = "xcodebuild -target dtrace_tests";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace dtrace.xcodeproj/project.pbxproj \
|
||||
--replace "/usr/sbin" ""
|
||||
substituteInPlace libdtrace/dt_open.c \
|
||||
--replace /usr/bin/clang ${stdenv.cc.cc}/bin/clang \
|
||||
--replace /usr/bin/ld ${stdenv.cc.bintools.bintools}/bin/ld \
|
||||
--replace /usr/lib/dtrace/dt_cpp.h $out/include/dt_cpp.h \
|
||||
--replace /usr/lib/dtrace $out/lib/dtrace
|
||||
'';
|
||||
|
||||
# hack to handle xcbuild's broken lex handling
|
||||
preBuild = ''
|
||||
pushd libdtrace
|
||||
yacc -d dt_grammar.y
|
||||
flex -l -d dt_lex.l
|
||||
popd
|
||||
|
||||
substituteInPlace dtrace.xcodeproj/project.pbxproj \
|
||||
--replace '6EBC9800099BFBBF0001019C /* dt_grammar.y */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.yacc; name = dt_grammar.y; path = libdtrace/dt_grammar.y; sourceTree = "<group>"; };' '6EBC9800099BFBBF0001019C /* y.tab.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = y.tab.c; path = libdtrace/y.tab.c; sourceTree = "<group>"; };' \
|
||||
--replace '6EBC9808099BFBBF0001019C /* dt_lex.l */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.lex; name = dt_lex.l; path = libdtrace/dt_lex.l; sourceTree = "<group>"; };' '6EBC9808099BFBBF0001019C /* lex.yy.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = lex.yy.c; path = libdtrace/lex.yy.c; sourceTree = "<group>"; };'
|
||||
'';
|
||||
|
||||
# xcbuild doesn't support install
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
|
||||
cp -r Products/Release/usr/include $out/include
|
||||
cp scripts/dt_cpp.h $out/include/dt_cpp.h
|
||||
|
||||
mkdir $out/lib
|
||||
cp Products/Release/*.dylib $out/lib
|
||||
|
||||
mkdir $out/bin
|
||||
cp Products/Release/dtrace $out/bin
|
||||
|
||||
mkdir -p $out/lib/dtrace
|
||||
|
||||
install_name_tool -change $PWD/Products/Release/libdtrace.dylib $out/lib/libdtrace.dylib $out/bin/dtrace
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{ lib, appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib $out/include
|
||||
ln -s /usr/lib/dyld $out/lib/dyld
|
||||
cp -r include $out/
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Impure primitive symlinks to the Mac OS native dyld, along with headers";
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{ appleDerivation', stdenv }:
|
||||
|
||||
appleDerivation' stdenv {
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/Library/Frameworks/EAP8021X.framework/Headers
|
||||
|
||||
cp EAP8021X.fproj/EAPClientProperties.h $out/Library/Frameworks/EAP8021X.framework/Headers
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
{ lib, appleDerivation, xcbuildHook, zlib, bzip2, xz, ncurses, libutil, Libinfo }:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook ];
|
||||
buildInputs = [ zlib bzip2 xz ncurses libutil Libinfo ];
|
||||
|
||||
# some commands not working:
|
||||
# mtree: _simple.h not found
|
||||
# ipcs: sys/ipcs.h not found
|
||||
# so remove their targets from the project
|
||||
patchPhase = ''
|
||||
substituteInPlace file_cmds.xcodeproj/project.pbxproj \
|
||||
--replace "FC8A8CAA14B655FD001B97AD /* PBXTargetDependency */," "" \
|
||||
--replace "FC8A8C9C14B655FD001B97AD /* PBXTargetDependency */," "" \
|
||||
--replace "productName = file_cmds;" "" \
|
||||
--replace '/usr/lib/libcurses.dylib' 'libncurses.dylib'
|
||||
sed -i -re "s/name = ([a-zA-Z]+);/name = \1; productName = \1;/" file_cmds.xcodeproj/project.pbxproj
|
||||
'';
|
||||
|
||||
# temporary install phase until xcodebuild has "install" support
|
||||
installPhase = ''
|
||||
for f in Products/Release/*; do
|
||||
if [ -f $f ]; then
|
||||
install -D $f $out/bin/$(basename $f)
|
||||
fi
|
||||
done
|
||||
|
||||
for n in 1; do
|
||||
mkdir -p $out/share/man/man$n
|
||||
install */*.$n $out/share/man/man$n
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
29
pkgs/os-specific/darwin/apple-source-releases/generate-sdk-packages.sh
Executable file
29
pkgs/os-specific/darwin/apple-source-releases/generate-sdk-packages.sh
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl
|
||||
|
||||
# usage:
|
||||
# generate-sdk-packages.sh macos 11.0.1
|
||||
|
||||
cd $(dirname "$0")
|
||||
|
||||
sdkName="$1-$2"
|
||||
outfile="$sdkName.nix"
|
||||
|
||||
>$outfile echo "# Generated using: ./$(basename "$0") $1 $2
|
||||
|
||||
{ applePackage' }:
|
||||
|
||||
{"
|
||||
|
||||
parse_line() {
|
||||
readarray -t -d$'\t' package <<<$2
|
||||
local pname=${package[0]} version=${package[1]}
|
||||
|
||||
if [ -d $pname ]; then
|
||||
sha256=$(nix-prefetch-url "https://opensource.apple.com/tarballs/$pname/$pname-$version.tar.gz")
|
||||
>>$outfile echo "$pname = applePackage' \"$pname\" \"$version\" \"$sdkName\" \"$sha256\" {};"
|
||||
fi
|
||||
}
|
||||
readarray -s1 -c1 -C parse_line < <(curl -sS "https://opensource.apple.com/text/${sdkName//./}.txt")
|
||||
|
||||
>>$outfile echo '}'
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
{ appleDerivation', stdenv, stdenvNoCC, lib, headersOnly ? true }:
|
||||
|
||||
appleDerivation' (if headersOnly then stdenvNoCC else stdenv) {
|
||||
installPhase = lib.optionalString headersOnly ''
|
||||
mkdir -p $out/include/hfs
|
||||
cp core/*.h $out/include/hfs
|
||||
'';
|
||||
|
||||
appleHeaders = ''
|
||||
hfs/BTreeScanner.h
|
||||
hfs/BTreesInternal.h
|
||||
hfs/BTreesPrivate.h
|
||||
hfs/CatalogPrivate.h
|
||||
hfs/FileMgrInternal.h
|
||||
hfs/HFSUnicodeWrappers.h
|
||||
hfs/UCStringCompareData.h
|
||||
hfs/hfs.h
|
||||
hfs/hfs_alloc_trace.h
|
||||
hfs/hfs_attrlist.h
|
||||
hfs/hfs_btreeio.h
|
||||
hfs/hfs_catalog.h
|
||||
hfs/hfs_cnode.h
|
||||
hfs/hfs_cprotect.h
|
||||
hfs/hfs_dbg.h
|
||||
hfs/hfs_endian.h
|
||||
hfs/hfs_extents.h
|
||||
hfs/hfs_format.h
|
||||
hfs/hfs_fsctl.h
|
||||
hfs/hfs_hotfiles.h
|
||||
hfs/hfs_iokit.h
|
||||
hfs/hfs_journal.h
|
||||
hfs/hfs_kdebug.h
|
||||
hfs/hfs_key_roll.h
|
||||
hfs/hfs_macos_defs.h
|
||||
hfs/hfs_mount.h
|
||||
hfs/hfs_quota.h
|
||||
hfs/hfs_unistr.h
|
||||
hfs/kext-config.h
|
||||
hfs/rangelist.h
|
||||
'';
|
||||
|
||||
meta = {
|
||||
# Seems nobody wants its binary, so we didn't implement building.
|
||||
broken = !headersOnly;
|
||||
platforms = lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{ appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
# No clue why the same file has two different names. Ask Apple!
|
||||
installPhase = ''
|
||||
mkdir -p $out/include/ $out/include/servers
|
||||
cp liblaunch/*.h $out/include
|
||||
|
||||
cp liblaunch/bootstrap.h $out/include/servers
|
||||
cp liblaunch/bootstrap.h $out/include/servers/bootstrap_defs.h
|
||||
'';
|
||||
|
||||
appleHeaders = ''
|
||||
bootstrap.h
|
||||
bootstrap_priv.h
|
||||
launch.h
|
||||
launch_internal.h
|
||||
launch_priv.h
|
||||
reboot2.h
|
||||
servers/bootstrap.h
|
||||
servers/bootstrap_defs.h
|
||||
vproc.h
|
||||
vproc_internal.h
|
||||
vproc_priv.h
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
/*
|
||||
* Generated by dtrace(1M).
|
||||
*/
|
||||
|
||||
#ifndef _AUTO_DTRACE_H
|
||||
#define _AUTO_DTRACE_H
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GARBAGE_COLLECTION_STABILITY "___dtrace_stability$garbage_collection$v1$1_1_0_1_1_0_1_1_0_1_1_0_1_1_0"
|
||||
|
||||
#define GARBAGE_COLLECTION_TYPEDEFS "___dtrace_typedefs$garbage_collection$v2$6175746f5f636f6c6c656374696f6e5f70686173655f74$6175746f5f636f6c6c656374696f6e5f747970655f74$6d616c6c6f635f7a6f6e655f74"
|
||||
|
||||
#if !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED
|
||||
|
||||
#define GARBAGE_COLLECTION_AUTO_BLOCK_LOST_THREAD_LOCALITY(arg0, arg1) \
|
||||
do { \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
|
||||
__dtrace_probe$garbage_collection$auto_block_lost_thread_locality$v1$766f6964202a$75696e7436345f74(arg0, arg1); \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_AUTO_BLOCK_LOST_THREAD_LOCALITY_ENABLED() \
|
||||
({ int _r = __dtrace_isenabled$garbage_collection$auto_block_lost_thread_locality$v1(); \
|
||||
__asm__ volatile(""); \
|
||||
_r; })
|
||||
#define GARBAGE_COLLECTION_AUTO_REFCOUNT_ONE_ALLOCATION(arg0) \
|
||||
do { \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
|
||||
__dtrace_probe$garbage_collection$auto_refcount_one_allocation$v1$75696e7436345f74(arg0); \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_AUTO_REFCOUNT_ONE_ALLOCATION_ENABLED() \
|
||||
({ int _r = __dtrace_isenabled$garbage_collection$auto_refcount_one_allocation$v1(); \
|
||||
__asm__ volatile(""); \
|
||||
_r; })
|
||||
#define GARBAGE_COLLECTION_COLLECTION_BEGIN(arg0, arg1) \
|
||||
do { \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
|
||||
__dtrace_probe$garbage_collection$collection_begin$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f747970655f74(arg0, arg1); \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_BEGIN_ENABLED() \
|
||||
({ int _r = __dtrace_isenabled$garbage_collection$collection_begin$v1(); \
|
||||
__asm__ volatile(""); \
|
||||
_r; })
|
||||
#define GARBAGE_COLLECTION_COLLECTION_END(arg0, arg1, arg2, arg3, arg4) \
|
||||
do { \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
|
||||
__dtrace_probe$garbage_collection$collection_end$v1$6d616c6c6f635f7a6f6e655f74202a$75696e7436345f74$75696e7436345f74$75696e7436345f74$75696e7436345f74(arg0, arg1, arg2, arg3, arg4); \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_END_ENABLED() \
|
||||
({ int _r = __dtrace_isenabled$garbage_collection$collection_end$v1(); \
|
||||
__asm__ volatile(""); \
|
||||
_r; })
|
||||
#define GARBAGE_COLLECTION_COLLECTION_PHASE_BEGIN(arg0, arg1) \
|
||||
do { \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
|
||||
__dtrace_probe$garbage_collection$collection_phase_begin$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f70686173655f74(arg0, arg1); \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_PHASE_BEGIN_ENABLED() \
|
||||
({ int _r = __dtrace_isenabled$garbage_collection$collection_phase_begin$v1(); \
|
||||
__asm__ volatile(""); \
|
||||
_r; })
|
||||
#define GARBAGE_COLLECTION_COLLECTION_PHASE_END(arg0, arg1, arg2, arg3) \
|
||||
do { \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_TYPEDEFS); \
|
||||
__dtrace_probe$garbage_collection$collection_phase_end$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f70686173655f74$75696e7436345f74$75696e7436345f74(arg0, arg1, arg2, arg3); \
|
||||
__asm__ volatile(".reference " GARBAGE_COLLECTION_STABILITY); \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_PHASE_END_ENABLED() \
|
||||
({ int _r = __dtrace_isenabled$garbage_collection$collection_phase_end$v1(); \
|
||||
__asm__ volatile(""); \
|
||||
_r; })
|
||||
|
||||
|
||||
extern void __dtrace_probe$garbage_collection$auto_block_lost_thread_locality$v1$766f6964202a$75696e7436345f74(const void *, uint64_t);
|
||||
extern int __dtrace_isenabled$garbage_collection$auto_block_lost_thread_locality$v1(void);
|
||||
extern void __dtrace_probe$garbage_collection$auto_refcount_one_allocation$v1$75696e7436345f74(uint64_t);
|
||||
extern int __dtrace_isenabled$garbage_collection$auto_refcount_one_allocation$v1(void);
|
||||
extern void __dtrace_probe$garbage_collection$collection_begin$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f747970655f74(const malloc_zone_t *, auto_collection_type_t);
|
||||
extern int __dtrace_isenabled$garbage_collection$collection_begin$v1(void);
|
||||
extern void __dtrace_probe$garbage_collection$collection_end$v1$6d616c6c6f635f7a6f6e655f74202a$75696e7436345f74$75696e7436345f74$75696e7436345f74$75696e7436345f74(const malloc_zone_t *, uint64_t, uint64_t, uint64_t, uint64_t);
|
||||
extern int __dtrace_isenabled$garbage_collection$collection_end$v1(void);
|
||||
extern void __dtrace_probe$garbage_collection$collection_phase_begin$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f70686173655f74(const malloc_zone_t *, auto_collection_phase_t);
|
||||
extern int __dtrace_isenabled$garbage_collection$collection_phase_begin$v1(void);
|
||||
extern void __dtrace_probe$garbage_collection$collection_phase_end$v1$6d616c6c6f635f7a6f6e655f74202a$6175746f5f636f6c6c656374696f6e5f70686173655f74$75696e7436345f74$75696e7436345f74(const malloc_zone_t *, auto_collection_phase_t, uint64_t, uint64_t);
|
||||
extern int __dtrace_isenabled$garbage_collection$collection_phase_end$v1(void);
|
||||
|
||||
#else
|
||||
|
||||
#define GARBAGE_COLLECTION_AUTO_BLOCK_LOST_THREAD_LOCALITY(arg0, arg1) \
|
||||
do { \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_AUTO_BLOCK_LOST_THREAD_LOCALITY_ENABLED() (0)
|
||||
#define GARBAGE_COLLECTION_AUTO_REFCOUNT_ONE_ALLOCATION(arg0) \
|
||||
do { \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_AUTO_REFCOUNT_ONE_ALLOCATION_ENABLED() (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_BEGIN(arg0, arg1) \
|
||||
do { \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_BEGIN_ENABLED() (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_END(arg0, arg1, arg2, arg3, arg4) \
|
||||
do { \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_END_ENABLED() (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_PHASE_BEGIN(arg0, arg1) \
|
||||
do { \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_PHASE_BEGIN_ENABLED() (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_PHASE_END(arg0, arg1, arg2, arg3) \
|
||||
do { \
|
||||
} while (0)
|
||||
#define GARBAGE_COLLECTION_COLLECTION_PHASE_END_ENABLED() (0)
|
||||
|
||||
#endif /* !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _AUTO_DTRACE_H */
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
{ lib, stdenv, appleDerivation, libdispatch, Libsystem }:
|
||||
|
||||
appleDerivation {
|
||||
# these are included in the pure libc
|
||||
buildInputs = lib.optionals stdenv.cc.nativeLibc [ libdispatch Libsystem ];
|
||||
|
||||
buildPhase = ''
|
||||
cp ${./auto_dtrace.h} ./auto_dtrace.h
|
||||
|
||||
substituteInPlace ThreadLocalCollector.h --replace SubZone.h Subzone.h
|
||||
|
||||
substituteInPlace auto_zone.cpp \
|
||||
--replace "#include <msgtracer_client.h>" ''$'#include <asl.h>\nstatic void msgtracer_log_with_keys(...) { };'
|
||||
|
||||
substituteInPlace Definitions.h \
|
||||
--replace "#include <System/pthread_machdep.h>" "" \
|
||||
--replace 'void * const, void * const' 'void * const, void *'
|
||||
|
||||
# getspecific_direct is more efficient, but this should be equivalent...
|
||||
substituteInPlace Zone.h \
|
||||
--replace "_pthread_getspecific_direct" "pthread_getspecific" \
|
||||
--replace "_pthread_has_direct_tsd()" "0" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY0" "110" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY1" "111" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY2" "112" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY3" "113" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY4" "114" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY5" "115" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY6" "116" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY7" "117" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY8" "118" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY9" "119"
|
||||
|
||||
substituteInPlace auto_zone.cpp \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY9" "119" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY0" "110" \
|
||||
|
||||
substituteInPlace Zone.cpp \
|
||||
--replace "_pthread_getspecific_direct" "pthread_getspecific" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY9" "119" \
|
||||
--replace "__PTK_FRAMEWORK_GC_KEY0" "110" \
|
||||
--replace "__PTK_LIBDISPATCH_KEY0" "20" \
|
||||
--replace "struct auto_zone_cursor {" ''$'extern "C" int pthread_key_init_np(int, void (*)(void *));\nstruct auto_zone_cursor {'
|
||||
|
||||
substituteInPlace auto_impl_utilities.c \
|
||||
--replace "# include <CrashReporterClient.h>" "void CRSetCrashLogMessage(void *msg) { };"
|
||||
|
||||
c++ -I. -O3 -c -Wno-c++11-extensions auto_zone.cpp
|
||||
cc -I. -O3 -Iauto_tester -c auto_impl_utilities.c
|
||||
c++ -I. -O3 -c auto_weak.cpp
|
||||
c++ -I. -O3 -c Admin.cpp
|
||||
c++ -I. -O3 -c Bitmap.cpp
|
||||
c++ -I. -O3 -c Definitions.cpp
|
||||
c++ -I. -O3 -c Environment.cpp
|
||||
c++ -I. -O3 -c Large.cpp
|
||||
c++ -I. -O3 -c Region.cpp
|
||||
c++ -I. -O3 -c Subzone.cpp
|
||||
c++ -I. -O3 -c WriteBarrier.cpp
|
||||
c++ -I. -O3 -c Zone.cpp
|
||||
c++ -I. -O3 -c Thread.cpp
|
||||
c++ -I. -O3 -c InUseEnumerator.cpp
|
||||
c++ -I. -O3 -c auto_gdb_interface.cpp
|
||||
c++ -I. -O3 -c PointerHash.cpp
|
||||
c++ -I. -O3 -c ThreadLocalCollector.cpp
|
||||
c++ -I. -O3 -c ZoneDump.cpp
|
||||
c++ -I. -O3 -c ZoneCollectors.cpp
|
||||
c++ -I. -O3 -c SubzonePartition.cpp
|
||||
c++ -I. -O3 -c ZoneCollectionChecking.cpp
|
||||
c++ -I. -O3 -c ZoneCompaction.cpp
|
||||
c++ -I. -O3 -c BlockRef.cpp
|
||||
|
||||
c++ -Wl,-no_dtrace_dof --stdlib=libc++ -dynamiclib -install_name $out/lib/libauto.dylib -o libauto.dylib *.o
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib $out/include
|
||||
cp auto_zone.h auto_weak.h auto_tester/auto_tester.h auto_gdb_interface.h $out/include
|
||||
cp libauto.dylib $out/lib
|
||||
'';
|
||||
|
||||
meta = {
|
||||
# libauto is only used by objc4/pure.nix , but objc4 is now using the impure approach, so we don't bother to fix this.
|
||||
broken = true;
|
||||
platforms = lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
cp *.h $out/include/
|
||||
'';
|
||||
|
||||
appleHeaders = ''
|
||||
Block.h
|
||||
Block_private.h
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
{ appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/include/dispatch $out/include/os
|
||||
|
||||
# Move these headers so CF can find <os/voucher_private.h>
|
||||
mv private/voucher*.h $out/include/os
|
||||
cp -r private/*.h $out/include/dispatch
|
||||
|
||||
cp -r dispatch/*.h $out/include/dispatch
|
||||
cp -r os/object*.h $out/include/os
|
||||
|
||||
# gcc compatability. Source: https://stackoverflow.com/a/28014302/3714556
|
||||
substituteInPlace $out/include/dispatch/object.h \
|
||||
--replace 'typedef void (^dispatch_block_t)(void);' \
|
||||
'#ifdef __clang__
|
||||
typedef void (^dispatch_block_t)(void);
|
||||
#else
|
||||
typedef void* dispatch_block_t;
|
||||
#endif'
|
||||
'';
|
||||
|
||||
appleHeaders = ''
|
||||
dispatch/base.h
|
||||
dispatch/benchmark.h
|
||||
dispatch/block.h
|
||||
dispatch/data.h
|
||||
dispatch/data_private.h
|
||||
dispatch/dispatch.h
|
||||
dispatch/group.h
|
||||
dispatch/introspection.h
|
||||
dispatch/introspection_private.h
|
||||
dispatch/io.h
|
||||
dispatch/io_private.h
|
||||
dispatch/layout_private.h
|
||||
dispatch/mach_private.h
|
||||
dispatch/object.h
|
||||
dispatch/once.h
|
||||
dispatch/private.h
|
||||
dispatch/queue.h
|
||||
dispatch/queue_private.h
|
||||
dispatch/semaphore.h
|
||||
dispatch/source.h
|
||||
dispatch/source_private.h
|
||||
dispatch/time.h
|
||||
os/object.h
|
||||
os/object_private.h
|
||||
os/voucher_activity_private.h
|
||||
os/voucher_private.h
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
{ stdenv, appleDerivation, lib
|
||||
, enableStatic ? stdenv.hostPlatform.isStatic
|
||||
, enableShared ? !stdenv.hostPlatform.isStatic
|
||||
}:
|
||||
|
||||
appleDerivation {
|
||||
postUnpack = "sourceRoot=$sourceRoot/libiconv";
|
||||
|
||||
preConfigure = lib.optionalString stdenv.hostPlatform.isiOS ''
|
||||
sed -i 's/darwin\*/ios\*/g' configure libcharset/configure
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
(lib.enableFeature enableStatic "static")
|
||||
(lib.enableFeature enableShared "shared")
|
||||
];
|
||||
|
||||
postInstall = lib.optionalString enableShared ''
|
||||
mv $out/lib/libiconv.dylib $out/lib/libiconv-nocharset.dylib
|
||||
${stdenv.cc.bintools.targetPrefix}install_name_tool -id $out/lib/libiconv-nocharset.dylib $out/lib/libiconv-nocharset.dylib
|
||||
|
||||
# re-export one useless symbol; ld will reject a dylib that only reexports other dylibs
|
||||
echo 'void dont_use_this(){}' | ${stdenv.cc.bintools.targetPrefix}clang -dynamiclib -x c - -current_version 2.4.0 \
|
||||
-compatibility_version 7.0.0 -current_version 7.0.0 -o $out/lib/libiconv.dylib \
|
||||
-Wl,-reexport_library -Wl,$out/lib/libiconv-nocharset.dylib \
|
||||
-Wl,-reexport_library -Wl,$out/lib/libcharset.dylib
|
||||
'';
|
||||
|
||||
setupHooks = [
|
||||
../../../../build-support/setup-hooks/role.bash
|
||||
../../../../development/libraries/libiconv/setup-hook.sh
|
||||
];
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
{ appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp -r include $out/include
|
||||
'';
|
||||
|
||||
appleHeaders = ''
|
||||
_simple.h
|
||||
libkern/OSAtomic.h
|
||||
libkern/OSAtomicDeprecated.h
|
||||
libkern/OSAtomicQueue.h
|
||||
libkern/OSCacheControl.h
|
||||
libkern/OSSpinLockDeprecated.h
|
||||
os/alloc_once_impl.h
|
||||
os/base.h
|
||||
os/base_private.h
|
||||
os/internal/atomic.h
|
||||
os/internal/crashlog.h
|
||||
os/internal/internal_shared.h
|
||||
os/lock.h
|
||||
os/lock_private.h
|
||||
os/once_private.h
|
||||
os/semaphore_private.h
|
||||
platform/compat.h
|
||||
platform/introspection_private.h
|
||||
platform/string.h
|
||||
setjmp.h
|
||||
ucontext.h
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
{ lib, appleDerivation', stdenvNoCC, libdispatch, xnu }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
propagatedBuildInputs = [ libdispatch xnu ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include/pthread/
|
||||
mkdir -p $out/include/sys/_types
|
||||
cp pthread/*.h $out/include/pthread/
|
||||
|
||||
# This overwrites qos.h, and is probably not necessary, but I'll leave it here for now
|
||||
# cp private/*.h $out/include/pthread/
|
||||
|
||||
cp -r sys $out/include
|
||||
cp -r sys/_pthread/*.h $out/include/sys/_types/
|
||||
'';
|
||||
|
||||
appleHeaders = ''
|
||||
pthread/introspection.h
|
||||
pthread/pthread.h
|
||||
pthread/pthread_impl.h
|
||||
pthread/pthread_spis.h
|
||||
pthread/qos.h
|
||||
pthread/sched.h
|
||||
pthread/spawn.h
|
||||
sys/_pthread/_pthread_attr_t.h
|
||||
sys/_pthread/_pthread_cond_t.h
|
||||
sys/_pthread/_pthread_condattr_t.h
|
||||
sys/_pthread/_pthread_key_t.h
|
||||
sys/_pthread/_pthread_mutex_t.h
|
||||
sys/_pthread/_pthread_mutexattr_t.h
|
||||
sys/_pthread/_pthread_once_t.h
|
||||
sys/_pthread/_pthread_rwlock_t.h
|
||||
sys/_pthread/_pthread_rwlockattr_t.h
|
||||
sys/_pthread/_pthread_t.h
|
||||
sys/_pthread/_pthread_types.h
|
||||
sys/_types/_pthread_attr_t.h
|
||||
sys/_types/_pthread_cond_t.h
|
||||
sys/_types/_pthread_condattr_t.h
|
||||
sys/_types/_pthread_key_t.h
|
||||
sys/_types/_pthread_mutex_t.h
|
||||
sys/_types/_pthread_mutexattr_t.h
|
||||
sys/_types/_pthread_once_t.h
|
||||
sys/_types/_pthread_rwlock_t.h
|
||||
sys/_types/_pthread_rwlockattr_t.h
|
||||
sys/_types/_pthread_t.h
|
||||
sys/_types/_pthread_types.h
|
||||
sys/qos.h
|
||||
sys/qos_private.h
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
{ lib, appleDerivation', stdenv, stdenvNoCC, Libinfo, configdHeaders, mDNSResponder
|
||||
, headersOnly ? false
|
||||
}:
|
||||
|
||||
appleDerivation' (if headersOnly then stdenvNoCC else stdenv) {
|
||||
buildInputs = lib.optionals (!headersOnly) [ Libinfo configdHeaders mDNSResponder ];
|
||||
|
||||
buildPhase = lib.optionalString (!headersOnly) ''
|
||||
$CC -I. -c dns_util.c
|
||||
$CC -I. -c dns.c
|
||||
$CC -I. -c dns_async.c
|
||||
$CC -I. -c base64.c
|
||||
$CC -I. -c dst_api.c
|
||||
$CC -I. -c dst_hmac_link.c
|
||||
$CC -I. -c dst_support.c
|
||||
$CC -I. -c ns_date.c
|
||||
$CC -I. -c ns_name.c
|
||||
$CC -I. -c ns_netint.c
|
||||
$CC -I. -c ns_parse.c
|
||||
$CC -I. -c ns_print.c
|
||||
$CC -I. -c ns_samedomain.c
|
||||
$CC -I. -c ns_sign.c
|
||||
$CC -I. -c ns_ttl.c
|
||||
$CC -I. -c ns_verify.c
|
||||
$CC -I. -c res_comp.c
|
||||
$CC -I. -c res_data.c
|
||||
$CC -I. -c res_debug.c
|
||||
$CC -I. -c res_findzonecut.c
|
||||
$CC -I. -c res_init.c
|
||||
$CC -I. -c res_mkquery.c
|
||||
$CC -I. -c res_mkupdate.c
|
||||
$CC -I. -c res_query.c
|
||||
$CC -I. -c res_send.c
|
||||
$CC -I. -c res_sendsigned.c
|
||||
$CC -I. -c res_update.c
|
||||
$CC -dynamiclib -install_name $out/lib/libresolv.9.dylib -current_version 1.0.0 -compatibility_version 1.0.0 -o libresolv.9.dylib *.o
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include $out/include/arpa $out/lib
|
||||
|
||||
cp dns.h $out/include/
|
||||
cp dns_util.h $out/include
|
||||
cp nameser.h $out/include
|
||||
ln -s ../nameser.h $out/include/arpa
|
||||
cp resolv.h $out/include
|
||||
'' + lib.optionalString (!headersOnly) ''
|
||||
|
||||
cp libresolv.9.dylib $out/lib
|
||||
ln -s libresolv.9.dylib $out/lib/libresolv.dylib
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{ lib, appleDerivation }:
|
||||
|
||||
appleDerivation {
|
||||
dontBuild = true;
|
||||
|
||||
# install headers only
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib
|
||||
cp -R include $out/include
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
maintainers = with maintainers; [ copumpkin lnl7 ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
{ lib, stdenv, stdenvNoCC, appleDerivation', xcbuildHook
|
||||
|
||||
# headersOnly is true when building for libSystem
|
||||
, headersOnly ? false }:
|
||||
|
||||
appleDerivation' (if headersOnly then stdenvNoCC else stdenv) {
|
||||
nativeBuildInputs = lib.optional (!headersOnly) xcbuildHook;
|
||||
|
||||
prePatch = ''
|
||||
substituteInPlace tzlink.c \
|
||||
--replace '#include <xpc/xpc.h>' ""
|
||||
'';
|
||||
|
||||
xcbuildFlags = [ "-target" "util" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
'' + lib.optionalString headersOnly ''
|
||||
cp *.h $out/include
|
||||
'' + lib.optionalString (!headersOnly)''
|
||||
mkdir -p $out/lib $out/include
|
||||
|
||||
cp Products/Release/*.dylib $out/lib
|
||||
cp Products/Release/*.h $out/include
|
||||
|
||||
# TODO: figure out how to get this to be right the first time around
|
||||
install_name_tool -id $out/lib/libutil.dylib $out/lib/libutil.dylib
|
||||
'';
|
||||
|
||||
# FIXME: headers are different against headersOnly. And all the headers are NOT in macos, do we really want them?
|
||||
# appleHeaders = ''
|
||||
# libutil.h
|
||||
# mntopts.h
|
||||
# tzlink.h
|
||||
# wipefs.h
|
||||
# '';
|
||||
|
||||
meta = with lib; {
|
||||
maintainers = with maintainers; [ copumpkin ];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.apsl20;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{ appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include
|
||||
cp mDNSShared/dns_sd.h $out/include
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
# Generated using: ./generate-sdk-packages.sh macos 11.0.1
|
||||
|
||||
{ applePackage' }:
|
||||
|
||||
{
|
||||
adv_cmds = applePackage' "adv_cmds" "176" "macos-11.0.1" "0x8c25rh6fnzndbc26vcb65vcxilvqyfvm2klfyci1wr4bh3ixgk" {};
|
||||
architecture = applePackage' "architecture" "279" "macos-11.0.1" "1cgp33ywa30max6cyp69kvii299hx2vgwvmy3ms8n4gaq2mkpaky" {};
|
||||
basic_cmds = applePackage' "basic_cmds" "55" "macos-11.0.1" "0hvab4b1v5q2x134hdkal0rmz5gsdqyki1vb0dbw4py1bqf0yaw9" {};
|
||||
bootstrap_cmds = applePackage' "bootstrap_cmds" "121" "macos-11.0.1" "09bwclws6adxb1ky9q35f4ikddk4mbalmgds0cmqaf7j23qxl3fv" {};
|
||||
CommonCrypto = applePackage' "CommonCrypto" "60178.40.2" "macos-11.0.1" "0r3b1mlfmbdzpwn6pbsbfaga3k63gpwcwbhkbi4r09aq82skl02v" {};
|
||||
configd = applePackage' "configd" "1109.40.9" "macos-11.0.1" "173i55wfzli9pg2x2rw437hs68h6l4ngss5jfgf18g26zjkjzv5v" {};
|
||||
copyfile = applePackage' "copyfile" "173.40.2" "macos-11.0.1" "0qyp15qj3fdb7yx033n57l7s61d70mv17f43yiwcbhx09mmlrp07" {};
|
||||
Csu = applePackage' "Csu" "88" "macos-11.0.1" "029lgcyj0i16036h2lcx6fd6r1yf1bkj5dnvz905rh6ncl8skgdr" {};
|
||||
diskdev_cmds = applePackage' "diskdev_cmds" "667.40.1" "macos-11.0.1" "1bqwkwkwd556rba5000ap77xrhaf4xnmy83mszd7a0yvl2xlma7j" {};
|
||||
dtrace = applePackage' "dtrace" "370.40.1" "macos-11.0.1" "1941yczmn94ng5zlnhf0i5mjw2f4g7znisgvhkhn5f86gxmd98wl" {};
|
||||
dyld = applePackage' "dyld" "832.7.1" "macos-11.0.1" "1s77ca6jg20z91qlph59da8j61m97y23vrw48xs4rywdzh4915n0" {};
|
||||
eap8021x = applePackage' "eap8021x" "304.40.1" "macos-11.0.1" "1ph3kcpf527s0jqsi60j2sgg3m8h128spf292d8kyc08siz9mf9c" {};
|
||||
file_cmds = applePackage' "file_cmds" "321.40.3" "macos-11.0.1" "04789vn1wghclfr3ma3ncg716xdsxfj66hrcxi5h3h1ryag2ycfz" {};
|
||||
hfs = applePackage' "hfs" "556.41.1" "macos-11.0.1" "1rhkmn2yj5p4wmi4aajy5hj2h0gxk63s8j4qz4ziy4g4bjpdgwmy" {};
|
||||
ICU = applePackage' "ICU" "66108" "macos-11.0.1" "1d76cyyqpwkzjlxfajm4nsglxmfrcafbnjwnjxc3j5w3nw67pqhx" {};
|
||||
Libc = applePackage' "Libc" "1439.40.11" "macos-11.0.1" "0d5xlnks4lc9391wg31c9126vflb40lc5ffkgxmf2kpyglac1280" {};
|
||||
libclosure = applePackage' "libclosure" "78" "macos-11.0.1" "089i2bl4agpnfplrg23xbzma1674g0w05988nxdps6ghxl4kz66f" {};
|
||||
libdispatch = applePackage' "libdispatch" "1271.40.12" "macos-11.0.1" "0z7r42zfb8y48f0nrw0qw7fanfvimycimgnrg3jig101kjvjar98" {};
|
||||
libiconv = applePackage' "libiconv" "59" "macos-11.0.1" "0hqbsqggjrr0sv6h70lcr3gabgk9inyc8aq1b30wibgjm6crjwpp" {};
|
||||
Libinfo = applePackage' "Libinfo" "542.40.3" "macos-11.0.1" "0y5x6wxd3mwn6my1jdp8qrak3y7x7sgjdmwyw9cvvbn3kg9v6z1p" {};
|
||||
Libnotify = applePackage' "Libnotify" "279.40.4" "macos-11.0.1" "0aswflxki877izp6sacv35sydn6a3639cflv3zhs3i7vkfbsvbf5" {};
|
||||
libplatform = applePackage' "libplatform" "254.40.4" "macos-11.0.1" "1mhi8n66864y98dr3n0pkqad3aqim800kn9bxzp6h5jf2jni3aql" {};
|
||||
libpthread = applePackage' "libpthread" "454.40.3" "macos-11.0.1" "18rb4dqjdf3krzi4hdj5i310gy49ipf01klbkp9g51i02a55gphq" {};
|
||||
libresolv = applePackage' "libresolv" "68" "macos-11.0.1" "1ysvg6d28xyaky9sn7giglnsflhjsbj17h3h3i6knlzxnzznpkql" {};
|
||||
Librpcsvc = applePackage' "Librpcsvc" "26" "macos-11.0.1" "1zwfwcl9irxl1dlnf2b4v30vdybp0p0r6n6g1pd14zbdci1jcg2k" {};
|
||||
Libsystem = applePackage' "Libsystem" "1292.50.1" "macos-11.0.1" "0w16zaigq18jfsnw15pfyz2mkfqdkn0cc16q617kmgw2khld8j7j" {};
|
||||
libunwind = applePackage' "libunwind" "200.10" "macos-11.0.1" "1pmymcqpfk7lfxh6zqch429vfpvmd2m1dlg898170pkx5zhxisl2" {};
|
||||
libutil = applePackage' "libutil" "58.40.2" "macos-11.0.1" "1hhgashfj9g4vjv02070c5pn818a5n0bh5l81l2pflmvb2rrqs3f" {};
|
||||
mDNSResponder = applePackage' "mDNSResponder" "1310.40.42" "macos-11.0.1" "0d0b9wwah9rg7rwrr29dxd6iy0y4rlmss3wcz2wcqmnd2qb9x8my" {};
|
||||
network_cmds = applePackage' "network_cmds" "606.40.2" "macos-11.0.1" "1dlslk67npvmxx5m50385kmn3ysxih2iv220hhzkin11f8abdjv7" {};
|
||||
objc4 = applePackage' "objc4" "818.2" "macos-11.0.1" "177gmh9m9ajy6mvcd2sf7gqydgljy44n3iih0yqsn1b13j784azx" {};
|
||||
PowerManagement = applePackage' "PowerManagement" "1132.50.3" "macos-11.0.1" "1n5yn6sc8w67g8iism6ilkyl33j46gcnlqcaq6k16zkngx6lprba" {};
|
||||
ppp = applePackage' "ppp" "877.40.2" "macos-11.0.1" "1z506z8ndvb1lfr4pypfy2bnig6qimhmq3yhjvqwfnliv91965iq" {};
|
||||
removefile = applePackage' "removefile" "49.40.3" "macos-11.0.1" "1fhp47awi15f02385r25qgw1ag5z0kr1v3kvgqm3r8i8yysfqvwp" {};
|
||||
Security = applePackage' "Security" "59754.41.1" "macos-11.0.1" "00kqgg7k80ba70ar2c02f0q9yrdgqcb56nb9z5g0bxwkvi40ryph" {};
|
||||
shell_cmds = applePackage' "shell_cmds" "216.40.4" "macos-11.0.1" "1mvp1fp34kkm4mi85fdn3i0l0gig4c0w09zg2mvkpxcf68cq2f69" {};
|
||||
system_cmds = applePackage' "system_cmds" "880.40.5" "macos-11.0.1" "1kys4vwfz4559sspdsfhmxc238nd8qgylqypza3zdzaqhfh7lx2x" {};
|
||||
text_cmds = applePackage' "text_cmds" "106" "macos-11.0.1" "0cpnfpllwpx20hbxzg5i5488gcjyi9adnbac1sd5hpv3bq6z1hs5" {};
|
||||
top = applePackage' "top" "129" "macos-11.0.1" "1nyz5mvq7js3zhsi3dwxl5fslg6m7nhlgc6p2hr889xgyl5prw8f" {};
|
||||
xnu = applePackage' "xnu" "7195.50.7.100.1" "macos-11.0.1" "14wqkqp3lcxgpm1sjnsysybrc4ppzkghwv3mb5nr5v8ml37prkib" {};
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
{ lib, appleDerivation, xcbuildHook
|
||||
, libressl, Librpcsvc, xnu, libpcap, developer_cmds }:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook ];
|
||||
buildInputs = [ libressl xnu Librpcsvc libpcap developer_cmds ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = " -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
|
||||
|
||||
# "spray" requires some files that aren't compiling correctly in xcbuild.
|
||||
# "rtadvd" seems to fail with some missing constants.
|
||||
# "traceroute6" and "ping6" require ipsec which doesn't build correctly
|
||||
patchPhase = ''
|
||||
substituteInPlace network_cmds.xcodeproj/project.pbxproj \
|
||||
--replace "7294F0EA0EE8BAC80052EC88 /* PBXTargetDependency */," "" \
|
||||
--replace "7216D34D0EE89FEC00AE70E4 /* PBXTargetDependency */," "" \
|
||||
--replace "72CD1D9C0EE8C47C005F825D /* PBXTargetDependency */," "" \
|
||||
--replace "7216D2C20EE89ADF00AE70E4 /* PBXTargetDependency */," ""
|
||||
'';
|
||||
|
||||
# temporary install phase until xcodebuild has "install" support
|
||||
installPhase = ''
|
||||
for f in Products/Release/*; do
|
||||
if [ -f $f ]; then
|
||||
install -D $f $out/bin/$(basename $f)
|
||||
fi
|
||||
done
|
||||
|
||||
for n in 1 5; do
|
||||
mkdir -p $out/share/man/man$n
|
||||
install */*.$n $out/share/man/man$n
|
||||
done
|
||||
|
||||
# TODO: patch files to load from $out/ instead of /usr/
|
||||
|
||||
# mkdir -p $out/etc/
|
||||
# install rtadvd.tproj/rtadvd.conf ip6addrctl.tproj/ip6addrctl.conf $out/etc/
|
||||
|
||||
# mkdir -p $out/local/OpenSourceVersions/
|
||||
# install network_cmds.plist $out/local/OpenSourceVersions/
|
||||
|
||||
# mkdir -p $out/System/Library/LaunchDaemons
|
||||
# install kdumpd.tproj/com.apple.kdumpd.plist $out/System/Library/LaunchDaemons
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
{ appleDerivation, darwin-stubs }:
|
||||
|
||||
appleDerivation {
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
|
||||
# Not strictly necessary, since libSystem depends on it, but it's nice to be explicit so we
|
||||
# can easily find out what's impure.
|
||||
__propagatedImpureHostDeps = [
|
||||
"/usr/lib/libauto.dylib"
|
||||
"/usr/lib/libc++abi.dylib"
|
||||
"/usr/lib/libc++.1.dylib"
|
||||
"/usr/lib/libSystem.B.dylib"
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include/objc $out/lib
|
||||
cp ${darwin-stubs}/usr/lib/libobjc.A.tbd $out/lib/libobjc.A.tbd
|
||||
ln -s libobjc.A.tbd $out/lib/libobjc.tbd
|
||||
cp runtime/OldClasses.subproj/List.h $out/include/objc/List.h
|
||||
cp runtime/NSObjCRuntime.h $out/include/objc/NSObjCRuntime.h
|
||||
cp runtime/NSObject.h $out/include/objc/NSObject.h
|
||||
cp runtime/Object.h $out/include/objc/Object.h
|
||||
cp runtime/Protocol.h $out/include/objc/Protocol.h
|
||||
cp runtime/hashtable.h $out/include/objc/hashtable.h
|
||||
cp runtime/hashtable2.h $out/include/objc/hashtable2.h
|
||||
cp runtime/message.h $out/include/objc/message.h
|
||||
cp runtime/objc-api.h $out/include/objc/objc-api.h
|
||||
cp runtime/objc-auto.h $out/include/objc/objc-auto.h
|
||||
cp runtime/objc-class.h $out/include/objc/objc-class.h
|
||||
cp runtime/objc-exception.h $out/include/objc/objc-exception.h
|
||||
cp runtime/objc-load.h $out/include/objc/objc-load.h
|
||||
cp runtime/objc-runtime.h $out/include/objc/objc-runtime.h
|
||||
cp runtime/objc-sync.h $out/include/objc/objc-sync.h
|
||||
cp runtime/objc.h $out/include/objc/objc.h
|
||||
cp runtime/runtime.h $out/include/objc/runtime.h
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Generated by dtrace(1M).
|
||||
*/
|
||||
|
||||
#ifndef _OBJC_PROBES_H
|
||||
#define _OBJC_PROBES_H
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define OBJC_RUNTIME_STABILITY "___dtrace_stability$objc_runtime$v1$1_1_0_1_1_0_1_1_0_1_1_0_1_1_0"
|
||||
|
||||
#define OBJC_RUNTIME_TYPEDEFS "___dtrace_typedefs$objc_runtime$v2"
|
||||
|
||||
#if !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED
|
||||
|
||||
#define OBJC_RUNTIME_OBJC_EXCEPTION_RETHROW() \
|
||||
do { \
|
||||
__asm__ volatile(".reference " OBJC_RUNTIME_TYPEDEFS); \
|
||||
__dtrace_probe$objc_runtime$objc_exception_rethrow$v1(); \
|
||||
__asm__ volatile(".reference " OBJC_RUNTIME_STABILITY); \
|
||||
} while (0)
|
||||
#define OBJC_RUNTIME_OBJC_EXCEPTION_RETHROW_ENABLED() \
|
||||
({ int _r = __dtrace_isenabled$objc_runtime$objc_exception_rethrow$v1(); \
|
||||
__asm__ volatile(""); \
|
||||
_r; })
|
||||
#define OBJC_RUNTIME_OBJC_EXCEPTION_THROW(arg0) \
|
||||
do { \
|
||||
__asm__ volatile(".reference " OBJC_RUNTIME_TYPEDEFS); \
|
||||
__dtrace_probe$objc_runtime$objc_exception_throw$v1$766f6964202a(arg0); \
|
||||
__asm__ volatile(".reference " OBJC_RUNTIME_STABILITY); \
|
||||
} while (0)
|
||||
#define OBJC_RUNTIME_OBJC_EXCEPTION_THROW_ENABLED() \
|
||||
({ int _r = __dtrace_isenabled$objc_runtime$objc_exception_throw$v1(); \
|
||||
__asm__ volatile(""); \
|
||||
_r; })
|
||||
|
||||
|
||||
extern void __dtrace_probe$objc_runtime$objc_exception_rethrow$v1(void);
|
||||
extern int __dtrace_isenabled$objc_runtime$objc_exception_rethrow$v1(void);
|
||||
extern void __dtrace_probe$objc_runtime$objc_exception_throw$v1$766f6964202a(const void *);
|
||||
extern int __dtrace_isenabled$objc_runtime$objc_exception_throw$v1(void);
|
||||
|
||||
#else
|
||||
|
||||
#define OBJC_RUNTIME_OBJC_EXCEPTION_RETHROW() \
|
||||
do { \
|
||||
} while (0)
|
||||
#define OBJC_RUNTIME_OBJC_EXCEPTION_RETHROW_ENABLED() (0)
|
||||
#define OBJC_RUNTIME_OBJC_EXCEPTION_THROW(arg0) \
|
||||
do { \
|
||||
} while (0)
|
||||
#define OBJC_RUNTIME_OBJC_EXCEPTION_THROW_ENABLED() (0)
|
||||
|
||||
#endif /* !defined(DTRACE_PROBES_DISABLED) || !DTRACE_PROBES_DISABLED */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OBJC_PROBES_H */
|
||||
118
pkgs/os-specific/darwin/apple-source-releases/objc4/pure.nix
Normal file
118
pkgs/os-specific/darwin/apple-source-releases/objc4/pure.nix
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
{ stdenv, fetchapplesource, libauto, launchd, libc_old, libunwind }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "551.1";
|
||||
pname = "objc4";
|
||||
|
||||
src = fetchapplesource {
|
||||
inherit version;
|
||||
name = "objc4";
|
||||
sha256 = "1jrdb6yyb5jwwj27c1r0nr2y2ihqjln8ynj61mpkvp144c1cm5bg";
|
||||
};
|
||||
|
||||
patches = [ ./spinlocks.patch ];
|
||||
|
||||
buildInputs = [ libauto launchd libc_old libunwind ];
|
||||
|
||||
buildPhase = ''
|
||||
cp ${./objc-probes.h} runtime/objc-probes.h
|
||||
|
||||
mkdir -p build/include/objc
|
||||
|
||||
cp runtime/hashtable.h build/include/objc/hashtable.h
|
||||
cp runtime/OldClasses.subproj/List.h build/include/objc/List.h
|
||||
cp runtime/hashtable2.h build/include/objc/hashtable2.h
|
||||
cp runtime/message.h build/include/objc/message.h
|
||||
cp runtime/objc-api.h build/include/objc/objc-api.h
|
||||
cp runtime/objc-auto.h build/include/objc/objc-auto.h
|
||||
cp runtime/objc-class.h build/include/objc/objc-class.h
|
||||
cp runtime/objc-exception.h build/include/objc/objc-exception.h
|
||||
cp runtime/objc-load.h build/include/objc/objc-load.h
|
||||
cp runtime/objc-sync.h build/include/objc/objc-sync.h
|
||||
cp runtime/objc.h build/include/objc/objc.h
|
||||
cp runtime/objc-runtime.h build/include/objc/objc-runtime.h
|
||||
cp runtime/Object.h build/include/objc/Object.h
|
||||
cp runtime/Protocol.h build/include/objc/Protocol.h
|
||||
cp runtime/runtime.h build/include/objc/runtime.h
|
||||
cp runtime/NSObject.h build/include/objc/NSObject.h
|
||||
cp runtime/NSObjCRuntime.h build/include/objc/NSObjCRuntime.h
|
||||
|
||||
# These would normally be in local/include but we don't do local, so they're
|
||||
# going in with the others
|
||||
cp runtime/maptable.h build/include/objc/maptable.h
|
||||
cp runtime/objc-abi.h build/include/objc/objc-abi.h
|
||||
cp runtime/objc-auto-dump.h build/include/objc/objc-auto-dump.h
|
||||
cp runtime/objc-gdb.h build/include/objc/objc-gdb.h
|
||||
cp runtime/objc-internal.h build/include/objc/objc-internal.h
|
||||
|
||||
cc -o markgc markgc.c
|
||||
|
||||
FLAGS="-Wno-deprecated-register -Wno-unknown-pragmas -Wno-deprecated-objc-isa-usage -Wno-invalid-offsetof -Wno-inline-new-delete -Wno-cast-of-sel-type -Iruntime -Ibuild/include -Iruntime/Accessors.subproj -D_LIBCPP_VISIBLE= -DOS_OBJECT_USE_OBJC=0 -DNDEBUG=1"
|
||||
|
||||
cc -std=gnu++11 $FLAGS -c runtime/hashtable2.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/maptable.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-auto.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-cache.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-class-old.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-class.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-errors.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-exception.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-file.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-initialize.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-layout.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-load.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-loadmethod.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-lockdebug.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-runtime-new.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-runtime-old.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-runtime.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-sel-set.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-sel.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-sync.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-typeencoding.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/Object.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/Protocol.mm
|
||||
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-references.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-os.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-auto-dump.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-file-old.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-block-trampolines.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-externalref.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-weak.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/NSObject.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-opt.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-cache-old.mm
|
||||
cc -std=gnu++11 $FLAGS -c runtime/objc-sel-old.mm
|
||||
|
||||
cc -std=gnu++11 $FLAGS -c runtime/Accessors.subproj/objc-accessors.mm
|
||||
|
||||
cc $FLAGS -c runtime/objc-sel-table.s
|
||||
|
||||
cc $FLAGS -c runtime/OldClasses.subproj/List.m
|
||||
cc $FLAGS -c runtime/Messengers.subproj/objc-msg-arm.s
|
||||
cc $FLAGS -c runtime/Messengers.subproj/objc-msg-i386.s
|
||||
cc $FLAGS -c runtime/Messengers.subproj/objc-msg-x86_64.s
|
||||
cc $FLAGS -c runtime/Messengers.subproj/objc-msg-simulator-i386.s
|
||||
|
||||
cc $FLAGS -c runtime/a1a2-blocktramps-i386.s
|
||||
cc $FLAGS -c runtime/a2a3-blocktramps-i386.s
|
||||
|
||||
cc $FLAGS -c runtime/a1a2-blocktramps-x86_64.s
|
||||
cc $FLAGS -c runtime/a2a3-blocktramps-x86_64.s
|
||||
|
||||
cc $FLAGS -c runtime/a1a2-blocktramps-arm.s
|
||||
cc $FLAGS -c runtime/a2a3-blocktramps-arm.s
|
||||
|
||||
c++ -Wl,-no_dtrace_dof --stdlib=libc++ -dynamiclib -lauto -install_name $out/lib/libobjc.dylib -o libobjc.dylib *.o
|
||||
|
||||
./markgc -p libobjc.dylib
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/include $out/lib
|
||||
|
||||
mv build/include/objc $out/include
|
||||
mv libobjc.dylib $out/lib
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
--- objc4-551.1/runtime/objc-os.h 2013-06-10 21:16:15.000000000 -0400
|
||||
+++ ../objc4-551.1/runtime/objc-os.h 2015-01-19 01:01:36.000000000 -0500
|
||||
@@ -77,27 +77,72 @@
|
||||
# include <mach-o/getsect.h>
|
||||
# include <mach-o/dyld_priv.h>
|
||||
# include <malloc/malloc.h>
|
||||
-# include <os/lock_private.h>
|
||||
# include <libkern/OSAtomic.h>
|
||||
# include <libkern/OSCacheControl.h>
|
||||
-# include <System/pthread_machdep.h>
|
||||
# include "objc-probes.h" // generated dtrace probe definitions.
|
||||
|
||||
+#define __PTK_FRAMEWORK_OBJC_KEY5 45
|
||||
+#define __PTK_FRAMEWORK_OBJC_KEY6 46
|
||||
+#define __PTK_FRAMEWORK_OBJC_KEY7 47
|
||||
+#define __PTK_FRAMEWORK_OBJC_KEY8 48
|
||||
+#define __PTK_FRAMEWORK_OBJC_KEY9 49
|
||||
+
|
||||
+extern "C" int pthread_key_init_np(int, void (*)(void *));
|
||||
+
|
||||
// Some libc functions call objc_msgSend()
|
||||
// so we can't use them without deadlocks.
|
||||
void syslog(int, const char *, ...) UNAVAILABLE_ATTRIBUTE;
|
||||
void vsyslog(int, const char *, va_list) UNAVAILABLE_ATTRIBUTE;
|
||||
|
||||
+#if defined(__i386__) || defined(__x86_64__)
|
||||
+
|
||||
+// Inlined spinlock.
|
||||
+// Not for arm on iOS because it hurts uniprocessor performance.
|
||||
+
|
||||
+#define ARR_SPINLOCK_INIT 0
|
||||
+// XXX -- Careful: OSSpinLock isn't volatile, but should be
|
||||
+typedef volatile int ARRSpinLock;
|
||||
+__attribute__((always_inline))
|
||||
+static inline void ARRSpinLockLock(ARRSpinLock *l)
|
||||
+{
|
||||
+ unsigned y;
|
||||
+again:
|
||||
+ if (__builtin_expect(__sync_lock_test_and_set(l, 1), 0) == 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+ for (y = 1000; y; y--) {
|
||||
+#if defined(__i386__) || defined(__x86_64__)
|
||||
+ asm("pause");
|
||||
+#endif
|
||||
+ if (*l == 0) goto again;
|
||||
+ }
|
||||
+ thread_switch(THREAD_NULL, SWITCH_OPTION_DEPRESS, 1);
|
||||
+ goto again;
|
||||
+}
|
||||
+__attribute__((always_inline))
|
||||
+static inline void ARRSpinLockUnlock(ARRSpinLock *l)
|
||||
+{
|
||||
+ __sync_lock_release(l);
|
||||
+}
|
||||
+__attribute__((always_inline))
|
||||
+static inline int ARRSpinLockTry(ARRSpinLock *l)
|
||||
+{
|
||||
+ return __sync_bool_compare_and_swap(l, 0, 1);
|
||||
+}
|
||||
+
|
||||
+#define spinlock_t ARRSpinLock
|
||||
+#define spinlock_trylock(l) ARRSpinLockTry(l)
|
||||
+#define spinlock_lock(l) ARRSpinLockLock(l)
|
||||
+#define spinlock_unlock(l) ARRSpinLockUnlock(l)
|
||||
+#define SPINLOCK_INITIALIZER ARR_SPINLOCK_INIT
|
||||
|
||||
-#define spinlock_t os_lock_handoff_s
|
||||
-#define spinlock_trylock(l) os_lock_trylock(l)
|
||||
-#define spinlock_lock(l) os_lock_lock(l)
|
||||
-#define spinlock_unlock(l) os_lock_unlock(l)
|
||||
-#define SPINLOCK_INITIALIZER OS_LOCK_HANDOFF_INIT
|
||||
+#endif
|
||||
|
||||
|
||||
#if !TARGET_OS_IPHONE
|
||||
-# include <CrashReporterClient.h>
|
||||
+#define CRSetCrashLogMessage(msg)
|
||||
+#define CRGetCrashLogMessage() 0
|
||||
+#define CRSetCrashLogMessage2(msg)
|
||||
#else
|
||||
// CrashReporterClient not yet available on iOS
|
||||
__BEGIN_DECLS
|
||||
@@ -594,21 +639,13 @@
|
||||
{
|
||||
assert(is_valid_direct_key(k));
|
||||
|
||||
- if (_pthread_has_direct_tsd()) {
|
||||
- return _pthread_getspecific_direct(k);
|
||||
- } else {
|
||||
- return pthread_getspecific(k);
|
||||
- }
|
||||
+ return pthread_getspecific(k);
|
||||
}
|
||||
static inline void tls_set_direct(tls_key_t k, void *value)
|
||||
{
|
||||
assert(is_valid_direct_key(k));
|
||||
|
||||
- if (_pthread_has_direct_tsd()) {
|
||||
- _pthread_setspecific_direct(k, value);
|
||||
- } else {
|
||||
- pthread_setspecific(k, value);
|
||||
- }
|
||||
+ pthread_setspecific(k, value);
|
||||
}
|
||||
|
||||
// not arm
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{ appleDerivation', stdenv }:
|
||||
|
||||
appleDerivation' stdenv {
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/include/ppp
|
||||
|
||||
cp Controller/ppp_msg.h $out/include/ppp
|
||||
cp Controller/pppcontroller_types.h $out/include/ppp
|
||||
cp Controller/pppcontroller_types.h $out/include
|
||||
cp Controller/pppcontroller.defs $out/include/ppp
|
||||
cp Controller/pppcontroller_mach_defines.h $out/include
|
||||
cp Controller/PPPControllerPriv.h $out/include/ppp
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ appleDerivation', stdenvNoCC }:
|
||||
|
||||
appleDerivation' stdenvNoCC {
|
||||
installPhase = ''
|
||||
mkdir -p $out/include/
|
||||
cp removefile.h checkint.h $out/include/
|
||||
'';
|
||||
|
||||
appleHeaders = ''
|
||||
checkint.h
|
||||
removefile.h
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
{ lib, appleDerivation, xcbuildHook, launchd }:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook launchd ];
|
||||
|
||||
patchPhase = ''
|
||||
# NOTE: these hashes must be recalculated for each version change
|
||||
|
||||
# disables:
|
||||
# - su ('security/pam_appl.h' file not found)
|
||||
# - find (Undefined symbol '_get_date')
|
||||
# - w (Undefined symbol '_res_9_init')
|
||||
# - expr
|
||||
substituteInPlace shell_cmds.xcodeproj/project.pbxproj \
|
||||
--replace "FCBA168714A146D000AA698B /* PBXTargetDependency */," "" \
|
||||
--replace "FCBA165914A146D000AA698B /* PBXTargetDependency */," "" \
|
||||
--replace "FCBA169514A146D000AA698B /* PBXTargetDependency */," "" \
|
||||
--replace "FCBA165514A146D000AA698B /* PBXTargetDependency */," ""
|
||||
|
||||
# disable w, test install
|
||||
# get rid of permission stuff
|
||||
substituteInPlace xcodescripts/install-files.sh \
|
||||
--replace 'ln -f "$BINDIR/w" "$BINDIR/uptime"' "" \
|
||||
--replace 'ln -f "$DSTROOT/bin/test" "$DSTROOT/bin/["' "" \
|
||||
--replace "-o root -g wheel -m 0755" "" \
|
||||
--replace "-o root -g wheel -m 0644" ""
|
||||
'';
|
||||
|
||||
# temporary install phase until xcodebuild has "install" support
|
||||
installPhase = ''
|
||||
for f in Products/Release/*; do
|
||||
if [ -f $f ]; then
|
||||
install -D $f $out/usr/bin/$(basename $f)
|
||||
fi
|
||||
done
|
||||
|
||||
export DSTROOT=$out
|
||||
export SRCROOT=$PWD
|
||||
. xcodescripts/install-files.sh
|
||||
|
||||
mv $out/usr/* $out
|
||||
mv $out/private/etc $out
|
||||
rmdir $out/usr $out/private
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
{ stdenv, appleDerivation, lib
|
||||
, libutil, Librpcsvc, apple_sdk, pam, CF, openbsm }:
|
||||
|
||||
appleDerivation {
|
||||
# xcbuild fails with:
|
||||
# /nix/store/fc0rz62dh8vr648qi7hnqyik6zi5sqx8-xcbuild-wrapper/nix-support/setup-hook: line 1: 9083 Segmentation fault: 11 xcodebuild OTHER_CFLAGS="$NIX_CFLAGS_COMPILE" OTHER_CPLUSPLUSFLAGS="$NIX_CFLAGS_COMPILE" OTHER_LDFLAGS="$NIX_LDFLAGS" build
|
||||
# see issue facebook/xcbuild#188
|
||||
# buildInputs = [ xcbuild ];
|
||||
|
||||
buildInputs = [ libutil Librpcsvc apple_sdk.frameworks.OpenDirectory pam CF
|
||||
apple_sdk.frameworks.IOKit openbsm ];
|
||||
# NIX_CFLAGS_COMPILE = lib.optionalString hostPlatform.isi686 "-D__i386__"
|
||||
# + lib.optionalString hostPlatform.isx86_64 "-D__x86_64__"
|
||||
# + lib.optionalString hostPlatform.isAarch32 "-D__arm__";
|
||||
NIX_CFLAGS_COMPILE = [ "-DDAEMON_UID=1"
|
||||
"-DDAEMON_GID=1"
|
||||
"-DDEFAULT_AT_QUEUE='a'"
|
||||
"-DDEFAULT_BATCH_QUEUE='b'"
|
||||
"-DPERM_PATH=\"/usr/lib/cron/\""
|
||||
"-DOPEN_DIRECTORY"
|
||||
"-DNO_DIRECT_RPC"
|
||||
"-DAPPLE_GETCONF_UNDERSCORE"
|
||||
"-DAPPLE_GETCONF_SPEC"
|
||||
"-DUSE_PAM"
|
||||
"-DUSE_BSM_AUDIT"
|
||||
"-D_PW_NAME_LEN=MAXLOGNAME"
|
||||
"-D_PW_YPTOKEN=\"__YP!\""
|
||||
"-DAHZV1=64 "
|
||||
"-DAU_SESSION_FLAG_HAS_TTY=0x4000"
|
||||
"-DAU_SESSION_FLAG_HAS_AUTHENTICATED=0x4000"
|
||||
] ++ lib.optional (!stdenv.isLinux) " -D__FreeBSD__ ";
|
||||
|
||||
patchPhase = ''
|
||||
substituteInPlace login.tproj/login.c \
|
||||
--replace bsm/audit_session.h bsm/audit.h
|
||||
substituteInPlace login.tproj/login_audit.c \
|
||||
--replace bsm/audit_session.h bsm/audit.h
|
||||
'' + lib.optionalString stdenv.isAarch64 ''
|
||||
substituteInPlace sysctl.tproj/sysctl.c \
|
||||
--replace "GPROF_STATE" "0"
|
||||
substituteInPlace login.tproj/login.c \
|
||||
--replace "defined(__arm__)" "defined(__arm__) || defined(__arm64__)"
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
for dir in *.tproj; do
|
||||
name=$(basename $dir)
|
||||
name=''${name%.tproj}
|
||||
|
||||
CFLAGS=""
|
||||
case $name in
|
||||
arch) CFLAGS="-framework CoreFoundation";;
|
||||
atrun) CFLAGS="-Iat.tproj";;
|
||||
chkpasswd)
|
||||
CFLAGS="-framework OpenDirectory -framework CoreFoundation -lpam";;
|
||||
getconf)
|
||||
for f in getconf.tproj/*.gperf; do
|
||||
cfile=''${f%.gperf}.c
|
||||
LC_ALL=C awk -f getconf.tproj/fake-gperf.awk $f > $cfile
|
||||
done
|
||||
;;
|
||||
iostat) CFLAGS="-framework IOKit -framework CoreFoundation";;
|
||||
login) CFLAGS="-lbsm -lpam";;
|
||||
nvram) CFLAGS="-framework CoreFoundation -framework IOKit";;
|
||||
sadc) CFLAGS="-framework IOKit -framework CoreFoundation";;
|
||||
sar) CFLAGS="-Isadc.tproj";;
|
||||
esac
|
||||
|
||||
echo "Building $name"
|
||||
|
||||
case $name in
|
||||
|
||||
# These are all broken currently.
|
||||
arch) continue;;
|
||||
chpass) continue;;
|
||||
dirhelper) continue;;
|
||||
dynamic_pager) continue;;
|
||||
fs_usage) continue;;
|
||||
latency) continue;;
|
||||
pagesize) continue;;
|
||||
passwd) continue;;
|
||||
reboot) continue;;
|
||||
sc_usage) continue;;
|
||||
shutdown) continue;;
|
||||
trace) continue;;
|
||||
|
||||
*) cc $dir/*.c -I''${dir} $CFLAGS -o $name ;;
|
||||
esac
|
||||
done
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
for dir in *.tproj; do
|
||||
name=$(basename $dir)
|
||||
name=''${name%.tproj}
|
||||
[ -x $name ] && install -D $name $out/bin/$name
|
||||
for n in 1 2 3 4 5 6 7 8 9; do
|
||||
for f in $dir/*.$n; do
|
||||
install -D $f $out/share/man/man$n/$(basename $f)
|
||||
done
|
||||
done
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ shlevy matthewbauer ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, appleDerivation, xcbuildHook, ncurses, bzip2, zlib, xz }:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook ];
|
||||
buildInputs = [ ncurses bzip2 zlib xz ];
|
||||
|
||||
# patches to use ncursees
|
||||
# disables md5
|
||||
patchPhase = ''
|
||||
substituteInPlace text_cmds.xcodeproj/project.pbxproj \
|
||||
--replace 'FC6C98FB149A94EB00DDCC47 /* libcurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcurses.dylib; path = /usr/lib/libcurses.dylib; sourceTree = "<absolute>"; };' 'FC6C98FB149A94EB00DDCC47 /* libncurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.dylib; path = /usr/lib/libncurses.dylib; sourceTree = "<absolute>"; };' \
|
||||
--replace 'FC7A7EB5149875E00086576A /* PBXTargetDependency */,' ""
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
for f in Products/Release/*; do
|
||||
if [ -f $f ]; then
|
||||
install -D $f $out/bin/$(basename $f)
|
||||
fi
|
||||
done
|
||||
'';
|
||||
|
||||
NIX_CFLAGS_COMPILE=[ "-Wno-error=format-security" ]; # hardeningDisable doesn't cut it
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{xcbuildHook, appleDerivation, apple_sdk, ncurses, libutil, lib}:
|
||||
|
||||
appleDerivation {
|
||||
nativeBuildInputs = [ xcbuildHook ];
|
||||
buildInputs = [ apple_sdk.frameworks.IOKit ncurses libutil ];
|
||||
NIX_LDFLAGS = "-lutil";
|
||||
installPhase = ''
|
||||
install -D Products/Release/libtop.a $out/lib/libtop.a
|
||||
install -D Products/Release/libtop.h $out/include/libtop.h
|
||||
install -D Products/Release/top $out/bin/top
|
||||
'';
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
145
pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
Normal file
145
pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
{ appleDerivation', lib, stdenv, stdenvNoCC, buildPackages
|
||||
, bootstrap_cmds, bison, flex
|
||||
, gnum4, unifdef, perl, python3
|
||||
, headersOnly ? true
|
||||
}:
|
||||
|
||||
appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ({
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
|
||||
nativeBuildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python3 ];
|
||||
|
||||
patches = [ ./python3.patch ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace Makefile \
|
||||
--replace "/bin/" "" \
|
||||
--replace "MAKEJOBS := " '# MAKEJOBS := '
|
||||
|
||||
substituteInPlace makedefs/MakeInc.cmd \
|
||||
--replace "/usr/bin/" "" \
|
||||
--replace "/bin/" "" \
|
||||
--replace "-Werror " ""
|
||||
|
||||
substituteInPlace makedefs/MakeInc.def \
|
||||
--replace "-c -S -m" "-c -m"
|
||||
|
||||
substituteInPlace makedefs/MakeInc.top \
|
||||
--replace "MEMORY_SIZE := " 'MEMORY_SIZE := 1073741824 # '
|
||||
|
||||
substituteInPlace libkern/kxld/Makefile \
|
||||
--replace "-Werror " ""
|
||||
|
||||
substituteInPlace SETUP/kextsymboltool/Makefile \
|
||||
--replace "-lstdc++" "-lc++"
|
||||
|
||||
substituteInPlace libsyscall/xcodescripts/mach_install_mig.sh \
|
||||
--replace "/usr/include" "/include" \
|
||||
--replace "/usr/local/include" "/include" \
|
||||
--replace 'MIG=`' "# " \
|
||||
--replace 'MIGCC=`' "# " \
|
||||
--replace " -o 0" "" \
|
||||
--replace '$SRC/$mig' '-I$DSTROOT/include $SRC/$mig' \
|
||||
--replace '$SRC/servers/netname.defs' '-I$DSTROOT/include $SRC/servers/netname.defs' \
|
||||
--replace '$BUILT_PRODUCTS_DIR/mig_hdr' '$BUILT_PRODUCTS_DIR'
|
||||
|
||||
patchShebangs .
|
||||
'';
|
||||
|
||||
PLATFORM = "MacOSX";
|
||||
SDKVERSION = "10.11";
|
||||
CC = "${stdenv.cc.targetPrefix or ""}cc";
|
||||
CXX = "${stdenv.cc.targetPrefix or ""}c++";
|
||||
MIG = "mig";
|
||||
MIGCOM = "migcom";
|
||||
STRIP = "${stdenv.cc.bintools.targetPrefix or ""}strip";
|
||||
NM = "${stdenv.cc.bintools.targetPrefix or ""}nm";
|
||||
UNIFDEF = "unifdef";
|
||||
DSYMUTIL = "dsymutil";
|
||||
HOST_OS_VERSION = "10.10";
|
||||
HOST_CC = "${buildPackages.stdenv.cc.targetPrefix or ""}cc";
|
||||
HOST_FLEX = "flex";
|
||||
HOST_BISON = "bison";
|
||||
HOST_GM4 = "m4";
|
||||
MIGCC = "cc";
|
||||
ARCHS = "x86_64";
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-Wno-error";
|
||||
|
||||
preBuild = ''
|
||||
# This is a bit of a hack...
|
||||
mkdir -p sdk/usr/local/libexec
|
||||
|
||||
cat > sdk/usr/local/libexec/availability.pl <<EOF
|
||||
#!$SHELL
|
||||
if [ "\$1" == "--macosx" ]; then
|
||||
echo 10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11
|
||||
elif [ "\$1" == "--ios" ]; then
|
||||
echo 2.0 2.1 2.2 3.0 3.1 3.2 4.0 4.1 4.2 4.3 5.0 5.1 6.0 6.1 7.0 8.0 9.0
|
||||
fi
|
||||
EOF
|
||||
chmod +x sdk/usr/local/libexec/availability.pl
|
||||
|
||||
export SDKROOT_RESOLVED=$PWD/sdk
|
||||
export HOST_SDKROOT_RESOLVED=$PWD/sdk
|
||||
|
||||
export BUILT_PRODUCTS_DIR=.
|
||||
export DSTROOT=$out
|
||||
'';
|
||||
|
||||
buildFlags = lib.optional headersOnly "exporthdrs";
|
||||
installTargets = lib.optional headersOnly "installhdrs";
|
||||
|
||||
postInstall = lib.optionalString headersOnly ''
|
||||
mv $out/usr/include $out
|
||||
|
||||
(cd BUILD/obj/EXPORT_HDRS && find -type f -exec install -D \{} $out/include/\{} \;)
|
||||
|
||||
# TODO: figure out why I need to do this
|
||||
cp libsyscall/wrappers/*.h $out/include
|
||||
install -D libsyscall/os/tsd.h $out/include/os/tsd.h
|
||||
cp EXTERNAL_HEADERS/AssertMacros.h $out/include
|
||||
cp EXTERNAL_HEADERS/Availability*.h $out/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/
|
||||
cp -r EXTERNAL_HEADERS/corecrypto $out/include
|
||||
|
||||
# Build the mach headers we crave
|
||||
export SRCROOT=$PWD/libsyscall
|
||||
export DERIVED_SOURCES_DIR=$out/include
|
||||
export SDKROOT=$out
|
||||
export OBJROOT=$PWD
|
||||
export BUILT_PRODUCTS_DIR=$out
|
||||
libsyscall/xcodescripts/mach_install_mig.sh
|
||||
|
||||
# Get rid of the System prefix
|
||||
mv $out/System/* $out/
|
||||
rmdir $out/System
|
||||
|
||||
# TODO: do I need this?
|
||||
mv $out/internal_hdr/include/mach/*.h $out/include/mach
|
||||
|
||||
# Get rid of some junk lying around
|
||||
rm -rf $out/internal_hdr $out/usr $out/local
|
||||
|
||||
# Add some symlinks
|
||||
ln -s $out/Library/Frameworks/System.framework/Versions/B \
|
||||
$out/Library/Frameworks/System.framework/Versions/Current
|
||||
ln -s $out/Library/Frameworks/System.framework/Versions/Current/PrivateHeaders \
|
||||
$out/Library/Frameworks/System.framework/Headers
|
||||
|
||||
# IOKit (and possibly the others) is incomplete,
|
||||
# so let's not make it visible from here...
|
||||
mkdir $out/Library/PrivateFrameworks
|
||||
mv $out/Library/Frameworks/IOKit.framework $out/Library/PrivateFrameworks
|
||||
'';
|
||||
|
||||
appleHeaders = builtins.readFile ./headers.txt;
|
||||
} // lib.optionalAttrs headersOnly {
|
||||
HOST_CODESIGN = "echo";
|
||||
HOST_CODESIGN_ALLOCATE = "echo";
|
||||
LIPO = "echo";
|
||||
LIBTOOL = "echo";
|
||||
CTFCONVERT = "echo";
|
||||
CTFMERGE = "echo";
|
||||
CTFINSERT = "echo";
|
||||
NMEDIT = "echo";
|
||||
})
|
||||
1318
pkgs/os-specific/darwin/apple-source-releases/xnu/headers.txt
Normal file
1318
pkgs/os-specific/darwin/apple-source-releases/xnu/headers.txt
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,41 @@
|
|||
diff --git a/bsd/kern/makekdebugevents.py b/bsd/kern/makekdebugevents.py
|
||||
index 73b2db4..d354ba0 100755
|
||||
--- a/bsd/kern/makekdebugevents.py
|
||||
+++ b/bsd/kern/makekdebugevents.py
|
||||
@@ -5,7 +5,7 @@
|
||||
# named kd_events[] or these mappings.
|
||||
# Required to generate a header file used by DEVELOPMENT and DEBUG kernels.
|
||||
#
|
||||
-
|
||||
+
|
||||
import sys
|
||||
import re
|
||||
|
||||
@@ -21,18 +21,18 @@ code_table = []
|
||||
# scan file to generate internal table
|
||||
with open(trace_code_file, 'rt') as codes:
|
||||
for line in codes:
|
||||
- m = id_name_pattern.match(line)
|
||||
- if m:
|
||||
+ m = id_name_pattern.match(line)
|
||||
+ if m:
|
||||
code_table += [(int(m.group(1),base=16), m.group(2))]
|
||||
|
||||
# emit typedef:
|
||||
-print "typedef struct {"
|
||||
-print " uint32_t id;"
|
||||
-print " const char *name;"
|
||||
-print "} kd_event_t;"
|
||||
+print("typedef struct {")
|
||||
+print(" uint32_t id;")
|
||||
+print(" const char *name;")
|
||||
+print("} kd_event_t;")
|
||||
# emit structure declaration and sorted initialization:
|
||||
-print "kd_event_t kd_events[] = {"
|
||||
+print("kd_event_t kd_events[] = {")
|
||||
for mapping in sorted(code_table, key=lambda x: x[0]):
|
||||
- print " {0x%x, \"%s\"}," % mapping
|
||||
-print "};"
|
||||
+ print(" {0x%x, \"%s\"}," % mapping)
|
||||
+print("};")
|
||||
|
||||
74
pkgs/os-specific/darwin/binutils/default.nix
Normal file
74
pkgs/os-specific/darwin/binutils/default.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{ lib, stdenv, makeWrapper, binutils-unwrapped, cctools, llvm, clang-unwrapped }:
|
||||
|
||||
# Make sure both underlying packages claim to have prepended their binaries
|
||||
# with the same targetPrefix.
|
||||
assert binutils-unwrapped.targetPrefix == cctools.targetPrefix;
|
||||
|
||||
let
|
||||
inherit (binutils-unwrapped) targetPrefix;
|
||||
cmds = [
|
||||
"ar" "ranlib" "as" "install_name_tool"
|
||||
"ld" "strip" "otool" "lipo" "nm" "strings" "size"
|
||||
"codesign_allocate"
|
||||
];
|
||||
in
|
||||
|
||||
# TODO: loop over targetPrefixed binaries too
|
||||
stdenv.mkDerivation {
|
||||
pname = "${targetPrefix}cctools-binutils-darwin";
|
||||
inherit (cctools) version;
|
||||
outputs = [ "out" "man" ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin $out/include
|
||||
|
||||
ln -s ${binutils-unwrapped.out}/bin/${targetPrefix}c++filt $out/bin/${targetPrefix}c++filt
|
||||
|
||||
# We specifically need:
|
||||
# - ld: binutils doesn't provide it on darwin
|
||||
# - as: as above
|
||||
# - ar: the binutils one produces .a files that the cctools ld doesn't like
|
||||
# - ranlib: for compatibility with ar
|
||||
# - otool: we use it for some of our name mangling
|
||||
# - install_name_tool: we use it to rewrite stuff in our bootstrap tools
|
||||
# - strip: the binutils one seems to break mach-o files
|
||||
# - lipo: gcc build assumes it exists
|
||||
# - nm: the gnu one doesn't understand many new load commands
|
||||
for i in ${lib.concatStringsSep " " (builtins.map (e: targetPrefix + e) cmds)}; do
|
||||
ln -sf "${cctools}/bin/$i" "$out/bin/$i"
|
||||
done
|
||||
|
||||
ln -s ${llvm}/bin/dsymutil $out/bin/dsymutil
|
||||
|
||||
ln -s ${binutils-unwrapped.out}/share $out/share
|
||||
|
||||
ln -s ${cctools}/libexec $out/libexec
|
||||
|
||||
mkdir -p "$man"/share/man/man{1,5}
|
||||
for i in ${builtins.concatStringsSep " " cmds}; do
|
||||
for path in "${cctools.man}"/share/man/man?/$i.*; do
|
||||
dest_path="$man''${path#${cctools.man}}"
|
||||
ln -sv "$path" "$dest_path"
|
||||
done
|
||||
done
|
||||
''
|
||||
# On aarch64-darwin we must use clang, because "as" from cctools just doesn't
|
||||
# handle the arch. Proxying calls to clang produces quite a bit of warnings,
|
||||
# and using clang directly here is a better option than relying on cctools.
|
||||
# On x86_64-darwin the Clang version is too old to support this mode.
|
||||
+ lib.optionalString stdenv.isAarch64 ''
|
||||
rm $out/bin/${targetPrefix}as
|
||||
makeWrapper "${clang-unwrapped}/bin/clang" "$out/bin/${targetPrefix}as" \
|
||||
--add-flags "-x assembler -integrated-as -c"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = lib.optionals stdenv.isAarch64 [ makeWrapper ];
|
||||
|
||||
passthru = {
|
||||
inherit targetPrefix;
|
||||
};
|
||||
|
||||
meta = {
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
priority = 10;
|
||||
};
|
||||
}
|
||||
16
pkgs/os-specific/darwin/cctools/ld-ignore-rpath-link.patch
Normal file
16
pkgs/os-specific/darwin/cctools/ld-ignore-rpath-link.patch
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
diff --git a/cctools/ld64/src/ld/Options.cpp b/cctools/ld64/src/ld/Options.cpp
|
||||
index 2565518..9250016 100644
|
||||
--- a/cctools/ld64/src/ld/Options.cpp
|
||||
+++ b/cctools/ld64/src/ld/Options.cpp
|
||||
@@ -2522,6 +2522,11 @@ void Options::parse(int argc, const char* argv[])
|
||||
throw "missing argument to -rpath";
|
||||
fRPaths.push_back(path);
|
||||
}
|
||||
+ else if ( strcmp(arg, "-rpath-link") == 0 ) {
|
||||
+ const char* path = argv[++i];
|
||||
+ if ( path == NULL )
|
||||
+ throw "missing argument to -rpath-link";
|
||||
+ }
|
||||
else if ( strcmp(arg, "-read_only_stubs") == 0 ) {
|
||||
fReadOnlyx86Stubs = true;
|
||||
}
|
||||
29
pkgs/os-specific/darwin/cctools/ld-rpath-nonfinal.patch
Normal file
29
pkgs/os-specific/darwin/cctools/ld-rpath-nonfinal.patch
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
diff --git a/cctools/ld64/src/ld/Options.cpp b/cctools/ld64/src/ld/Options.cpp
|
||||
index e4b37ec..4189ebc 100644
|
||||
--- a/cctools/ld64/src/ld/Options.cpp
|
||||
+++ b/cctools/ld64/src/ld/Options.cpp
|
||||
@@ -5800,24 +5800,6 @@ void Options::checkIllegalOptionCombinations()
|
||||
if ( fDeadStrip && (fOutputKind == Options::kObjectFile) )
|
||||
throw "-r and -dead_strip cannot be used together";
|
||||
|
||||
- // can't use -rpath unless targeting 10.5 or later
|
||||
- if ( fRPaths.size() > 0 ) {
|
||||
- if ( !platforms().minOS(ld::version2008) )
|
||||
- throw "-rpath can only be used when targeting Mac OS X 10.5 or later";
|
||||
- switch ( fOutputKind ) {
|
||||
- case Options::kDynamicExecutable:
|
||||
- case Options::kDynamicLibrary:
|
||||
- case Options::kDynamicBundle:
|
||||
- break;
|
||||
- case Options::kStaticExecutable:
|
||||
- case Options::kObjectFile:
|
||||
- case Options::kDyld:
|
||||
- case Options::kPreload:
|
||||
- case Options::kKextBundle:
|
||||
- throw "-rpath can only be used when creating a dynamic final linked image";
|
||||
- }
|
||||
- }
|
||||
-
|
||||
if ( fPositionIndependentExecutable ) {
|
||||
switch ( fOutputKind ) {
|
||||
case Options::kDynamicExecutable:
|
||||
106
pkgs/os-specific/darwin/cctools/port.nix
Normal file
106
pkgs/os-specific/darwin/cctools/port.nix
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, autoreconfHook
|
||||
, installShellFiles
|
||||
, libuuid
|
||||
, libobjc ? null, maloader ? null
|
||||
, enableTapiSupport ? true, libtapi
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
# The targetPrefix prepended to binary names to allow multiple binuntils on the
|
||||
# PATH to both be usable.
|
||||
targetPrefix = lib.optionalString
|
||||
(stdenv.targetPlatform != stdenv.hostPlatform)
|
||||
"${stdenv.targetPlatform.config}-";
|
||||
in
|
||||
|
||||
# Non-Darwin alternatives
|
||||
assert (!stdenv.hostPlatform.isDarwin) -> maloader != null;
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "${targetPrefix}cctools-port";
|
||||
version = "949.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "tpoechtrager";
|
||||
repo = "cctools-port";
|
||||
rev = "43f32a4c61b5ba7fde011e816136c550b1b3146f";
|
||||
sha256 = "10yc5smiczzm62q6ijqccc58bwmfhc897f3bwa5i9j98csqsjj0k";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" "man" ];
|
||||
|
||||
nativeBuildInputs = [ autoconf automake libtool autoreconfHook installShellFiles ];
|
||||
buildInputs = [ libuuid ]
|
||||
++ lib.optionals stdenv.isDarwin [ libobjc ]
|
||||
++ lib.optional enableTapiSupport libtapi;
|
||||
|
||||
patches = [ ./ld-ignore-rpath-link.patch ./ld-rpath-nonfinal.patch ];
|
||||
|
||||
__propagatedImpureHostDeps = [
|
||||
# As far as I can tell, otool from cctools is the only thing that depends on these two, and we should fix them
|
||||
"/usr/lib/libobjc.A.dylib"
|
||||
"/usr/lib/libobjc.dylib"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# TODO(@Ericson2314): Always pass "--target" and always targetPrefix.
|
||||
configurePlatforms = [ "build" "host" ]
|
||||
++ lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";
|
||||
configureFlags = [ "--disable-clang-as" ]
|
||||
++ lib.optionals enableTapiSupport [
|
||||
"--enable-tapi-support"
|
||||
"--with-libtapi=${libtapi}"
|
||||
];
|
||||
|
||||
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
substituteInPlace cctools/Makefile.am --replace libobjc2 ""
|
||||
'' + ''
|
||||
sed -i -e 's/addStandardLibraryDirectories = true/addStandardLibraryDirectories = false/' cctools/ld64/src/ld/Options.cpp
|
||||
|
||||
# FIXME: there are far more absolute path references that I don't want to fix right now
|
||||
substituteInPlace cctools/configure.ac \
|
||||
--replace "-isystem /usr/local/include -isystem /usr/pkg/include" "" \
|
||||
--replace "-L/usr/local/lib" "" \
|
||||
|
||||
substituteInPlace cctools/include/Makefile \
|
||||
--replace "/bin/" ""
|
||||
|
||||
patchShebangs tools
|
||||
sed -i -e 's/which/type -P/' tools/*.sh
|
||||
|
||||
# Workaround for https://www.sourceware.org/bugzilla/show_bug.cgi?id=11157
|
||||
cat > cctools/include/unistd.h <<EOF
|
||||
#ifdef __block
|
||||
# undef __block
|
||||
# include_next "unistd.h"
|
||||
# define __block __attribute__((__blocks__(byref)))
|
||||
#else
|
||||
# include_next "unistd.h"
|
||||
#endif
|
||||
EOF
|
||||
|
||||
cd cctools
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
pushd include
|
||||
make DSTROOT=$out/include RC_OS=common install
|
||||
popd
|
||||
|
||||
installManPage ar/ar.{1,5}
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit targetPrefix;
|
||||
};
|
||||
|
||||
meta = {
|
||||
broken = !stdenv.targetPlatform.isDarwin; # Only supports darwin targets
|
||||
homepage = "http://www.opensource.apple.com/source/cctools/";
|
||||
description = "MacOS Compiler Tools (cross-platform port)";
|
||||
license = lib.licenses.apsl20;
|
||||
maintainers = with lib.maintainers; [ matthewbauer ];
|
||||
};
|
||||
}
|
||||
51
pkgs/os-specific/darwin/darling/default.nix
Normal file
51
pkgs/os-specific/darwin/darling/default.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{stdenv, lib, fetchzip}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "darling";
|
||||
name = pname;
|
||||
|
||||
src = fetchzip {
|
||||
url = "https://github.com/darlinghq/darling/archive/d2cc5fa748003aaa70ad4180fff0a9a85dc65e9b.tar.gz";
|
||||
sha256 = "11b51fw47nl505h63bgx5kqiyhf3glhp1q6jkpb6nqfislnzzkrf";
|
||||
postFetch = ''
|
||||
# The archive contains both `src/opendirectory` and `src/OpenDirectory`,
|
||||
# pre-create the directory to choose the canonical case on
|
||||
# case-insensitive filesystems.
|
||||
mkdir -p $out/src/OpenDirectory
|
||||
|
||||
cd $out
|
||||
tar -xzf $downloadedFile --strip-components=1
|
||||
rm -r $out/src/libm
|
||||
|
||||
# If `src/opendirectory` and `src/OpenDirectory` refer to different
|
||||
# things, then combine them into `src/OpenDirectory` to match the result
|
||||
# on case-insensitive filesystems.
|
||||
if [ "$(stat -c %i src/opendirectory)" != "$(stat -c %i src/OpenDirectory)" ]; then
|
||||
mv src/opendirectory/* src/OpenDirectory/
|
||||
rmdir src/opendirectory
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
# only packaging sandbox for now
|
||||
buildPhase = ''
|
||||
cc -c src/sandbox/sandbox.c -o src/sandbox/sandbox.o
|
||||
cc -dynamiclib -flat_namespace src/sandbox/sandbox.o -o libsystem_sandbox.dylib
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib
|
||||
cp -rL src/sandbox/include/ $out/
|
||||
cp libsystem_sandbox.dylib $out/lib/
|
||||
|
||||
mkdir -p $out/include
|
||||
cp src/libaks/include/* $out/include
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
maintainers = with maintainers; [ matthewbauer ];
|
||||
license = licenses.gpl3;
|
||||
description = "Darwin/macOS emulation layer for Linux";
|
||||
platforms = platforms.darwin;
|
||||
};
|
||||
}
|
||||
18
pkgs/os-specific/darwin/darwin-stubs/default.nix
Normal file
18
pkgs/os-specific/darwin/darwin-stubs/default.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ stdenvNoCC, fetchurl }:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "darwin-stubs";
|
||||
version = "10.12";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/NixOS/darwin-stubs/releases/download/v20201216/10.12.tar.gz";
|
||||
sha256 = "1fyd3xig7brkzlzp0ql7vyfj5sp8iy56kgp548mvicqdyw92adgm";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
mv * $out
|
||||
'';
|
||||
}
|
||||
36
pkgs/os-specific/darwin/discrete-scroll/default.nix
Normal file
36
pkgs/os-specific/darwin/discrete-scroll/default.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ stdenv, lib, fetchFromGitHub, Cocoa }:
|
||||
|
||||
## after launching for the first time, grant access for parent application (e.g. Terminal.app)
|
||||
## from 'system preferences >> security & privacy >> accessibility'
|
||||
## and then launch again
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "discrete-scroll";
|
||||
version = "0.1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "emreyolcu";
|
||||
repo = "discrete-scroll";
|
||||
rev = "v${version}";
|
||||
sha256 = "0aqkp4kkwjlkll91xbqwf8asjww8ylsdgqvdk8d06bwdvg2cgvhg";
|
||||
};
|
||||
|
||||
buildInputs = [ Cocoa ];
|
||||
|
||||
buildPhase = ''
|
||||
cc -std=c99 -O3 -Wall -framework Cocoa -o dc DiscreteScroll/main.m
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp ./dc $out/bin/discretescroll
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Fix for OS X's scroll wheel problem";
|
||||
homepage = "https://github.com/emreyolcu/discrete-scroll";
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.mit;
|
||||
maintainers = with lib.maintainers; [ bb2020 ];
|
||||
};
|
||||
}
|
||||
37
pkgs/os-specific/darwin/dockutil/default.nix
Normal file
37
pkgs/os-specific/darwin/dockutil/default.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ lib, stdenv, fetchurl, libarchive, p7zip }:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dockutil";
|
||||
version = "3.0.2";
|
||||
|
||||
src = fetchurl {
|
||||
url =
|
||||
"https://github.com/kcrawford/dockutil/releases/download/${version}/dockutil-${version}.pkg";
|
||||
sha256 = "175137ea747e83ed221d60b18b712b256ed31531534cde84f679487d337668fd";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
nativeBuildInputs = [ libarchive p7zip ];
|
||||
|
||||
unpackPhase = ''
|
||||
7z x $src
|
||||
bsdtar -xf Payload~
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/usr/local/bin
|
||||
install -Dm755 usr/local/bin/dockutil -t $out/usr/local/bin
|
||||
ln -rs $out/usr/local/bin/dockutil $out/bin/dockutil
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Tool for managing dock items";
|
||||
homepage = "https://github.com/kcrawford/dockutil";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ tboerger ];
|
||||
platforms = platforms.darwin;
|
||||
};
|
||||
}
|
||||
37
pkgs/os-specific/darwin/duti/default.nix
Normal file
37
pkgs/os-specific/darwin/duti/default.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{stdenv, lib, fetchFromGitHub, autoreconfHook, ApplicationServices}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "duti";
|
||||
version = "1.5.5pre";
|
||||
src = fetchFromGitHub {
|
||||
owner = "moretension";
|
||||
repo = pname;
|
||||
rev = "fe3d3dc411bcea6af7a8cbe53c0e08ed5ecacdb2";
|
||||
sha256 = "1pg4i6ghpib2gy1sqpml7dbnhr1vbr43fs2pqkd09i4w3nmgpic9";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [autoreconfHook];
|
||||
buildInputs = [ApplicationServices];
|
||||
configureFlags = [
|
||||
"--with-macosx-sdk=/homeless-shelter"
|
||||
|
||||
# needed to prevent duti from trying to guess our sdk
|
||||
# NOTE: this is different than stdenv.hostPlatform.config!
|
||||
"--host=x86_64-apple-darwin18"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A command-line tool to select default applications for document types and URL schemes on Mac OS X";
|
||||
longDescription = ''
|
||||
duti is a command-line utility capable of setting default applications for
|
||||
various document types on Mac OS X, using Apple's Uniform Type Identifiers. A
|
||||
UTI is a unique string describing the format of a file's content. For instance,
|
||||
a Microsoft Word document has a UTI of com.microsoft.word.doc. Using duti, the
|
||||
user can change which application acts as the default handler for a given UTI.
|
||||
'';
|
||||
maintainers = with maintainers; [matthewbauer];
|
||||
platforms = platforms.darwin;
|
||||
license = licenses.publicDomain;
|
||||
homepage = "https://github.com/moretension/duti/";
|
||||
};
|
||||
}
|
||||
13
pkgs/os-specific/darwin/ghc-standalone-archive/default.nix
Normal file
13
pkgs/os-specific/darwin/ghc-standalone-archive/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ runCommand, cctools }:
|
||||
{ haskellPackages, src, deps ? p : [], name }: let
|
||||
inherit (haskellPackages) ghc ghcWithPackages;
|
||||
with-env = ghcWithPackages deps;
|
||||
ghcName = "${ghc.targetPrefix}ghc";
|
||||
in runCommand name { buildInputs = [ with-env cctools ]; } ''
|
||||
mkdir -p $out/lib
|
||||
mkdir -p $out/include
|
||||
${ghcName} ${src} -staticlib -outputdir . -o $out/lib/${name}.a -stubdir $out/include
|
||||
for file in ${ghc}/lib/${ghcName}-${ghc.version}/include/*; do
|
||||
ln -sv $file $out/include
|
||||
done
|
||||
''
|
||||
37
pkgs/os-specific/darwin/goku/default.nix
Normal file
37
pkgs/os-specific/darwin/goku/default.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, unzip
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "goku";
|
||||
version = "0.5.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/yqrashawn/GokuRakuJoudo/releases/download/v${version}/goku.zip";
|
||||
sha256 = "506eccdabedc68c112778b13ded65099327267c2e3fd488916e3a340bc312954";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
unzip
|
||||
];
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
installPhase = ''
|
||||
chmod +x goku
|
||||
chmod +x gokuw
|
||||
mkdir -p $out/bin
|
||||
cp goku $out/bin
|
||||
cp gokuw $out/bin
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Karabiner configurator";
|
||||
homepage = "https://github.com/yqrashawn/GokuRakuJoudo";
|
||||
license = licenses.gpl3;
|
||||
maintainers = [ maintainers.nikitavoloboev ];
|
||||
platforms = platforms.darwin;
|
||||
};
|
||||
}
|
||||
34
pkgs/os-specific/darwin/impure-cmds/default.nix
Normal file
34
pkgs/os-specific/darwin/impure-cmds/default.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ lib, runCommandLocal }:
|
||||
|
||||
# On darwin, there are some commands neither opensource nor able to build in nixpkgs.
|
||||
# We have no choice but to use those system-shipped impure ones.
|
||||
|
||||
let
|
||||
commands = {
|
||||
ditto = "/usr/bin/ditto"; # ditto is not opensource
|
||||
sudo = "/usr/bin/sudo"; # sudo must be owned by uid 0 and have the setuid bit set
|
||||
};
|
||||
|
||||
mkImpureDrv = name: path:
|
||||
runCommandLocal "${name}-impure-darwin" {
|
||||
__impureHostDeps = [ path ];
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.darwin;
|
||||
};
|
||||
} ''
|
||||
if ! [ -x ${path} ]; then
|
||||
echo Cannot find command ${path}
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p $out/bin
|
||||
ln -s ${path} $out/bin
|
||||
|
||||
manpage="/usr/share/man/man1/${name}.1"
|
||||
if [ -f $manpage ]; then
|
||||
mkdir -p $out/share/man/man1
|
||||
ln -s $manpage $out/share/man/man1
|
||||
fi
|
||||
'';
|
||||
in lib.mapAttrs mkImpureDrv commands
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue