source: trunk/dports/lang/lua51/Portfile

Last change on this file was 121047, checked in by devans@…, 3 years ago

lua51: fix patch files to install libraries in the form liblua-5.1 and make lua-5.1.pc agree with that (#43862).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1# $Id: Portfile 121047 2014-06-15 21:19:59Z ryandesign@macports.org $
2
3PortSystem          1.0
4
5name                lua51
6version             5.1.5
7revision            2
8set abi             [join [lrange [split $version "."] 0 end-1] "."]
9categories          lang
10license             MIT
11platforms           darwin
12maintainers         nomaintainer
13description         powerful, lightweight programming language
14long_description    \
15    Lua is a powerful, light-weight programming language designed for \
16    extending applications. Lua is also frequently used as a general-purpose, \
17    standalone language.
18
19homepage            http://www.lua.org
20distname            lua-${version}
21master_sites        ${homepage}/ftp/
22
23checksums           sha1    b3882111ad02ecc6b972f8c1241647905cb2e3fc \
24                    rmd160  b0c2234675335a8bf158a125b6778cf800c754a0
25
26depends_lib         port:readline
27
28test.run            yes
29test.env            DYLD_LIBRARY_PATH=./lib
30
31patchfiles          patch-Makefile.diff \
32                    patch-src_Makefile.diff \
33                    patch-etc_lua.pc.diff
34
35post-patch {
36    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/src/luaconf.h
37   
38    # reinplace %PREFIX% to fix @executable_path, cf. ticket no. 28726
39    reinplace "s|%PREFIX%|${prefix}|g" \
40        ${worksrcpath}/Makefile \
41        ${worksrcpath}/src/Makefile \
42        ${worksrcpath}/etc/lua.pc
43}
44
45use_configure       no
46
47build.target        macosx
48build.args-append   V=${abi} \
49                    R=${version} \
50                    PREFIX=${prefix} \
51                    CC="${configure.cc}" \
52                    LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]" \
53                    CFLAGS="${configure.cflags} ${configure.cppflags} [get_canonical_archflags cc]"
54
55use_parallel_build  no
56
57destroot.post_args-append   INSTALL_TOP=${destroot}${prefix}
58post-destroot {
59    #  install docs
60    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
61    xinstall -m 0644 -W ${worksrcpath} COPYRIGHT HISTORY README \
62             ${destroot}${prefix}/share/doc/${name}
63    foreach f [glob ${worksrcpath}/doc/*] {
64        xinstall -m 0644 $f ${destroot}${prefix}/share/doc/${name}
65    }
66       
67    #  install test and etc stuff
68    xinstall -d -m 0755 ${destroot}${prefix}/share/examples/${name}
69    copy ${worksrcpath}/test ${destroot}${prefix}/share/examples/${name}/test
70    copy ${worksrcpath}/etc ${destroot}${prefix}/share/examples/${name}/etc
71
72    #  version executable and man pages files
73    foreach f [glob ${destroot}${prefix}/bin/*] {
74        move $f ${f}${abi}
75    }
76    foreach f [glob ${destroot}${prefix}/share/man/man1/*] {
77        move $f [file rootname $f]-${abi}[file extension $f]
78    }
79
80    #  install versioned pkgconfig file
81    xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
82    xinstall -m 0644 ${worksrcpath}/etc/lua.pc ${destroot}${prefix}/lib/pkgconfig/lua-${abi}.pc
83}
84
85livecheck.type  regex
86livecheck.url   ${master_sites}
87livecheck.regex {lua-(\d+(?:\.\d+)*)}
Note: See TracBrowser for help on using the repository browser.