Ticket #29906: Portfile-go.diff

File Portfile-go.diff, 2.8 KB (added by gaochangjian@…, 13 years ago)
  • 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
    8691    # bin files
    8792    file delete ${destroot}${prefix}/bin
    8893    file copy ${GOBIN} ${destroot}${prefix}
     
    9196        xinstall -g procmod -m 2755 ${worksrcpath}/src/cmd/$i/${cmd_prefix}$i \
    9297            ${destroot}${prefix}/bin
    9398    }
    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    
    106     # documentation
    107     xinstall -m 755 -d ${destroot}${prefix}/share/doc/
    108     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     }
    12299
    123100    # bash completion
    124101    xinstall -m 755 -d ${destroot}${prefix}/etc/bash_completion.d
     
    140117    xinstall -m 644 ${worksrcpath}/misc/vim/ftplugin/go/import.vim \
    141118        ${vimdir}/ftplugin/go.vim
    142119}
    143 destroot.violate_mtree     yes
    144120
    145121platform darwin {
    146122    build.env-append GOOS=darwin
     
    154130    build.env-append GOOS=linux
    155131    test.env-append GOOS=linux
    156132}
     133
     134notes "
     135You must set GOBIN environment variable to ${prefix}/bin in your shell\
     136profile (~/.bashrc, ~/.profile, or equivalent).
     137"