Ticket #29906: Portfile-go.2.diff

File Portfile-go.2.diff, 2.9 KB (added by gaochangjian@…, 13 years ago)

place doc in the standard hierarchy

  • Portfile

    old new  
    6969build.cmd           ./make.bash
    7070build.target   
    7171build.env           GOROOT=${GOROOT} GOBIN=${GOBIN} GOARCH=${GOARCH} \
    72                     GOROOT_FINAL=${prefix}
     72                    GOROOT_FINAL=${prefix}/src/${name}/${name}-${version}
    7373use_parallel_build  no
    7474post-build {
    7575    # remove mercurial extras
     
    8383test.env            ${build.env}
    8484
    8585destroot {
     86    # setup GOROOT
     87    xinstall -m 755 -d ${destroot}${prefix}/src/go
     88    file copy ${worksrcpath} ${destroot}${prefix}/src/go
     89    file delete ${destroot}${prefix}/src/${name}/${name}-${version}/bin
     90    file delete ${destroot}${prefix}/src/${name}/${name}-${version}/doc
     91
    8692    # bin files
    8793    file delete ${destroot}${prefix}/bin
    8894    file copy ${GOBIN} ${destroot}${prefix}
     
    9197        xinstall -g procmod -m 2755 ${worksrcpath}/src/cmd/$i/${cmd_prefix}$i \
    9298            ${destroot}${prefix}/bin
    9399    }
    94        
    95     # lib files
    96     file delete -force ${destroot}${prefix}/lib
    97     file copy ${worksrcpath}/lib ${destroot}${prefix}
    98    
    99     # compiled packages: violates mtree
    100     file copy ${worksrcpath}/pkg ${destroot}${prefix}
    101 
    102     # include files
    103     delete ${destroot}${prefix}/include
    104     file copy ${worksrcpath}/include ${destroot}${prefix}/include
    105    
     100
    106101    # documentation
    107102    xinstall -m 755 -d ${destroot}${prefix}/share/doc/
    108103    file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
    109     xinstall -m 644 -W ${worksrcpath} favicon.ico \
    110         ${destroot}${prefix}/share/doc/${name}/${name}.ico
    111     # godoc command required documentation
    112     xinstall -m 755 -d ${destroot}${prefix}/src/go
    113     file copy ${worksrcpath} ${destroot}${prefix}/src/go
    114     system "cd ${destroot}${prefix}/src/${name}/${name}-${version}/src && ./clean.bash"
    115     file delete ${destroot}${prefix}/src/${name}/${name}-${version}/bin
    116     file delete ${destroot}${prefix}/src/${name}/${name}-${version}/pkg
    117     ln -s ${prefix}/src/${name}/${name}-${version}/src/pkg ${destroot}${prefix}/src/pkg
    118     # gomake command required makefiles
    119     foreach f [glob -tails -directory ${destroot}${prefix}/src/${name}/${name}-${version}/src/ Make.*] {
    120         ln -s ${name}/${name}-${version}/src/${f} ${destroot}${prefix}/src
    121     }
     104    ln -s ${prefix}/share/doc/${name} ${destroot}${prefix}/src/${name}/${name}-${version}/doc
    122105
    123106    # bash completion
    124107    xinstall -m 755 -d ${destroot}${prefix}/etc/bash_completion.d
     
    140123    xinstall -m 644 ${worksrcpath}/misc/vim/ftplugin/go/import.vim \
    141124        ${vimdir}/ftplugin/go.vim
    142125}
    143 destroot.violate_mtree     yes
    144126
    145127platform darwin {
    146128    build.env-append GOOS=darwin
     
    154136    build.env-append GOOS=linux
    155137    test.env-append GOOS=linux
    156138}
     139
     140notes "
     141You must set GOBIN environment variable to ${prefix}/bin in your shell\
     142profile (~/.bashrc, ~/.profile, or equivalent).
     143"