Ticket #46621: Portfile-5.3.0

File Portfile-5.3.0, 2.6 KB (added by Schamschula (Marius Schamschula), 9 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: Portfile 118805 2014-04-11 07:02:47Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                lua53
7conflicts           lua50 lua51 lua52
8version             5.3.0
9set branch          [join [lrange [split ${version} .] 0 1] .]
10categories          lang
11license             MIT
12platforms           darwin
13maintainers         nomaintainer
14description         powerful, lightweight programming language
15long_description    \
16    Lua is a powerful, light-weight programming language designed for \
17    extending applications. Lua is also frequently used as a general-purpose, \
18    standalone language.
19
20homepage            http://www.lua.org/
21distname            lua-${version}
22master_sites        ${homepage}ftp/
23
24checksums           rmd160  42a8a628e54b2bc2e211310fc8d72c49c8812a11 \
25                    sha256  ae4a5eb2d660515eb191bfe3e061f2b8ffe94dce73d32cfd0de090ddcc0ddb01
26
27depends_lib         port:readline
28build.target        macosx
29
30test.run            yes
31test.env            DYLD_LIBRARY_PATH=./lib
32
33post-extract {
34    xinstall -m 0644 -W ${filespath} COPYRIGHT lua.pc ${worksrcpath}
35}
36
37patchfiles          patch-Makefile.diff \
38                    patch-src-Makefile.diff \
39                    patch-src-luaconf.h.diff
40
41post-patch {
42    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/Makefile ${worksrcpath}/lua.pc ${worksrcpath}/src/Makefile ${worksrcpath}/src/luaconf.h
43    reinplace "s|@VERSION@|${version}|g" ${worksrcpath}/Makefile ${worksrcpath}/lua.pc ${worksrcpath}/src/Makefile
44    reinplace "s|@BRANCH@|${branch}|g" ${worksrcpath}/Makefile ${worksrcpath}/lua.pc ${worksrcpath}/src/Makefile
45}
46
47configure {
48    reinplace -E "/^MYLDFLAGS=/s|\$| ${configure.ldflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
49    reinplace -E "/^CFLAGS=/s|\$| ${configure.cflags} ${configure.cppflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
50    reinplace "s|CC= .*\$|CC= ${configure.cc}|" ${worksrcpath}/src/Makefile
51}
52
53use_parallel_build  no
54
55destroot.target install INSTALL_TOP=${destroot}${prefix}
56post-destroot {
57    set docdir ${prefix}/share/doc/${subport}
58    xinstall -d -m 0755 ${destroot}${docdir}/html
59    xinstall -m 0644 -W ${worksrcpath} COPYRIGHT README ${destroot}${docdir}
60    foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.gif] {
61        xinstall -m 0644 ${html} ${destroot}${docdir}/html
62    }
63    xinstall -W ${worksrcpath} -m 0644 lua.pc ${destroot}${prefix}/lib/pkgconfig/
64}
65
66livecheck.type  regex
67livecheck.url   ${master_sites}
68livecheck.regex {lua-(\d+(?:\.\d+)*)}