peco-0.3.5_make.patch 822 B

1234567891011121314151617181920212223242526272829303132
  1. diff --git a/build/make.go b/build/make.go
  2. index c094249..ac8936b 100644
  3. --- a/build/make.go
  4. +++ b/build/make.go
  5. @@ -59,6 +59,9 @@ func main() {
  6. case "build":
  7. setupDeps()
  8. buildBinaries()
  9. + case "build-single":
  10. + setupPecoInGopath()
  11. + buildSingleBinary()
  12. default:
  13. panic("Unknown action: " + action)
  14. }
  15. @@ -201,6 +204,17 @@ func buildBinaryFor(osname, arch string) {
  16. run("mv", file, filepath.Join(getBuildDir(), "artifacts"))
  17. }
  18. +func buildSingleBinary() {
  19. + buildDir := getBuildDir()
  20. + var goPath = fmt.Sprintf("%s:%s", buildDir, os.Getenv("GOPATH"))
  21. + os.Setenv("GOPATH", goPath)
  22. +
  23. + run("go", "build", "-o",
  24. + filepath.Join("peco", "peco"),
  25. + filepath.Join("cmd", "peco", "peco.go"),
  26. + )
  27. +}
  28. +
  29. func run(name string, args ...string) error {
  30. splat := []string{name}
  31. splat = append(splat, args...)