Ticket #33887: Portfile.diff

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

Alternative Portfile update

  • Portfile

    old new  
    1 # $Id: Portfile 95777 2012-07-22 08:52:35Z ryandesign@macports.org $
     1# $Id: Portfile 86679 2011-10-31 18:47:38Z singingwolfboy@macports.org $
    22
    33PortSystem          1.0
    44
    55name                go
    6 epoch               1
    7 version             60.3
    8 revision            1
     6conflicts           go-devel
     7epoch               2
     8version             1.0.2
    99categories          lang
    1010platforms           darwin freebsd linux
    1111license             BSD
     
    2525
    2626homepage            http://golang.org/
    2727fetch.type          hg
    28 hg.url              https://go.googlecode.com/hg/
    29 hg.tag              release.r${version}
     28hg.url              https://code.google.com/p/go
     29hg.tag              ${name}${version}
    3030
    3131depends_build       bin:bison:bison \
    3232                    bin:make:gmake \
     
    3434                    bin:ed:ed
    3535
    3636set GOROOT          ${worksrcpath}
    37 set GOBIN           ${workpath}/bin
     37set GOBIN           ${GOROOT}/bin
     38set GOSRCDIR        lib/${name}${version}
    3839
    3940switch ${build_arch} {
    4041    i386 {
     
    6869build.cmd           ./make.bash
    6970build.target   
    7071build.env           GOROOT=${GOROOT} GOBIN=${GOBIN} GOARCH=${GOARCH} \
    71                     GOROOT_FINAL=${prefix}
     72                    GOROOT_FINAL=${prefix}/${GOSRCDIR}
    7273use_parallel_build  no
    7374post-build {
    7475    # remove mercurial extras
    75     system "find ${worksrcpath} -type d -name .hg -print0 | xargs -0 rm -rf"
     76    system "find ${worksrcpath} -type d -name '.hg*' -delete"
    7677}
    7778
    7879test.run            yes
    7980test.dir            ${worksrcpath}/src
    8081test.cmd            ./run.bash
    8182test.target
    82 test.env            ${build.env}
     83test.env            ${build.env} \
     84                    PATH=${GOBIN}:${prefix}/bin:/bin:/usr/bin
    8385
    8486destroot {
    85     # bin files
    86     file delete ${destroot}${prefix}/bin
    87     file copy ${GOBIN} ${destroot}${prefix}
    88     # on Darwin, have to install and setgid; see ${GOROOT}/src/sudo.bash
    89     foreach i {prof cov} {
    90         xinstall -g procmod -m 2755 ${worksrcpath}/src/cmd/$i/${cmd_prefix}$i \
    91             ${destroot}${prefix}/bin
    92     }
    93        
    94     # lib files
    95     file delete -force ${destroot}${prefix}/lib
    96     file copy ${worksrcpath}/lib ${destroot}${prefix}
    97    
    98     # compiled packages: violates mtree
    99     file copy ${worksrcpath}/pkg ${destroot}${prefix}
     87    # bin/pkg/src
     88    file copy ${worksrcpath}/ ${destroot}${prefix}/${GOSRCDIR}
    10089
     90    # bin symlinks
     91    xinstall -m 755 -d ${destroot}${prefix}/bin
     92    foreach f [glob -tails -directory ${destroot}${prefix}/${GOSRCDIR}/bin *] {
     93        ln -s ../${GOSRCDIR}/bin/${f} ${destroot}${prefix}/bin
     94    }
     95   
    10196    # do not install include files: see #30203
    10297   
    10398    # documentation
    104     xinstall -m 755 -d ${destroot}${prefix}/share/doc/
    105     file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
     99    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}${version}
     100    file copy ${worksrcpath}/doc \
     101        ${destroot}${prefix}/share/doc/${name}${version}
    106102    xinstall -m 644 -W ${worksrcpath} favicon.ico \
    107         ${destroot}${prefix}/share/doc/${name}/${name}.ico
    108     # godoc command required documentation
    109     xinstall -m 755 -d ${destroot}${prefix}/src/go
    110     file copy ${worksrcpath} ${destroot}${prefix}/src/go
    111     system "cd ${destroot}${prefix}/src/${name}/${name}-${version}/src && ./clean.bash"
    112     file delete ${destroot}${prefix}/src/${name}/${name}-${version}/bin
    113     file delete ${destroot}${prefix}/src/${name}/${name}-${version}/pkg
    114     ln -s ${prefix}/src/${name}/${name}-${version}/src/pkg ${destroot}${prefix}/src/pkg
    115     # gomake command required makefiles
    116     foreach f [glob -tails -directory ${destroot}${prefix}/src/${name}/${name}-${version}/src/ Make.*] {
    117         ln -s ${name}/${name}-${version}/src/${f} ${destroot}${prefix}/src
    118     }
     103        ${destroot}${prefix}/share/doc/${name}${version}/${name}.ico
     104
     105    # misc.
     106    xinstall -m 755 -d ${destroot}${prefix}/share/${name}${version}
     107    file copy ${worksrcpath}/misc ${destroot}${prefix}/share/${name}${version}
    119108
    120109    # bash completion
    121110    xinstall -m 755 -d ${destroot}${prefix}/etc/bash_completion.d
     
    137126    xinstall -m 644 ${worksrcpath}/misc/vim/ftplugin/go/import.vim \
    138127        ${vimdir}/ftplugin/go.vim
    139128}
    140 destroot.violate_mtree     yes
    141129
    142130platform darwin {
    143131    build.env-append GOOS=darwin
     
    154142
    155143livecheck.type      regex
    156144livecheck.url       http://code.google.com/p/go/source/browse
    157 livecheck.regex     {>release\.r([0-9.]+)<}
     145livecheck.regex     {>go(1\.[0-9.]+)<}