Ticket #46621: Portfile.2

File Portfile.2, 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/
21master_sites        ${homepage}ftp/
22
23checksums           rmd160  42a8a628e54b2bc2e211310fc8d72c49c8812a11 \
24                    sha256  ae4a5eb2d660515eb191bfe3e061f2b8ffe94dce73d32cfd0de090ddcc0ddb01
25
26depends_lib         port:readline
27build.target        macosx
28
29test.run            yes
30test.env            DYLD_LIBRARY_PATH=./lib
31
32post-extract {
33    xinstall -m 0644 -W ${filespath} COPYRIGHT lua.pc ${worksrcpath}
34}
35
36patchfiles          patch-Makefile.diff \
37                    patch-src-Makefile.diff \
38                    patch-src-luaconf.h.diff
39
40post-patch {
41    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/Makefile ${worksrcpath}/lua.pc ${worksrcpath}/src/Makefile ${worksrcpath}/src/luaconf.h
42    reinplace "s|@VERSION@|${version}|g" ${worksrcpath}/Makefile ${worksrcpath}/lua.pc ${worksrcpath}/src/Makefile
43    reinplace "s|@BRANCH@|${branch}|g" ${worksrcpath}/Makefile ${worksrcpath}/lua.pc ${worksrcpath}/src/Makefile
44}
45
46configure {
47    reinplace -E "/^MYLDFLAGS=/s|\$| ${configure.ldflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
48    reinplace -E "/^CFLAGS=/s|\$| ${configure.cflags} ${configure.cppflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
49    reinplace "s|CC= .*\$|CC= ${configure.cc}|" ${worksrcpath}/src/Makefile
50}
51
52use_parallel_build  no
53
54destroot.target install INSTALL_TOP=${destroot}${prefix}
55post-destroot {
56    set docdir ${prefix}/share/doc/${subport}
57    xinstall -d -m 0755 ${destroot}${docdir}/html
58    xinstall -m 0644 -W ${worksrcpath} COPYRIGHT README ${destroot}${docdir}
59    foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.gif] {
60        xinstall -m 0644 ${html} ${destroot}${docdir}/html
61    }
62    xinstall -W ${worksrcpath} -m 0644 lua.pc ${destroot}${prefix}/lib/pkgconfig/
63}
64
65livecheck.type  regex
66livecheck.url   ${master_sites}
67livecheck.regex {lua-(\d+(?:\.\d+)*)}