12 | | maintainers ciserlohn |
13 | | |
14 | | description JavaScript I/O |
15 | | |
16 | | long_description io.js is a JavaScript platform built on Chrome's V8 runtime. \ |
17 | | This project began as a fork of Joyent's Node.js™ and is \ |
18 | | compatible with the npm ecosystem. |
19 | | |
20 | | conflicts nodejs nodejs-devel |
21 | | |
22 | | homepage https://iojs.org/ |
23 | | master_sites ${homepage}dist/v${version} |
24 | | |
25 | | checksums rmd160 6564642581abcc97fabd8e8736e2349306440f27 \ |
26 | | sha256 b1ce0bb2ddb5d012bd9f22c787a4c74ce5d1546553086e40785be91489fee1d1 |
27 | | |
28 | | distname iojs-v${version} |
29 | | |
30 | | depends_build port:pkgconfig |
31 | | |
32 | | depends_lib port:icu \ |
33 | | port:python27 \ |
34 | | path:lib/libssl.dylib:openssl |
35 | | |
36 | | configure.python ${prefix}/bin/python2.7 |
37 | | |
38 | | configure.args-append --without-npm |
39 | | configure.args-append --shared-openssl |
40 | | configure.args-append --shared-openssl-includes=${prefix}/include/openssl |
41 | | configure.args-append --shared-openssl-libpath=${prefix}/lib |
42 | | configure.args-append --with-intl=system-icu |
43 | | |
44 | | proc rec_glob {basedir pattern} { |
45 | | set files [glob -directory $basedir -nocomplain -type f $pattern] |
46 | | foreach dir [glob -directory $basedir -nocomplain -type d *] { |
47 | | eval lappend files [rec_glob $dir $pattern] |
48 | | } |
49 | | return $files |
50 | | } |
51 | | |
52 | | |
53 | | post-patch { |
54 | | foreach f [concat ${worksrcpath}/configure \ |
55 | | ${worksrcpath}/tools/gyp/gyp \ |
56 | | ${worksrcpath}/node.gyp \ |
57 | | ${worksrcpath}/deps/cares/gyp_cares \ |
58 | | ${worksrcpath}/deps/npm/node_modules/node-gyp/gyp/gyp \ |
59 | | [rec_glob ${worksrcpath} *.py]] { |
60 | | reinplace -locale C "s|/usr/bin/env python|${configure.python}|" ${f} |
61 | | } |
62 | | foreach f [concat ${worksrcpath}/deps/npm/scripts/relocate.sh \ |
63 | | ${worksrcpath}/deps/npm/node_modules/semver/bin/semver \ |
64 | | ${worksrcpath}/deps/npm/node_modules/which/bin/which \ |
65 | | ${worksrcpath}/deps/npm/test/packages/npm-test-array-bin/bin/array-bin \ |
66 | | ${worksrcpath}/deps/npm/test/packages/npm-test-dir-bin/bin/dir-bin \ |
67 | | ${worksrcpath}/tools/doc/node_modules/marked/bin/marked \ |
68 | | [rec_glob ${worksrcpath} *.js]] { |
69 | | reinplace -locale C "s|/usr/bin/env node|${prefix}/bin/node|" ${f} |
70 | | } |
71 | | foreach gypfile [rec_glob ${worksrcpath} *.gyp] { |
72 | | reinplace -locale C "s|'python'|'${configure.python}'|" ${gypfile} |
73 | | } |
74 | | } |
75 | | |
76 | | # V8 only supports ARM and IA-32 processors |
77 | | supported_archs i386 x86_64 |
78 | | |
79 | | universal_variant no |
80 | | |
81 | | patchfiles-append patch-common.gypi.diff |
82 | | |
83 | | # "V8 doesn't like cache." |
84 | | configure.ccache no |
85 | | |
86 | | test.run yes |
87 | | |
88 | | use_parallel_build no |
89 | | |
90 | | switch $build_arch { |
91 | | i386 { |
92 | | configure.args-append --dest-cpu=ia32 |
93 | | } |
94 | | x86_64 { |
95 | | configure.args-append --dest-cpu=x64 |
96 | | } |
97 | | } |
98 | | |
99 | | build.args-append CC=${configure.cc} \ |
100 | | CXX=${configure.cxx} \ |
101 | | CXX.host=${configure.cxx} \ |
102 | | CPP=${configure.cpp} \ |
103 | | CFLAGS="${configure.cflags}" \ |
104 | | CXXFLAGS="${configure.cxxflags}" \ |
105 | | LDFLAGS="${configure.ldflags}" \ |
106 | | PYTHON=${configure.python} \ |
107 | | V=1 |
108 | | |
109 | | destroot { |
110 | | set bindir ${destroot}${prefix}/bin |
111 | | set libdir ${destroot}${prefix}/lib |
112 | | set libndir ${libdir}/${name} |
113 | | set libddir ${libdir}/dtrace |
114 | | set incdir ${destroot}${prefix}/include/${name} |
115 | | set docdir ${destroot}${prefix}/share/doc/${name} |
116 | | |
117 | | xinstall -d ${bindir} |
118 | | xinstall -d ${libdir} |
119 | | xinstall -d ${libndir} |
120 | | xinstall -d ${libddir} |
121 | | xinstall -d ${incdir} |
122 | | xinstall -d ${docdir} |
123 | | |
124 | | # install binaries |
125 | | xinstall -m 755 -W ${worksrcpath} \ |
126 | | out/Release/${name} \ |
127 | | ${bindir} |
128 | | |
129 | | ln -s ${name} ${bindir}/node |
130 | | |
131 | | # install headers |
132 | | xinstall -m 644 -W ${worksrcpath} \ |
133 | | src/async-wrap-inl.h \ |
134 | | src/async-wrap.h \ |
135 | | src/base-object-inl.h \ |
136 | | src/base-object.h \ |
137 | | src/debug-agent.h \ |
138 | | src/env-inl.h \ |
139 | | src/env.h \ |
140 | | src/handle_wrap.h \ |
141 | | src/node.h \ |
142 | | src/node_buffer.h \ |
143 | | src/node_constants.h \ |
144 | | src/node_counters.h \ |
145 | | src/node_crypto.h \ |
146 | | src/node_crypto_bio.h \ |
147 | | src/node_crypto_clienthello-inl.h \ |
148 | | src/node_crypto_clienthello.h \ |
149 | | src/node_crypto_groups.h \ |
150 | | src/node_dtrace.h \ |
151 | | src/node_file.h \ |
152 | | src/node_http_parser.h \ |
153 | | src/node_i18n.h \ |
154 | | src/node_internals.h \ |
155 | | src/node_javascript.h \ |
156 | | src/node_object_wrap.h \ |
157 | | src/node_root_certs.h \ |
158 | | src/node_stat_watcher.h \ |
159 | | src/node_version.h \ |
160 | | src/node_watchdog.h \ |
161 | | src/node_wrap.h \ |
162 | | src/pipe_wrap.h \ |
163 | | src/spawn_sync.h \ |
164 | | src/stream_wrap.h \ |
165 | | src/string_bytes.h \ |
166 | | src/tcp_wrap.h \ |
167 | | src/tls_wrap.h \ |
168 | | src/tree.h \ |
169 | | src/tty_wrap.h \ |
170 | | src/udp_wrap.h \ |
171 | | src/util-inl.h \ |
172 | | src/util.h \ |
173 | | src/v8abbr.h \ |
174 | | deps/v8/include/v8-debug.h \ |
175 | | deps/v8/include/v8-profiler.h \ |
176 | | deps/v8/include/v8-testing.h \ |
177 | | deps/v8/include/v8.h \ |
178 | | deps/v8/include/v8-platform.h \ |
179 | | deps/v8/include/v8-util.h \ |
180 | | deps/v8/include/v8config.h \ |
181 | | deps/uv/include/uv.h \ |
182 | | deps/uv/include/uv-unix.h \ |
183 | | deps/uv/include/uv-darwin.h \ |
184 | | deps/uv/include/tree.h \ |
185 | | deps/uv/include/uv-threadpool.h \ |
186 | | deps/uv/include/pthread-fixes.h \ |
187 | | deps/cares/include/ares.h \ |
188 | | deps/cares/include/ares_version.h \ |
189 | | deps/cares/include/nameser.h \ |
190 | | ${incdir} |
191 | | |
192 | | # install dtrace script |
193 | | xinstall -m 644 -W ${worksrcpath} \ |
194 | | src/node.d \ |
195 | | ${libddir} |
196 | | |
197 | | # install manpage |
198 | | xinstall -m 644 -W ${worksrcpath} \ |
199 | | doc/${name}.1 \ |
200 | | ${destroot}${prefix}/share/man/man1 |
201 | | |
202 | | # install docs |
203 | | xinstall -m 644 -W ${worksrcpath} \ |
204 | | AUTHORS \ |
205 | | ChangeLog.md \ |
206 | | COLLABORATOR_GUIDE.md \ |
207 | | CONTRIBUTING.md \ |
208 | | GOVERNANCE.md \ |
209 | | LICENSE \ |
210 | | README.md \ |
211 | | ${docdir} |
212 | | } |
213 | | |
214 | | compiler.blacklist *gcc* *clang-2.* {*clang-3.[012]*} {clang < 500} |
215 | | |
216 | | if {${os.major} < 10} { |
217 | | pre-fetch { |
218 | | ui_error "${name} ${version} requires Mac OS X 10.6 or greater." |
219 | | return -code error "incompatible Mac OS X version" |
220 | | } |
221 | | } |
222 | | |
223 | | livecheck.url ${homepage}dist/ |
224 | | livecheck.type regex |
225 | | livecheck.regex {v(\d+\.\d+\.\d+)} |