Ticket #28834: Portfile.2.diff

File Portfile.2.diff, 3.8 KB (added by trashgod, 14 years ago)

New Portfile patch with -docs variant check.

  • Portfile

    old new  
    44
    55name            cc65
    66version         2.13.2
     7revision        1
    78categories      lang
    89platforms       darwin
    910maintainers     gmail.com:trashgod
     
    1617
    1718homepage        http://www.cc65.org/
    1819distfiles       cc65-sources-${version}.tar.bz2
    19 worksrcdir      ${name}-${version}/src
    2020use_bzip2       yes
    2121
    2222master_sites    http://cc65.oldos.net/ \
     
    2424                ftp://ftp.musoftware.de/pub/uz/cc65/ \
    2525                ftp://ftp.musoftware.de/pub/uz/cc65/old/
    2626
    27 patchfiles      patch-makefiles.diff
    28 
    2927checksums       md5 cbf9e25db21002371222ae025a6a1850
    3028
    31 
    3229use_configure   no
    3330
    34 build.args      -f make/gcc.mak \
    35                 CC=${configure.cc}
    36 build.env       PREFIX=${prefix}
     31build.target    bins libs
     32build.args      -f make/gcc.mak prefix=${prefix}
     33
     34destroot.args   -f make/gcc.mak prefix=${destroot}${prefix}
     35
     36default_variants +docs
    3737
    38 post-build {
    39     system "cd ${worksrcpath}/../libsrc && make"
     38variant docs description {Install extra documentation} {
     39    depends_build-append port:linuxdoc-tools
     40    build.target-append docs
    4041}
    4142
    42 destroot {
    43     set _d ${destroot}${prefix}
    44     file delete ${_d}/man
    45     system "mkdir -p ${_d}/lib/cc65/{asminc,cfg,emd,joy,lib,mou,obj,ser,tgi}"
    46     system "mkdir -p ${_d}/lib/cc65/include/{em,geos,joystick,mouse,sys,tgi}"
    47     system "install -s -m 755 ${worksrcpath}/ar65/ar65 ${_d}/bin"
    48     system "install -s -m 755 ${worksrcpath}/ca65/ca65 ${_d}/bin"
    49     system "install -s -m 755 ${worksrcpath}/ca65html/ca65html ${_d}/bin"
    50     system "install -s -m 755 ${worksrcpath}/cc65/cc65 ${_d}/bin"
    51     system "install -s -m 755 ${worksrcpath}/cl65/cl65 ${_d}/bin"
    52     system "install -s -m 755 ${worksrcpath}/co65/co65 ${_d}/bin"
    53     system "install -s -m 755 ${worksrcpath}/da65/da65 ${_d}/bin"
    54     system "install -s -m 755 ${worksrcpath}/grc/grc ${_d}/bin"
    55     system "install -s -m 755 ${worksrcpath}/ld65/ld65 ${_d}/bin"
    56     system "install -s -m 755 ${worksrcpath}/od65/od65 ${_d}/bin"
    57     system "install -m 644 ${worksrcpath}/../asminc/*.inc ${_d}/lib/cc65/asminc"
    58     system "install -m 644 ${worksrcpath}/ld65/cfg/*-*.cfg ${_d}/lib/cc65/cfg"
    59     system "install -m 644 ${worksrcpath}/../libsrc/*.emd ${_d}/lib/cc65/emd"
    60     system "install -m 644 ${worksrcpath}/../include/*.h ${_d}/lib/cc65/include"
    61     system "install -m 644 ${worksrcpath}/../include/em/*.h ${_d}/lib/cc65/include/em"
    62     system "install -m 644 ${worksrcpath}/../include/geos/*.h ${_d}/lib/cc65/include/geos"
    63     system "install -m 644 ${worksrcpath}/../include/joystick/*.h ${_d}/lib/cc65/include/joystick"
    64     system "install -m 644 ${worksrcpath}/../include/mouse/*.h ${_d}/lib/cc65/include/mouse"
    65     system "install -m 644 ${worksrcpath}/../include/sys/*.h ${_d}/lib/cc65/include/sys"
    66     system "install -m 644 ${worksrcpath}/../include/tgi/*.h ${_d}/lib/cc65/include/tgi"
    67     system "install -m 644 ${worksrcpath}/../libsrc/*.joy ${_d}/lib/cc65/joy"
    68     system "install -m 644 ${worksrcpath}/../libsrc/*.lib ${_d}/lib/cc65/lib"
    69     system "install -m 644 ${worksrcpath}/../libsrc/*.mou ${_d}/lib/cc65/mou"
    70     system "install -m 644 ${worksrcpath}/../libsrc/*.o ${_d}/lib/cc65/obj"
    71     system "install -m 644 ${worksrcpath}/../libsrc/*.ser ${_d}/lib/cc65/ser"
    72     system "install -m 644 ${worksrcpath}/../libsrc/*.tgi ${_d}/lib/cc65/tgi"
     43post-patch {
     44    foreach file [glob ${worksrcpath}/src/*/make/gcc.mak] {
     45        reinplace -E "s|^CC\[\[:space:\]\]*=\[\[:space:\]\]*gcc|CC=${configure.cc}|" $file
     46    }
     47}
     48
     49set docdir ${destroot}${prefix}/share/doc/${name}
     50
     51post-destroot {
     52    if {[variant_isset docs]} {
     53        file mkdir "${docdir}/html"
     54        foreach file [glob -directory ${docdir} *.htm*] {
     55            move ${file} "${docdir}/html"
     56        }
     57    }
    7358}