1 | | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
2 | | # $Id$ |
3 | | |
4 | | PortSystem 1.0 |
5 | | PortGroup compiler_blacklist_versions 1.0 |
6 | | |
7 | | name nodejs-devel |
8 | | version 0.11.16 |
9 | | categories devel net |
10 | | platforms darwin |
11 | | license {MIT BSD} |
12 | | maintainers ciserlohn |
13 | | |
14 | | description Evented I/O for V8 JavaScript |
15 | | |
16 | | long_description Node's goal is to provide an easy way to build scalable network programs in JavaScript. \ |
17 | | Node is similar in design to and influenced by systems like Ruby's Event \ |
18 | | Machine or Python's Twisted. Node takes the event model a bit further-it \ |
19 | | presents the event loop as a language construct instead of as a library. |
20 | | |
21 | | conflicts nodejs iojs |
22 | | |
23 | | homepage http://nodejs.org/ |
24 | | master_sites ${homepage}dist/v${version} |
25 | | |
26 | | checksums rmd160 7c082b86478fdfcb3ed1a49bea15508f81f6e7ea \ |
27 | | sha256 f0d141faa1f7da3aff53e9615d76040d29c0650542be3b09ee80aca2f2cc61f6 |
28 | | |
29 | | distname node-v${version} |
30 | | |
31 | | proc rec_glob {basedir pattern} { |
32 | | set files [glob -directory $basedir -nocomplain -type f $pattern] |
33 | | foreach dir [glob -directory $basedir -nocomplain -type d *] { |
34 | | eval lappend files [rec_glob $dir $pattern] |
35 | | } |
36 | | return $files |
37 | | } |
38 | | |
39 | | configure.python ${prefix}/bin/python2.7 |
40 | | |
41 | | post-patch { |
42 | | foreach f [concat ${worksrcpath}/configure \ |
43 | | ${worksrcpath}/tools/gyp/gyp \ |
44 | | ${worksrcpath}/deps/cares/gyp_cares \ |
45 | | ${worksrcpath}/deps/v8/build/gyp_v8 \ |
46 | | ${worksrcpath}/deps/v8/tools/mingw-generate-makefiles.sh \ |
47 | | [rec_glob ${worksrcpath} *.py]] { |
48 | | reinplace "s|/usr/bin/env python|${configure.python}|" ${f} |
49 | | } |
50 | | foreach gypfile [rec_glob ${worksrcpath} *.gyp] { |
51 | | reinplace "s|'python'|'${configure.python}'|" ${gypfile} |
52 | | } |
53 | | reinplace "s|/usr/bin/env node|${prefix}/bin/node|" ${worksrcpath}/tools/doc/node_modules/marked/bin/marked |
54 | | } |
55 | | |
56 | | configure.args --without-ssl |
57 | | configure.args-append --without-npm |
58 | | |
59 | | # TODO: Remove after 2015-12-27. |
60 | | variant python25 requires python27 description {Legacy variant} {} |
61 | | |
62 | | variant python26 conflicts python27 description {Use python 2.6} { |
63 | | depends_lib-append port:python26 |
64 | | configure.python ${prefix}/bin/python2.6 |
65 | | } |
66 | | |
67 | | variant python27 conflicts python26 description {Use python 2.7} { |
68 | | depends_lib-append port:python27 |
69 | | configure.python ${prefix}/bin/python2.7 |
70 | | } |
71 | | |
72 | | if {![variant_isset python25] && ![variant_isset python26]} { |
73 | | default_variants +python27 |
74 | | } |
75 | | |
76 | | variant ssl description {Add secure socket layer support} { |
77 | | depends_build-append port:pkgconfig |
78 | | depends_lib-append path:lib/libssl.dylib:openssl |
79 | | configure.args-delete --without-ssl |
80 | | configure.args-append --shared-openssl |
81 | | configure.args-append --shared-openssl-includes=${prefix}/include/openssl |
82 | | configure.args-append --shared-openssl-libpath=${prefix}/lib |
83 | | } |
84 | | |
85 | | variant dtrace description {Add dtrace support} { |
86 | | configure.args-append --with-dtrace |
87 | | } |
88 | | |
89 | | default_variants +ssl |
90 | | |
91 | | # V8 only supports ARM and IA-32 processors |
92 | | supported_archs i386 x86_64 |
93 | | |
94 | | universal_variant no |
95 | | |
96 | | patchfiles-append patch-common.gypi.diff |
97 | | |
98 | | # "V8 doesn't like cache." |
99 | | configure.ccache no |
100 | | |
101 | | test.run yes |
102 | | |
103 | | use_parallel_build no |
104 | | |
105 | | switch $build_arch { |
106 | | i386 { |
107 | | configure.args-append --dest-cpu=ia32 |
108 | | } |
109 | | x86_64 { |
110 | | configure.args-append --dest-cpu=x64 |
111 | | } |
112 | | } |
113 | | |
114 | | build.args-append CC=${configure.cc} \ |
115 | | CXX=${configure.cxx} \ |
116 | | CPP=${configure.cpp} \ |
117 | | CFLAGS="${configure.cflags}" \ |
118 | | CXXFLAGS="${configure.cxxflags}" \ |
119 | | LDFLAGS="${configure.ldflags}" \ |
120 | | PYTHON=${configure.python} \ |
121 | | V=1 |
122 | | |
123 | | destroot { |
124 | | set bindir ${destroot}${prefix}/bin |
125 | | set libdir ${destroot}${prefix}/lib |
126 | | set libndir ${libdir}/node |
127 | | set libddir ${libdir}/dtrace |
128 | | set incdir ${destroot}${prefix}/include/node |
129 | | set docdir ${destroot}${prefix}/share/doc/${name} |
130 | | |
131 | | xinstall -d ${bindir} |
132 | | xinstall -d ${libdir} |
133 | | xinstall -d ${libndir} |
134 | | xinstall -d ${libddir} |
135 | | xinstall -d ${incdir} |
136 | | xinstall -d ${docdir} |
137 | | |
138 | | # install binaries |
139 | | xinstall -m 755 -W ${worksrcpath} \ |
140 | | out/Release/node \ |
141 | | ${bindir} |
142 | | |
143 | | # install headers |
144 | | xinstall -m 644 -W ${worksrcpath} \ |
145 | | src/node.h \ |
146 | | src/node_buffer.h \ |
147 | | src/node_object_wrap.h \ |
148 | | src/node_version.h \ |
149 | | deps/v8/include/v8-debug.h \ |
150 | | deps/v8/include/v8-profiler.h \ |
151 | | deps/v8/include/v8-testing.h \ |
152 | | deps/v8/include/v8.h \ |
153 | | deps/v8/include/v8config.h \ |
154 | | deps/v8/include/v8stdint.h \ |
155 | | deps/uv/include/uv.h \ |
156 | | deps/uv/include/uv-unix.h \ |
157 | | deps/uv/include/uv-errno.h \ |
158 | | deps/uv/include/uv-darwin.h \ |
159 | | deps/uv/include/tree.h \ |
160 | | deps/uv/include/pthread-fixes.h \ |
161 | | deps/cares/include/ares.h \ |
162 | | deps/cares/include/ares_version.h \ |
163 | | ${incdir} |
164 | | |
165 | | # install dtrace script |
166 | | xinstall -m 644 -W ${worksrcpath} \ |
167 | | src/node.d \ |
168 | | ${libddir} |
169 | | |
170 | | # install manpage |
171 | | xinstall -m 644 -W ${worksrcpath} \ |
172 | | doc/node.1 \ |
173 | | ${destroot}${prefix}/share/man/man1 |
174 | | |
175 | | # install docs |
176 | | xinstall -m 644 -W ${worksrcpath} \ |
177 | | AUTHORS \ |
178 | | ChangeLog \ |
179 | | LICENSE \ |
180 | | README.md \ |
181 | | ${docdir} |
182 | | } |
183 | | |
184 | | compiler.blacklist *gcc* *clang-2.* {clang < 300} |
185 | | |
186 | | if {${os.major} < 10} { |
187 | | pre-fetch { |
188 | | ui_error "${name} ${version} requires Mac OS X 10.6 or greater." |
189 | | return -code error "incompatible Mac OS X version" |
190 | | } |
191 | | } |
192 | | |
193 | | livecheck.url ${homepage}dist/ |
194 | | livecheck.type regex |
195 | | livecheck.regex {v(\d+\.\d*[13579]\.\d+)} |