Ticket #46621: Portfile-5.2.3

File Portfile-5.2.3, 2.6 KB (added by Schamschula (Marius Schamschula), 10 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                lua52
7conflicts           lua50 lua51 lua53
8version             5.2.3
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  b8714669c8c0f8272104effd8a9675921ddb2fa5 \
25                    sha256  13c2fb97961381f7d06d5b5cea55b743c163800896fd5c5e2356201d3619002d
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+)*)}