source: trunk/dports/devel/lua-lpeg/Portfile

Last change on this file was 140553, checked in by ionic@…, 22 months ago

lua-lpeg: fix trace mode builds: exchange post-patch phase with pre-configure. lib dependencies are available in configure and later only, but we're querying pkg-config directly.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.5 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 140553 2015-09-22 18:46:28Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                lua-lpeg
7license             MIT
8version             0.12.2
9categories          devel
10platforms           darwin
11maintainers         gmail.com:andremm openmaintainer
12description         Parsing Expression Grammars for Lua
13long_description    LPeg is a new pattern-matching library for Lua, based on \
14                    Parsing Expression Grammars (PEGs).
15
16homepage            http://www.inf.puc-rio.br/~roberto/lpeg
17master_sites        ${homepage}
18distname            lpeg-${version}
19# upstream archive had a stealth update, setting subdir since it's likely to happen again
20dist_subdir         ${name}/${version}_1
21
22checksums           rmd160  fb6d1613b668edbddfbffd378642827f0c1626ee \
23                    sha256  6aad270b91d1b1c6fd75f68e162329a04a644e50e917d55f46cc8384b7120004
24
25depends_build       port:pkgconfig
26depends_lib         port:lua
27
28patchfiles          patch-makefile.diff
29
30# This should be done in post-patch, but lua is only available as a dependency
31# in configure and later phases. Thus, using pkg-config to get the C and LDFLAGS
32# fails miserably in trace mode.
33pre-configure {
34    reinplace  "s|%%CFLAGS%%|${configure.cflags}  [exec ${prefix}/bin/pkg-config lua --cflags]|" ${worksrcpath}/makefile
35    reinplace "s|%%LDFLAGS%%|${configure.ldflags} [exec ${prefix}/bin/pkg-config lua --libs]|"   ${worksrcpath}/makefile
36
37    reinplace "s|/usr/bin/env lua5.1|${prefix}/bin/lua|" ${worksrcpath}/test.lua
38}
39
40use_configure       no
41
42variant universal {}
43
44build.target        macosx
45build.args          CC="${configure.cc} [get_canonical_archflags]" \
46                    LUADIR=${prefix}/include
47
48destroot {
49    set lua_cmod [exec ${prefix}/bin/pkg-config lua --variable INSTALL_CMOD]
50    set lua_lmod [exec ${prefix}/bin/pkg-config lua --variable INSTALL_LMOD]
51    set lua_docdir ${prefix}/share/doc/${name}
52    set lua_exampledir ${prefix}/share/examples/${name}
53
54    xinstall -m 755 -d \
55        ${destroot}${lua_cmod} \
56        ${destroot}${lua_lmod} \
57        ${destroot}${lua_docdir} \
58        ${destroot}${lua_exampledir}
59
60    xinstall ${worksrcpath}/lpeg.so ${destroot}${lua_cmod}
61    xinstall ${worksrcpath}/re.lua ${destroot}${lua_lmod}
62
63    xinstall -m 644 -W ${worksrcpath} HISTORY lpeg-128.gif lpeg.html re.html ${destroot}${lua_docdir}
64    xinstall -m 755 ${worksrcpath}/test.lua ${destroot}${lua_exampledir}
65}
66
67livecheck.regex     "lpeg-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Note: See TracBrowser for help on using the repository browser.