Ticket #28721: Portfile

File Portfile, 2.0 KB (added by frodwith@…, 13 years ago)
Line 
1# $Id$
2PortSystem          1.0
3
4name                v8
5version             7103
6platforms           darwin
7license             New BSD License
8
9categories          lang devel
10maintainers         gmail.com:frodwith
11
12description         Google's open source JavaScript Engine
13long_description    Library and command line shell for Google's \
14                    high performance, open source Javascript engine.
15
16homepage            http://code.google.com/p/v8/
17
18depends_build       port:scons
19
20fetch.type          svn
21svn.url             http://v8.googlecode.com/svn/trunk
22svn.revision        ${version}
23worksrcdir          trunk
24
25use_configure       no
26
27variant universal description "Build for all supported architectures" {
28}
29
30build {
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
52destroot {
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}