Ticket #46008: Portfile

File Portfile, 3.0 KB (added by garth@…, 10 years ago)
Line 
1# $Id: Portfile 82708 2011-08-18 20:17:40Z ryandesign@macports.org $
2
3PortSystem          1.0
4
5name                lua51
6conflicts           lua lua50
7set compat_version  5.1
8version             ${compat_version}.5
9revision            100
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           sha1    b3882111ad02ecc6b972f8c1241647905cb2e3fc \
25                    rmd160  b0c2234675335a8bf158a125b6778cf800c754a0
26
27depends_lib         port:readline
28build.target        macosx
29
30test.run            yes
31test.env            DYLD_LIBRARY_PATH=./lib
32
33patchfiles          patch-Makefile.diff \
34                    patch-src_Makefile.diff
35
36post-patch {
37    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile ${worksrcpath}/src/luaconf.h
38    reinplace "s|/man/man1|/share/man/man1|g" ${worksrcpath}/Makefile
39
40    # reinplace %VERSION% and %COMPAT_VERSION% after applying patch-dlopen.diff
41    reinplace "s|%VERSION%|${version}|g" ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
42    reinplace "s|%COMPAT_VERSION%|${compat_version}|g" ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
43   
44    # reinplace %PREFIX% to fix @executable_path, cf. ticket no. 28726
45    reinplace "s|%PREFIX%|${prefix}|g" ${worksrcpath}/src/Makefile
46
47    # for the pkgconfig file
48    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/etc/lua.pc
49}
50
51configure {
52    reinplace -E "/^MYLDFLAGS=/s|\$| ${configure.ldflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
53    reinplace -E "/^CFLAGS=/s|\$| ${configure.cflags} ${configure.cppflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
54    reinplace "s|CC= .*\$|CC= ${configure.cc}|" ${worksrcpath}/src/Makefile
55}
56
57use_parallel_build  no
58
59destroot.target install INSTALL_TOP=${destroot}${prefix}
60post-destroot {
61    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
62    xinstall -m 0644 -W ${worksrcpath} COPYRIGHT HISTORY README ${destroot}${prefix}/share/doc/${name}
63    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/html
64    foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.gif] {
65        xinstall -m 0644 ${html} ${destroot}${prefix}/share/doc/${name}/html
66    }
67    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/test
68    foreach test [glob ${worksrcpath}/test/README ${worksrcpath}/test/*.lua] {
69        xinstall -m 0644 ${test} ${destroot}${prefix}/share/doc/${name}/test
70    }
71    xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
72    xinstall -m 0644 ${worksrcpath}/etc/lua.pc ${destroot}${prefix}/lib/pkgconfig/lua.pc
73}
74
75livecheck.type  regex
76livecheck.url   ${master_sites}
77livecheck.regex {lua-(\d+(?:\.\d+)*)}