[89728] trunk/dports/devel/nodejs-devel

ciserlohn at macports.org ciserlohn at macports.org
Wed Feb 8 02:28:48 PST 2012


Revision: 89728
          http://trac.macports.org/changeset/89728
Author:   ciserlohn at macports.org
Date:     2012-02-08 02:28:46 -0800 (Wed, 08 Feb 2012)
Log Message:
-----------
nodejs-devel: update to version 0.7.3

* add custom destroot phase as the new build system does not respect DESTDIR
* patch harcoded build arch
* add python variants (affects gyp and waf)
* remove Makefile patch included upstream
* prevent installation on Mac OS X < 10.5
* fix livecheck

Modified Paths:
--------------
    trunk/dports/devel/nodejs-devel/Portfile

Added Paths:
-----------
    trunk/dports/devel/nodejs-devel/files/patch-tools-gyp-pylib-gyp-generator-make.py-BUILD_ARCH.diff

Removed Paths:
-------------
    trunk/dports/devel/nodejs-devel/files/patch-Makefile-python.diff

Modified: trunk/dports/devel/nodejs-devel/Portfile
===================================================================
--- trunk/dports/devel/nodejs-devel/Portfile	2012-02-08 10:19:31 UTC (rev 89727)
+++ trunk/dports/devel/nodejs-devel/Portfile	2012-02-08 10:28:46 UTC (rev 89728)
@@ -4,9 +4,10 @@
 PortSystem              1.0
 
 name                    nodejs-devel
-version                 0.5.10
+version                 0.7.3
 categories              devel net
 platforms               darwin
+license                 {MIT BSD}
 maintainers             ciserlohn
 
 description             Evented I/O for V8 JavaScript
@@ -19,17 +20,13 @@
 conflicts               nodejs
 
 homepage                http://nodejs.org/
-master_sites            ${homepage}dist/v${version}/
+master_sites            ${homepage}dist/v${version}
 
-checksums               rmd160  a0bcf79343556f36186971459dd2bafccb4527d8 \
-                        sha256  56396854f85a0d2fafc038436be3d84041f991f59613761e61295fc02d662a40
+checksums               rmd160  d740e822c03c0b3f582204f2117894b80b8735bb \
+                        sha256  292204f73b4007fecf7aa9d065a0360abc43a1fc007ea1138cf4fa8d553cca58
 
 distname                node-v${version}
 
