actions.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt
  6. from pisi.actionsapi import get
  7. from pisi.actionsapi import autotools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import shelltools
  10. NoStrip = ["/"]
  11. def build():
  12. shelltools.export("go_platform","linux-amd64")
  13. shelltools.export("go_linker","/lib/ld-linux-x86-64.so.2")
  14. shelltools.export("GOROOT", "%s/go-go%s" % (get.workDIR(), get.srcVERSION())) #0
  15. shelltools.export("GOBIN", "$GOROOT/bin") #1
  16. shelltools.export("GOPATH", "%s" % get.workDIR())
  17. shelltools.export("GOROOT_FINAL", "/usr/lib/go")
  18. shelltools.export("GOROOT_BOOTSTRAP", "%s/go-go%s/go" % (get.workDIR(), get.srcVERSION())) #2
  19. #shelltools.export("GOROOT_BOOTSTRAP", "/usr/lib/go")
  20. shelltools.export("GOOS","linux")
  21. shelltools.export("GOARCH","amd64")
  22. shelltools.cd("src")
  23. shelltools.system("bash -x ./make.bash")
  24. def install():
  25. shelltools.export("GOROOT_FINAL", "/usr/lib/go")
  26. shelltools.cd("%s/go-go%s" % (get.workDIR(), get.srcVERSION()))
  27. pisitools.dodir("/usr/lib/go")
  28. shelltools.system("cp -r api bin doc lib pkg src %s/usr/lib/go" % get.installDIR())
  29. shelltools.system("chown -R root:root %s/usr" % get.installDIR())
  30. pisitools.dosym("/usr/lib/go/bin/go", "/usr/bin/go")
  31. pisitools.dosym("/usr/lib/go/bin/gofmt", "/usr/bin/gofmt")
  32. pisitools.dosym("/usr/lib/go/doc", "/usr/share/doc/%s/doc" % get.srcNAME())
  33. pisitools.dosym("/usr/lib/go/api", "/usr/share/doc/%s/api" % get.srcNAME())
  34. shelltools.system("cp -r misc %s/usr/lib/go" % get.installDIR())
  35. pisitools.insinto("/usr/lib/go", "go.env")
  36. pisitools.insinto("/usr/lib/go", "VERSION")
  37. pisitools.dosed("%s/usr/lib/go/go.env" % get.installDIR() , "auto", "local")
  38. #pisitools.removeDir("/usr/lib/go/pkg/bootstrap")
  39. # remove testdata, which hit cave fix-linkage
  40. pisitools.remove("/usr/lib/go/src/debug/elf/testdata/gcc-386-freebsd-exec")
  41. # pisitools.removeDir("/usr/lib/go/pkg/obj")
  42. # dirty fix thanks @erturk
  43. # pisitools.removeDir("/usr/lib/go/pkg/linux_amd64")
  44. pisitools.dodoc("LICENSE", "PATENTS", "README*")