Ticket #33871: Portfile

File Portfile, 2.7 KB (added by gellule.xg@…, 12 years ago)
Line 
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
4PortSystem          1.0
5
6name                luabind
7version             0.9.1
8categories          devel
9platforms           darwin
10maintainers         nomaintainer
11description         A library that helps you create bindings between C++ and Lua
12
13long_description \
14    Luabind is a library that helps you create \
15    bindings between C++ and Lua. It has the ability \
16    to expose functions and classes, written in C++, \
17    to Lua. It will also supply the functionality to \
18    define classes in lua and let them derive from \
19    other lua classes or C++ classes. Lua classes can \
20    override virtual functions from their C++ baseclasses. \
21    It is written towards Lua 5.x, and does not work with Lua 4.
22
23homepage            http://www.rasterbar.com/products/luabind.html
24master_sites        sourceforge
25
26checksums           sha256  80de5e04918678dd8e6dac3b22a34b3247f74bf744c719bae21faaa49649aaae \
27                    rmd160  0c8ea633f4b2981d977c3300cf9825de3bba4936
28
29depends_build       port:boost-jam \
30                    port:boost-build
31
32depends_lib         port:lua \
33                    port:boost
34
35patchfiles          patch-luabind-detail-format_signature.hpp.diff
36
37use_configure       no
38
39pre-build {
40        reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Jamroot
41}
42
43build.cmd       bjam
44build.args      link=static --toolset=darwin -d2
45
46variant debug description {Build debug libraries} {
47        global build.target
48        build.target variant=debug,release
49}
50if {![variant_isset debug]} {
51        global build.target
52        build.target variant=release
53}
54
55variant universal {
56        build.args-append \
57                cflags="${configure.universal_cflags} ${configure.universal_cppflags}" \
58                linkflags="${configure.universal_ldflags}"
59}
60
61destroot.cmd        ${build.cmd} 
62destroot.destdir    --prefix=${destroot}${prefix}
63pre-destroot {
64  eval destroot.args  ${build.target} ${build.args}
65}
66
67post-destroot {
68        #check for boost_system multi-threaded version
69        if {[file exists ${prefix}/lib/libboost_system-mt.dylib]} {
70                set boost_system_lib boost_system-mt
71        } else {
72                set boost_system_lib boost_system
73        }
74       
75        #Create a .pc for pkg-config
76        set data "Name: ${name}
77        Description: ${description}
78        URL: ${homepage}
79        Version: ${version}
80        Requires: lua
81        Libs: -L${prefix}/lib -lluabind -l${boost_system_lib}
82        Cflags: -I${prefix}/include"
83        set filename "${worksrcpath}/luabind.pc"
84        set file [open $filename "w"]
85        puts -nonewline $file $data
86        close $file
87
88    xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
89    xinstall -m 0644 ${worksrcpath}/luabind.pc ${destroot}${prefix}/lib/pkgconfig/luabind.pc
90}
91
92livecheck.regex <title>${name} (\\d+\\.\\d+\\.\\d+) released