Ticket #34830: Portfile.diff

File Portfile.diff, 4.6 KB (added by slewsys (Andrew L. Moore), 12 years ago)

unified diff between lua/Portfile and lua52/Portfile

  • Portfile

    old new  
    1 # $Id: Portfile 82708 2011-08-18 20:17:40Z ryandesign@macports.org $
     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
     3# $Id: Portfile 82709 2011-08-18 20:19:13Z ryandesign@macports.org $
    24
    35PortSystem          1.0
    46
    5 name                lua
    6 conflicts           lua50
    7 set compat_version  5.1
    8 version             ${compat_version}.5
     7name                lua52
     8conflicts           lua lua50
     9version             5.2.1
    910revision            0
    1011categories          lang
    1112license             MIT
     
    1920
    2021homepage            http://www.lua.org
    2122master_sites        ${homepage}/ftp/
     23distname            lua-${version}
    2224
    23 checksums           ${distfiles} \
    24                     sha1    2b11c8e60306efb7f0734b747588f57995493db7 \
    25                     rmd160  c867c8364295d3e4fb4e4d8ebb27fa2b2312cdef
     25checksums           md5     ae08f641b45d737d12d30291a5e5f6e3 \
     26                    sha1    6bb1b0a39b6a5484b71a83323c690154f86b2021 \
     27                    rmd160  365eb77561b1f4f92c29f6d7f455f41e2b8393e0
    2628
    2729depends_lib         port:readline
    2830build.target        macosx
     
    3032test.run            yes
    3133test.env            DYLD_LIBRARY_PATH=./lib
    3234
    33 patchfiles          patch-lua-5.1.4-3 \
    34                     patch-Makefile.diff \
    35                     patch-src_Makefile.diff
     35patchfiles          patch-Makefile.diff \
     36                    patch-src_Makefile.diff \
     37                    patch-lua-${version}.pc.diff
     38patch.args          -f
    3639
    3740post-patch {
    38     reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile ${worksrcpath}/src/luaconf.h
    39     reinplace "s|/man/man1|/share/man/man1|g" ${worksrcpath}/Makefile
    40 
    41     # reinplace %VERSION% and %COMPAT_VERSION% after applying patch-dlopen.diff
    42     reinplace "s|%VERSION%|${version}|g" ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
    43     reinplace "s|%COMPAT_VERSION%|${compat_version}|g" ${worksrcpath}/Makefile ${worksrcpath}/src/Makefile
    44    
    45     # reinplace %PREFIX% to fix @executable_path, cf. ticket no. 28726
    46     reinplace "s|%PREFIX%|${prefix}|g" ${worksrcpath}/src/Makefile
    47 
    48     # for the pkgconfig file
    49     reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/etc/lua.pc
    50 }
    51 
    52 configure {
    53     reinplace -E "/^MYLDFLAGS=/s|\$| ${configure.ldflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
    54     reinplace -E "/^CFLAGS=/s|\$| ${configure.cflags} ${configure.cppflags} [get_canonical_archflags]|" ${worksrcpath}/src/Makefile
    55     reinplace "s|CC= .*\$|CC= ${configure.cc}|" ${worksrcpath}/src/Makefile
     41    reinplace "s|@PREFIX@|${prefix}|" ${worksrcpath}/lua-${version}.pc
     42    reinplace "s|@PREFIX@|${prefix}|" ${worksrcpath}/Makefile
     43    reinplace "s|@CC@|${configure.cc}|" ${worksrcpath}/src/Makefile
     44    reinplace "s|@CFLAGS@|${configure.cflags} [get_canonical_archflags]|" \
     45        ${worksrcpath}/src/Makefile
     46    reinplace "s|@LDFLAGS@|[get_canonical_archflags]|" \
     47        ${worksrcpath}/src/Makefile
    5648}
    5749
    5850use_parallel_build  no
     51use_configure       no
     52build.target        macosx
    5953
    60 destroot.target install INSTALL_TOP=${destroot}${prefix}
    6154post-destroot {
     55    xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
     56    xinstall -W ${worksrcpath} -m 0644 lua-${version}.pc \
     57        ${destroot}${prefix}/lib/pkgconfig/lua-${version}.pc
    6258    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
    63     xinstall -m 0644 -W ${worksrcpath} COPYRIGHT HISTORY README ${destroot}${prefix}/share/doc/${name}
     59    xinstall -W ${worksrcpath} -m 0644 README \
     60        ${destroot}${prefix}/share/doc/${name}
    6461    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/html
    65     foreach html [glob ${worksrcpath}/doc/*.html ${worksrcpath}/doc/*.gif] {
    66         xinstall -m 0644 ${html} ${destroot}${prefix}/share/doc/${name}/html
     62    foreach html [glob doc/*.html doc/*.gif] {
     63        xinstall -W ${worksrcpath} -m 0644 ${html} \
     64            ${destroot}${prefix}/share/doc/${name}/html
    6765    }
    68     xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/test
    69     foreach test [glob ${worksrcpath}/test/README ${worksrcpath}/test/*.lua] {
    70         xinstall -m 0644 ${test} ${destroot}${prefix}/share/doc/${name}/test
    71     }
    72     xinstall -d -m 0755 ${destroot}${prefix}/lib/pkgconfig
    73     xinstall -m 0644 ${worksrcpath}/etc/lua.pc ${destroot}${prefix}/lib/pkgconfig/lua.pc
    7466}
    7567
    7668livecheck.type  regex
    7769livecheck.url   ${master_sites}
    78 livecheck.regex {lua-(\d+(?:\.\d+)*)}
     70livecheck.regex "lua-(5.2(?:\\.\\d+)*)${extract.suffix}"