-depends_lib             port:python27
-
-patchfiles              patch-Makefile-python.diff
-
 proc rec_glob {basedir pattern} {
     set files [glob -directory $basedir -nocomplain -type f $pattern]
     foreach dir [glob -directory $basedir -nocomplain -type d *] {
@@ -38,31 +35,46 @@
     return $files
 }
 
-set py27_bin ${prefix}/bin/python2.7
+configure.python ${prefix}/bin/python2.7
 
+patchfiles               patch-tools-gyp-pylib-gyp-generator-make.py-BUILD_ARCH.diff
+
 post-patch {
-    foreach f [concat ${worksrcpath}/tools/node-waf ${worksrcpath}/tools/waf-light \
-               ${worksrcpath}/tools/gyp_node ${worksrcpath}/tools/gyp/gyp \
-               ${worksrcpath}/wscript ${worksrcpath}/configure-gyp \
-               ${worksrcpath}/deps/uv/gyp_uv [rec_glob ${worksrcpath} *.py]] {
-        reinplace "s|/usr/bin/env python|${py27_bin}|" ${f}
+    foreach f [concat ${worksrcpath}/configure \
+                   ${worksrcpath}/tools/node-waf \
+                   ${worksrcpath}/tools/waf-light \
+                   ${worksrcpath}/tools/gyp/gyp \
+                   ${worksrcpath}/tools/gyp_addon \
+                   ${worksrcpath}/tools/gyp_node \
+                   ${worksrcpath}/deps/uv/gyp_uv \
+                   [rec_glob ${worksrcpath} *.py]] {
+        reinplace "s|/usr/bin/env python|${configure.python}|" ${f}
     }
+    reinplace "s|__MP_BUILD_ARCH__|${build_arch}|g" ${worksrcpath}/tools/gyp/pylib/gyp/generator/make.py
 }
 
-# see tickets #28066, #28562 and #29927
-pre-configure {
-    foreach {badport badfile} "libev ${prefix}/include/ev.h c-ares ${prefix}/include/ares.h libpftputil ${prefix}/include/util.h" {
-        if {[file exists ${badfile}]} {
-            ui_error "${name} cannot be built while ${badport} is active."
-            ui_error "Please deactivate ${badport} and try again."
-            ui_error "You can reactivate ${badport} again later."
-            return -code error "${badport} is installed"
-        }
-    }
+configure.args          --without-ssl
+configure.args-append   --without-npm
+
+variant python25 conflicts python26 python27 description {Use python 2.5} {
+    depends_lib         port:python25
+    configure.python    ${prefix}/bin/python2.5
 }
 
-configure.args          --without-ssl
+variant python26 conflicts python25 python27 description {Use python 2.6} {
+    depends_lib         port:python26
+    configure.python    ${prefix}/bin/python2.6
+}
 
+variant python27 conflicts python25 python26 description {Use python 2.7} {
+    depends_lib         port:python27
+    configure.python    ${prefix}/bin/python2.7
+}
+
+if {![variant_isset python25] && ![variant_isset python26]} {
+    default_variants +python27
+}
+
 variant ssl description {Add secure socket layer support} {
     depends_build-append    port:pkgconfig
     depends_lib-append      port:openssl
@@ -83,16 +95,73 @@
 
 use_parallel_build      no
 
+switch $build_arch {
+    i386 {
+        configure.args-append   --dest-cpu=ia32
+    }
+    x86_64 {
+        configure.args-append   --dest-cpu=x64
+    }
+}
+
 build.args-append   CC=${configure.cc} \
                     CXX=${configure.cxx} \
-                    CFLAGS="${configure.cflags} ${configure.cc_archflags}" \
-                    LDFLAGS="${configure.ldflags} ${configure.ld_archflags}" \
-                    PYTHON=${py27_bin}
+                    CPP=${configure.cpp} \
+                    CFLAGS=${configure.cflags} \
+                    LDFLAGS=${configure.ldflags} \
+                    PYTHON=${configure.python}
 
-post-destroot {
+destroot {
+    set bindir ${destroot}${prefix}/bin
+    set libdir ${destroot}${prefix}/lib/node
+    set incdir ${destroot}${prefix}/include/node
+    set incpdir ${destroot}${prefix}/include/node/uv-private
     set docdir ${destroot}${prefix}/share/doc/${name}
+
+    xinstall -d ${bindir}
+    xinstall -d ${libdir}
+    xinstall -d ${incdir}
+    xinstall -d ${incpdir}
     xinstall -d ${docdir}
+
+# install binaries
+    xinstall -m 755 -W ${worksrcpath} \
+        out/Release/node \
+        tools/node-waf \
+        ${bindir}
+
+# install headers
     xinstall -m 644 -W ${worksrcpath} \
+        src/node.h \
+        src/node_buffer.h \
+        src/node_object_wrap.h \
+        src/node_version.h \
+        deps/v8/include/v8-debug.h \
+        deps/v8/include/v8-preparser.h \
+        deps/v8/include/v8-profiler.h \
+        deps/v8/include/v8-testing.h \
+        deps/v8/include/v8.h \
+        deps/v8/include/v8stdint.h \
+        deps/uv/include/uv.h \
+        deps/uv/include/ares.h \
+        deps/uv/include/ares_version.h \
+        ${incdir}
+
+# install privat uv headers
+    xinstall -m 644 -W ${worksrcpath} \
+        deps/uv/include/uv-private/eio.h \
+        deps/uv/include/uv-private/ev.h \
+        deps/uv/include/uv-private/ngx-queue.h \
+        deps/uv/include/uv-private/tree.h \
+        deps/uv/include/uv-private/uv-unix.h \
+        deps/uv/include/uv-private/uv-win.h \
+        ${incpdir}
+
+# install the wafadmin tool
+    eval xinstall -m 644 [rec_glob ${worksrcpath}/tools/wafadmin *.py] ${libdir}
+
+# install docs
+    xinstall -m 644 -W ${worksrcpath} \
         AUTHORS \
         ChangeLog \
         LICENSE \
@@ -100,5 +169,13 @@
         ${docdir}
 }
 
+if {${os.major} < 9} {
+    pre-fetch {
+        ui_error "${name} ${version} requires Mac OS X 10.5 or greater."
+        return -code error "incompatible Mac OS X version"
+    }
+}
+
+livecheck.url       ${homepage}dist/
 livecheck.type      regex
-livecheck.regex     node-v(\\d+\\.\[13579\]+\\.\\d+)
+livecheck.regex     v(\\d+\\.\[13579\]+\\.\\d+)

Deleted: trunk/dports/devel/nodejs-devel/files/patch-Makefile-python.diff
===================================================================
--- trunk/dports/devel/nodejs-devel/files/patch-Makefile-python.diff	2012-02-08 10:19:31 UTC (rev 89727)
+++ trunk/dports/devel/nodejs-devel/files/patch-Makefile-python.diff	2012-02-08 10:28:46 UTC (rev 89728)
@@ -1,87 +0,0 @@
---- Makefile.orig	2011-08-27 10:03:17.000000000 +0200
-+++ Makefile	2011-08-27 10:06:03.000000000 +0200
-@@ -1,4 +1,4 @@
--WAF=python tools/waf-light
-+WAF=$(PYTHON) tools/waf-light
- 
- web_root = node at nodejs.org:~/web/nodejs.org/
- 
-@@ -33,40 +33,40 @@
- 	@$(WAF) uninstall
- 
- test: all
--	python tools/test.py --mode=release simple message
-+	$(PYTHON) tools/test.py --mode=release simple message
- 
- test-http1: all
--	python tools/test.py --mode=release --use-http1 simple message
-+	$(PYTHON) tools/test.py --mode=release --use-http1 simple message
- 
- test-valgrind: all
--	python tools/test.py --mode=release --valgrind simple message
-+	$(PYTHON) tools/test.py --mode=release --valgrind simple message
- 
- test-all: all
--	python tools/test.py --mode=debug,release
-+	$(PYTHON) tools/test.py --mode=debug,release
- 
- test-all-http1: all
--	python tools/test.py --mode=debug,release --use-http1
-+	$(PYTHON) tools/test.py --mode=debug,release --use-http1
- 
- test-all-valgrind: all
--	python tools/test.py --mode=debug,release --valgrind
-+	$(PYTHON) tools/test.py --mode=debug,release --valgrind
- 
- test-release: all
--	python tools/test.py --mode=release
-+	$(PYTHON) tools/test.py --mode=release
- 
- test-debug: all
--	python tools/test.py --mode=debug
-+	$(PYTHON) tools/test.py --mode=debug
- 
- test-message: all
--	python tools/test.py message
-+	$(PYTHON) tools/test.py message
- 
- test-simple: all
--	python tools/test.py simple
-+	$(PYTHON) tools/test.py simple
- 
- test-pummel: all
--	python tools/test.py pummel
-+	$(PYTHON) tools/test.py pummel
- 
- test-internet: all
--	python tools/test.py internet
-+	$(PYTHON) tools/test.py internet
- 
- UVTEST += simple/test-assert
- UVTEST += simple/test-buffer
-@@ -261,10 +261,10 @@
- 
- 
- test-uv: all
--	NODE_USE_UV=1 python tools/test.py --libuv simple
-+	NODE_USE_UV=1 $(PYTHON) tools/test.py --libuv simple
- 
- test-uv-debug: all
--	NODE_USE_UV=1 python tools/test.py --mode=debug simple
-+	NODE_USE_UV=1 $(PYTHON) tools/test.py --mode=debug simple
- 
- 
- out/Release/node: all
-@@ -348,10 +348,10 @@
- 	./node benchmark/idle_clients.js &
- 
- jslint:
--	PYTHONPATH=tools/closure_linter/ python tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ -r test/
-+	PYTHONPATH=tools/closure_linter/ $(PYTHON) tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ -r test/
- 
- cpplint:
--	@python tools/cpplint.py $(wildcard src/*.cc src/*.h src/*.c)
-+	@$(PYTHON) tools/cpplint.py $(wildcard src/*.cc src/*.h src/*.c)
- 
- lint: jslint cpplint
- 

Added: trunk/dports/devel/nodejs-devel/files/patch-tools-gyp-pylib-gyp-generator-make.py-BUILD_ARCH.diff
===================================================================
--- trunk/dports/devel/nodejs-devel/files/patch-tools-gyp-pylib-gyp-generator-make.py-BUILD_ARCH.diff	                        (rev 0)
+++ trunk/dports/devel/nodejs-devel/files/patch-tools-gyp-pylib-gyp-generator-make.py-BUILD_ARCH.diff	2012-02-08 10:28:46 UTC (rev 89728)
@@ -0,0 +1,20 @@
+--- tools/gyp/pylib/gyp/generator/make.py.orig	2012-02-08 09:48:57.000000000 +0100
++++ tools/gyp/pylib/gyp/generator/make.py	2012-02-08 09:50:21.000000000 +0100
+@@ -893,7 +893,7 @@
+     self._WarnUnimplemented('PRODUCT_TYPE')
+ 
+     # TODO: Do not hardcode arch. Supporting fat binaries will be annoying.
+-    cflags.append('-arch i386')
++    cflags.append('-arch __MP_BUILD_ARCH__')
+ 
+     cflags += self._Settings().get('OTHER_CFLAGS', [])
+     cflags += self._Settings().get('WARNING_CFLAGS', [])
+@@ -987,7 +987,7 @@
+                      '-Wl,' + target.Absolutify(self._Settings()['ORDER_FILE']))
+ 
+     # TODO: Do not hardcode arch. Supporting fat binaries will be annoying.
+-    ldflags.append('-arch i386')
++    ldflags.append('-arch __MP_BUILD_ARCH__')
+ 
+     # Xcode adds the product directory by default.
+     ldflags.append('-L' + generator_default_variables['PRODUCT_DIR'])
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120208/5bc38e23/attachment-0001.html>


More information about the macports-changes mailing list