source: trunk/dports/lang/lua/Portfile

Last change on this file was 149304, checked in by mps@…, 16 months ago

lua: update to version 5.3.3.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.8 KB
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 149304 2016-06-10 14:19:18Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                lua
7conflicts           lua50
8version             5.3.3
9categories          lang
10license             MIT
11platforms           darwin
12maintainers         nomaintainer
13description         powerful, lightweight programming language
14long_description    Lua is a powerful, light-weight programming language designed for \
15                    extending applications. Lua is also frequently used as a general-purpose, \
16                    standalone language.
17
18homepage            http://www.lua.org/
19master_sites        ${homepage}ftp/
20
21checksums           rmd160  c4989f7ae83c61f745fc174f7953c4c601fdc5de \
22                    sha256  5113c06884f7de453ce57702abaac1d618307f33f6789fa870e87a59d772aca2
23
24patchfiles          patch-Makefile.diff \
25                    patch-src-Makefile.diff \
26                    patch-src-luaconf.h.diff
27
28# TODO: also add lua50 and lua51 here
29subport             lua52 {
30    version         5.2.3
31    revision        0
32    checksums       rmd160  b8714669c8c0f8272104effd8a9675921ddb2fa5 \
33                    sha256  13c2fb97961381f7d06d5b5cea55b743c163800896fd5c5e2356201d3619002d
34
35    patchfiles      patch-Makefile-52.diff \
36                    patch-src-Makefile-52.diff \
37                    patch-src-luaconf.h-52.diff
38}
39
40set branch          [join [lrange [split ${version} .] 0 1] .]
41
42depends_lib         port:readline
43build.target        macosx
44
45test.run            yes
46test.env            DYLD_LIBRARY_PATH=./lib
47
48post-patch {
49    reinplace "s|@PREFIX@|${prefix}|g"   ${worksrcpath}/lua.pc ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile ${worksrcpath}/src/luaconf.h
50    reinplace "s|@VERSION@|${version}|g" ${worksrcpath}/lua.pc ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
51    reinplace "s|@BRANCH@|${branch}|g"   ${worksrcpath}/lua.pc ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
52}
53
54configure {
55    reinplace -E "/^MYLDFLAGS=/s|\$| ${configure.ldflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
56    reinplace -E "/^CFLAGS=/s|\$| ${configure.cflags} ${configure.cppflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
57    reinplace "s|CC= .*\$|CC= ${configure.cc}|" ${worksrcpath}/src/Makefile
58}
59
60use_parallel_build  no
61
62destroot.target install INSTALL_TOP=${destroot}${prefix}
63post-destroot {
64    # documentation
65    set docdir ${prefix}/share/doc/${subport}
66    xinstall -d -m 0755 ${destroot}${docdir}/html
67    xinstall -m 0644 -W ${worksrcpath} COPYRIGHT README ${destroot}${docdir}
68    foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.css ${worksrcpath}/doc/*.gif ${worksrcpath}/doc/*.png] {
69        xinstall -m 0644 ${html} ${destroot}${docdir}/html
70    }
71}
72
73if {$subport eq $name} {
74    post-extract {
75       xinstall -m 0644 -W ${filespath} COPYRIGHT lua.pc ${worksrcpath}
76    }
77
78    post-destroot {
79        xinstall -W ${worksrcpath} -m 0644 lua.pc ${destroot}${prefix}/lib/pkgconfig/
80    }
81} else {
82    post-extract {
83       xinstall -m 0644 -W ${filespath}/${branch} COPYRIGHT lua.pc ${worksrcpath}
84    }
85
86    post-destroot {
87        #  version executable and man pages files
88        foreach f [glob ${destroot}${prefix}/bin/*] {
89            move $f ${f}${branch}
90        }
91        foreach f [glob ${destroot}${prefix}/share/man/man1/*] {
92            move $f [file rootname $f]-${branch}[file extension $f]
93        }
94
95        #  install versioned pkgconfig file
96        xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
97        xinstall -m 0644 ${worksrcpath}/lua.pc ${destroot}${prefix}/lib/pkgconfig/lua-${branch}.pc
98    }
99}
100
101# TODO: fixme (a different livecheck is needed for different subports)
102livecheck.type  regex
103livecheck.url   ${master_sites}
104livecheck.regex {lua-(\d+(?:\.\d+)*)}
Note: See TracBrowser for help on using the repository browser.