3
0
Fork 0
forked from mirrors/nixpkgs

node.js: Get building on darwin

svn path=/nixpkgs/trunk/; revision=32563
This commit is contained in:
Shea Levy 2012-02-25 19:36:24 +00:00
parent 9e7a5c5157
commit 385f242a40
2 changed files with 30 additions and 3 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, openssl, python, zlib, v8 }:
{ stdenv, fetchurl, openssl, python, zlib, v8, darwinInstallNameToolUtility }:
stdenv.mkDerivation rec {
version = "0.6.10";
@ -17,11 +17,17 @@ stdenv.mkDerivation rec {
"--shared-v8-libpath=${v8}/lib"
];
patchPhase = ''
patches = stdenv.lib.optional stdenv.isDarwin ./no-arch-flag.patch;
prePatch = ''
sed -e 's|^#!/usr/bin/env python$|#!${python}/bin/python|g' -i tools/{*.py,waf-light,node-waf}
'';
buildInputs = [ python openssl v8 zlib];
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
install_name_tool -change libv8.dylib ${v8}/lib/libv8.dylib $out/bin/node
'';
buildInputs = [ python openssl v8 zlib ] ++ stdenv.lib.optional stdenv.isDarwin darwinInstallNameToolUtility;
meta = with stdenv.lib; {
description = "Event-driven I/O framework for the V8 JavaScript engine";

View file

@ -0,0 +1,21 @@
diff -Naur node-v0.6.10-orig/wscript node-v0.6.10/wscript
--- node-v0.6.10-orig/wscript 2012-02-02 19:56:42.000000000 -0500
+++ node-v0.6.10/wscript 2012-02-25 14:18:50.000000000 -0500
@@ -443,17 +443,6 @@
if sys.platform.startswith("darwin"):
# used by platform_darwin_*.cc
conf.env.append_value('LINKFLAGS', ['-framework','Carbon'])
- # cross compile for architecture specified by DEST_CPU
- if 'DEST_CPU' in conf.env:
- arch = conf.env['DEST_CPU']
- # map supported_archs to GCC names:
- arch_mappings = {'ia32': 'i386', 'x64': 'x86_64'}
- if arch in arch_mappings:
- arch = arch_mappings[arch]
- flags = ['-arch', arch]
- conf.env.append_value('CCFLAGS', flags)
- conf.env.append_value('CXXFLAGS', flags)
- conf.env.append_value('LINKFLAGS', flags)
if 'DEST_CPU' in conf.env:
arch = conf.env['DEST_CPU']
# TODO: -m32 is only available on 64 bit machines, so check host type