1 | # $Id$ |
---|
2 | PortSystem 1.0 |
---|
3 | |
---|
4 | name v8 |
---|
5 | version 7103 |
---|
6 | platforms darwin |
---|
7 | license New BSD License |
---|
8 | |
---|
9 | categories lang devel |
---|
10 | maintainers gmail.com:frodwith |
---|
11 | |
---|
12 | description Google's open source JavaScript Engine |
---|
13 | long_description Library and command line shell for Google's \ |
---|
14 | high performance, open source Javascript engine. |
---|
15 | |
---|
16 | homepage http://code.google.com/p/v8/ |
---|
17 | |
---|
18 | depends_build port:scons |
---|
19 | |
---|
20 | fetch.type svn |
---|
21 | svn.url http://v8.googlecode.com/svn/trunk |
---|
22 | svn.revision ${version} |
---|
23 | worksrcdir trunk |
---|
24 | |
---|
25 | use_configure no |
---|
26 | |
---|
27 | variant universal description "Build for all supported architectures" { |
---|
28 | } |
---|
29 | |
---|
30 | build { |
---|
31 | if {[variant_isset universal]} { |
---|
32 | set archs ${universal_archs} |
---|
33 | } else { |
---|
34 | set archs ${os.arch} |
---|
35 | } |
---|
36 | regsub "i386" ${archs} "ia32" archs |
---|
37 | regsub "x86_64" ${archs} "x64" archs |
---|
38 | set libstr "" |
---|
39 | set exstr "" |
---|
40 | foreach arch ${archs} { |
---|
41 | system "cd ${worksrcpath} && scons mode=release snapshot=on library=shared console=readline visibility=default arch=${arch} sample=shell" |
---|
42 | |
---|
43 | move ${worksrcpath}/libv8.dylib ${worksrcpath}/libv8-${arch}.dylib |
---|
44 | move ${worksrcpath}/shell ${worksrcpath}/shell-${arch} |
---|
45 | append libstr "${worksrcpath}/libv8-${arch}.dylib " |
---|
46 | append exstr "${worksrcpath}/shell-${arch} " |
---|
47 | } |
---|
48 | system "lipo -create ${libstr} -output ${worksrcpath}/libv8.dylib" |
---|
49 | system "lipo -create ${exstr} -output ${worksrcpath}/v8" |
---|
50 | } |
---|
51 | |
---|
52 | destroot { |
---|
53 | eval xinstall -m 0644 \ |
---|
54 | [glob ${worksrcpath}/include/*.h] \ |
---|
55 | ${destroot}${prefix}/include |
---|
56 | |
---|
57 | xinstall -m 0644 \ |
---|
58 | ${worksrcpath}/libv8.dylib \ |
---|
59 | ${destroot}${prefix}/lib |
---|
60 | |
---|
61 | xinstall -m 0755 \ |
---|
62 | ${worksrcpath}/v8 \ |
---|
63 | ${destroot}${prefix}/bin |
---|
64 | |
---|
65 | set libpath ${prefix}/lib/libv8.dylib |
---|
66 | |
---|
67 | system "install_name_tool -id ${libpath} ${destroot}${libpath}" |
---|
68 | system "install_name_tool -change libv8.dylib ${libpath} ${destroot}${prefix}/bin/v8" |
---|
69 | } |
---|