1 | # $Id: Portfile 82708 2011-08-18 20:17:40Z ryandesign@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | |
---|
5 | name lua51 |
---|
6 | conflicts lua lua50 |
---|
7 | set compat_version 5.1 |
---|
8 | version ${compat_version}.5 |
---|
9 | revision 100 |
---|
10 | categories lang |
---|
11 | license MIT |
---|
12 | platforms darwin |
---|
13 | maintainers nomaintainer |
---|
14 | description powerful, lightweight programming language |
---|
15 | long_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 | |
---|
20 | homepage http://www.lua.org |
---|
21 | distname lua-${version} |
---|
22 | master_sites ${homepage}/ftp/ |
---|
23 | |
---|
24 | checksums sha1 b3882111ad02ecc6b972f8c1241647905cb2e3fc \ |
---|
25 | rmd160 b0c2234675335a8bf158a125b6778cf800c754a0 |
---|
26 | |
---|
27 | depends_lib port:readline |
---|
28 | build.target macosx |
---|
29 | |
---|
30 | test.run yes |
---|
31 | test.env DYLD_LIBRARY_PATH=./lib |
---|
32 | |
---|
33 | patchfiles patch-Makefile.diff \ |
---|
34 | patch-src_Makefile.diff |
---|
35 | |
---|
36 | post-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 | |
---|
51 | configure { |
---|
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 | |
---|
57 | use_parallel_build no |
---|
58 | |
---|
59 | destroot.target install INSTALL_TOP=${destroot}${prefix} |
---|
60 | post-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 | |
---|
75 | livecheck.type regex |
---|
76 | livecheck.url ${master_sites} |
---|
77 | livecheck.regex {lua-(\d+(?:\.\d+)*)} |
---|