Ticket #32590: Portfile

File Portfile, 2.7 KB (added by andremm@…, 13 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
3PortSystem          1.0
4
5name                lua
6conflicts           lua50, lua51
7set compat_version  5.2
8version             ${compat_version}.0
9revision            0
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           ${distfiles} \
24                    md5     f1ea831f397214bae8a265995ab1a93e \
25                    sha1    08f84c355cdd646f617f09cebea48bd832415829 \
26                    rmd160  6153bddd57493490b72e700cc99135432bf653f0
27
28depends_lib         port:readline
29build.target        macosx
30
31test.run            yes
32test.env            DYLD_LIBRARY_PATH=./lib
33
34patchfiles          patch-Makefile.diff \
35                    patch-src_Makefile.diff
36
37post-patch {
38    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile ${worksrcpath}/src/luaconf.h
39    reinplace "s|/man/man1|/share/man/man1|g" ${worksrcpath}/Makefile
40
41    # reinplace %VERSION% and %COMPAT_VERSION%
42    reinplace "s|%VERSION%|${version}|g" ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
43    reinplace "s|%COMPAT_VERSION%|${compat_version}|g" ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
44
45    # reinplace %PREFIX% to fix @executable_path, cf. ticket no. 28726
46    reinplace "s|%PREFIX%|${prefix}|g" ${worksrcpath}/src/Makefile
47}
48
49configure {
50    reinplace -E "/^MYLDFLAGS=/s|\$| ${configure.ldflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
51    reinplace -E "/^CFLAGS=/s|\$| ${configure.cflags} ${configure.cppflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
52    reinplace "s|CC= .*\$|CC= ${configure.cc}|" ${worksrcpath}/src/Makefile
53}
54
55use_parallel_build  no
56
57destroot.target install INSTALL_TOP=${destroot}${prefix}
58post-destroot {
59    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
60    xinstall -m 0644 -W ${worksrcpath} README ${destroot}${prefix}/share/doc/${name}
61    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/html
62    foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.gif] {
63        xinstall -m 0644 ${html} ${destroot}${prefix}/share/doc/${name}/html
64    }
65    xinstall -m 0644 ${filespath}/lua.pc ${destroot}${prefix}/lib/pkgconfig
66}
67
68livecheck.type  regex
69livecheck.url   ${master_sites}
70livecheck.regex {lua-(\d+(?:\.\d+)*)}