Ticket #33887: Portfile.2.diff
File Portfile.2.diff, 4.8 KB (added by slewsys (Andrew L. Moore), 12 years ago) |
---|
-
Portfile
3 3 PortSystem 1.0 4 4 5 5 name go 6 epoch 1 7 version 60.3 8 revision 1 6 conflicts go-devel 7 epoch 2 8 version 1.0.2 9 9 categories lang 10 10 platforms darwin freebsd linux 11 11 license BSD … … 25 25 26 26 homepage http://golang.org/ 27 27 fetch.type hg 28 hg.url https:// go.googlecode.com/hg/29 hg.tag release.r${version}28 hg.url https://code.google.com/p/go 29 hg.tag ${name}${version} 30 30 31 31 depends_build bin:bison:bison \ 32 32 bin:make:gmake \ … … 34 34 bin:ed:ed 35 35 36 36 set GOROOT ${worksrcpath} 37 set GOBIN ${workpath}/bin 37 set GOBIN ${GOROOT}/bin 38 set GOSRCDIR lib/${name}/${version} 38 39 39 40 switch ${build_arch} { 40 41 i386 { … … 68 69 build.cmd ./make.bash 69 70 build.target 70 71 build.env GOROOT=${GOROOT} GOBIN=${GOBIN} GOARCH=${GOARCH} \ 71 GOROOT_FINAL=${prefix} 72 GOROOT_FINAL=${prefix}/${GOSRCDIR} 72 73 use_parallel_build no 73 74 post-build { 74 75 # 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" 76 77 } 77 78 78 79 test.run yes 79 80 test.dir ${worksrcpath}/src 80 81 test.cmd ./run.bash 81 82 test.target 82 test.env ${build.env} 83 test.env ${build.env} \ 84 PATH=${GOBIN}:${prefix}/bin:/bin:/usr/bin 83 85 84 86 destroot { 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} 87 # build tree => GOROOT 88 set gorootdir ${destroot}${prefix}/${GOSRCDIR} 89 xinstall -m 755 -d ${gorootdir} 90 eval file copy [glob ${worksrcpath}/*] ${gorootdir} 91 xinstall -m 644 ${worksrcpath}/favicon.ico ${gorootdir}/doc/${name}.ico 92 93 # ../GOROOT/bin symlink => bin 94 xinstall -m 755 -d ${destroot}${prefix}/bin 95 foreach f [glob -tails -directory ${worksrcpath}/bin *] { 96 ln -s ../${GOSRCDIR}/bin/${f} ${destroot}${prefix}/bin 97 } 97 98 98 # compiled packages: violates mtree99 file copy ${worksrcpath}/pkg ${destroot}${prefix}100 101 99 # do not install include files: see #30203 102 100 103 # documentation 104 xinstall -m 755 -d ${destroot}${prefix}/share/doc/ 105 file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name} 106 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 101 # ../../../GOROOT/doc symlink => share/doc/go 102 xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name} 103 foreach f [glob -tails -directory ${worksrcpath}/doc *] { 104 ln -s ../../../${GOSRCDIR}/doc/${f} \ 105 ${destroot}${prefix}/share/doc/${name} 118 106 } 119 107 108 # ../../GOROOT/{misc, LICENSE, et al.} symlink => share/go 109 xinstall -m 755 -d ${destroot}${prefix}/share/${name} 110 foreach f [glob -tails -directory ${worksrcpath} \[A-Z\]* misc] { 111 ln -s ../../${GOSRCDIR}/${f} ${destroot}${prefix}/share/${name} 112 } 113 120 114 # bash completion 121 115 xinstall -m 755 -d ${destroot}${prefix}/etc/bash_completion.d 122 116 xinstall -m 644 -W ${worksrcpath}/misc/bash ${name} \ … … 137 131 xinstall -m 644 ${worksrcpath}/misc/vim/ftplugin/go/import.vim \ 138 132 ${vimdir}/ftplugin/go.vim 139 133 } 140 destroot.violate_mtree yes141 134 142 135 platform darwin { 143 136 build.env-append GOOS=darwin … … 154 147 155 148 livecheck.type regex 156 149 livecheck.url http://code.google.com/p/go/source/browse 157 livecheck.regex {> release\.r([0-9.]+)<}150 livecheck.regex {>go(1\.[0-9.]+)<}