Ticket #22334: Portfile

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