darwin purity: nodejs-0.10

This commit is contained in:
Jude Taylor 2015-07-09 15:42:31 -07:00
parent 097ffe89cd
commit f72beea75e
4 changed files with 31 additions and 16 deletions

View file

@ -1,13 +1,11 @@
{ stdenv, fetchurl, openssl, python, zlib, v8, utillinux, http-parser, c-ares { stdenv, fetchurl, openssl, python, zlib, v8, utillinux, http-parser, c-ares
, pkgconfig, runCommand, which , pkgconfig, runCommand, which, libtool
# apple frameworks
, CoreServices, ApplicationServices, Carbon, Foundation
}: }:
let let
dtrace = runCommand "dtrace-native" {} ''
mkdir -p $out/bin
ln -sv /usr/sbin/dtrace $out/bin
'';
version = "0.10.38"; version = "0.10.38";
# !!! Should we also do shared libuv? # !!! Should we also do shared libuv?
@ -37,21 +35,23 @@ in stdenv.mkDerivation {
sha256 = "12xpa9jzry5g0j41908498qqs8v0q6miqkv6mggyzas8bvnshgai"; sha256 = "12xpa9jzry5g0j41908498qqs8v0q6miqkv6mggyzas8bvnshgai";
}; };
configureFlags = concatMap sharedConfigureFlags (builtins.attrNames deps); configureFlags = concatMap sharedConfigureFlags (builtins.attrNames deps) ++
stdenv.lib.optional stdenv.isDarwin "--without-dtrace";
prePatch = '' prePatch = ''
sed -e 's|^#!/usr/bin/env python$|#!${python}/bin/python|g' -i configure patchShebangs .
''; '';
patches = if stdenv.isDarwin then [ ./no-xcode.patch ] else null; patches = stdenv.lib.optional stdenv.isDarwin ./no-xcode.patch;
postPatch = if stdenv.isDarwin then '' postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
(cd tools/gyp; patch -Np1 -i ${../../python-modules/gyp/no-darwin-cflags.patch}) (cd tools/gyp; patch -Np1 -i ${../../python-modules/gyp/no-darwin-cflags.patch})
'' else null; '';
buildInputs = [ python which ] buildInputs = [ python which ]
++ (optional stdenv.isLinux utillinux) ++ (optional stdenv.isLinux utillinux)
++ optionals stdenv.isDarwin [ pkgconfig openssl dtrace ]; ++ optionals stdenv.isDarwin [ pkgconfig openssl libtool CoreServices ApplicationServices Foundation ];
propagatedBuildInputs = optionals stdenv.isDarwin [ Carbon ];
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
passthru.interpreterName = "nodejs-0.10"; passthru.interpreterName = "nodejs-0.10";

View file

@ -108,7 +108,8 @@ with frameworks; with libs; {
# Umbrellas # Umbrellas
Accelerate = [ CoreWLAN IOBluetooth ]; Accelerate = [ CoreWLAN IOBluetooth ];
ApplicationServices = [ CoreFoundation CoreServices CoreText ImageIO ]; ApplicationServices = [ CoreFoundation CoreServices CoreText ImageIO ];
Carbon = [ ApplicationServices CoreFoundation CoreServices IOKit Security ]; Carbon = [ ApplicationServices CoreFoundation CoreServices IOKit Security QuartzCore ];
CoreBluetooth = [];
CoreServices = [ CFNetwork CoreAudio CoreData CoreFoundation DiskArbitration Security NetFS OpenDirectory ServiceManagement ]; CoreServices = [ CFNetwork CoreAudio CoreData CoreFoundation DiskArbitration Security NetFS OpenDirectory ServiceManagement ];
IOBluetooth = [ IOKit ]; IOBluetooth = [ IOKit ];
JavaVM = []; JavaVM = [];

View file

@ -54,6 +54,7 @@ rec {
]; ];
QuartzCore = [ QuartzCore = [
"/System/Library/Frameworks/QuartzCore.framework" "/System/Library/Frameworks/QuartzCore.framework"
"/System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport"
]; ];
PCSC = [ PCSC = [
"/System/Library/Frameworks/PCSC.framework" "/System/Library/Frameworks/PCSC.framework"
@ -131,6 +132,14 @@ rec {
]; ];
Carbon = [ Carbon = [
"/System/Library/Frameworks/Carbon.framework" "/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/Ubiquity.framework/Versions/A/Ubiquity"
"/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 = [ CoreAudio = [
"/System/Library/Frameworks/CoreAudio.framework" "/System/Library/Frameworks/CoreAudio.framework"
@ -169,7 +178,9 @@ rec {
]; ];
IOBluetooth = [ IOBluetooth = [
"/System/Library/Frameworks/IOBluetooth.framework" "/System/Library/Frameworks/IOBluetooth.framework"
"/System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth" ] ++ AudioUnit ++ CoreBluetooth;
CoreBluetooth = [
"/System/Library/Frameworks/CoreBluetooth.framework"
]; ];
SecurityFoundation = [ SecurityFoundation = [
"/System/Library/Frameworks/SecurityFoundation.framework" "/System/Library/Frameworks/SecurityFoundation.framework"

View file

@ -2007,9 +2007,12 @@ let
libtool = darwin.cctools; libtool = darwin.cctools;
}; };
nodejs-unstable = callPackage ../development/web/nodejs { libuv = libuvVersions.v1_2_0; unstableVersion = true; }; nodejs-unstable = callPackage ../development/web/nodejs { libuv = libuvVersions.v1_2_0; unstableVersion = true; };
nodejs-0_10 = callPackage ../development/web/nodejs/v0_10.nix { }; nodejs-0_10 = callPackage ../development/web/nodejs/v0_10.nix {
libtool = darwin.cctools;
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices Carbon Foundation;
};
nodejs = if stdenv.system == "armv5tel-linux" then nodejs = if stdenv.system == "armv5tel-linux" || stdenv.isDarwin then
nodejs-0_10 nodejs-0_10
else else
nodejs-0_12; nodejs-0_12;