config 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # vim: filetype=yaml sw=2
  2. version: 1.8.3
  3. filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
  4. var:
  5. go14_version: 1.4.3
  6. container:
  7. use_container: 1
  8. setup: |
  9. [% c("var/setarch") -%]
  10. mkdir -p /var/tmp/dist
  11. tar -C /var/tmp/dist -xf $rootdir/[% c("go_tarfile") %]
  12. export GOOS=[% c("var/GOOS") %]
  13. export GOARCH=[% c("var/GOARCH") %]
  14. export GOPATH=/var/tmp/dist/gopath
  15. export PATH=/var/tmp/dist/go/bin:/var/tmp/dist/gopath/bin:"$PATH"
  16. # Template build script for building a go library.
  17. # This can be called as projects/go/var/build_go_lib.
  18. # You need to define /var/go_lib, and optionaly var/go_lib_install as
  19. # a list of install targets.
  20. build_go_lib: |
  21. #!/bin/bash
  22. [% c("var/set_default_env") -%]
  23. [% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
  24. distdir=/var/tmp/dist/[% project %]
  25. mkdir -p /var/tmp/build
  26. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  27. [% FOREACH dep = c("var/go_lib_deps") -%]
  28. tar -C /var/tmp/dist -xf [% c('input_files_by_name/' _ dep) %]
  29. [% END -%]
  30. mkdir -p $(dirname "$GOPATH/src/[% c("var/go_lib") %]")
  31. mv /var/tmp/build/[% project %]-[% c('version') %] "$GOPATH/src/[% c("var/go_lib") %]"
  32. cd "$GOPATH/src/[% c("var/go_lib") %]"
  33. for p in $(ls -1 $rootdir/*.patch 2> /dev/null | sort)
  34. do
  35. patch -p1 < $p
  36. done
  37. [% IF c("var/build_go_lib_pre"); GET c("var/build_go_lib_pre"); END; -%]
  38. [% IF c("var/go_lib_install") -%]
  39. [% FOREACH inst IN c("var/go_lib_install") %]
  40. go install [% inst %]
  41. [% END %]
  42. [% ELSE %]
  43. go install [% c("var/go_lib") %]
  44. [% END %]
  45. cd /var/tmp/dist
  46. [% c('tar', {
  47. tar_src => [ 'gopath' ],
  48. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  49. }) %]
  50. targets:
  51. windows:
  52. var:
  53. GOOS: windows
  54. windows-i686:
  55. var:
  56. GOARCH: 386
  57. windows-x86_64:
  58. var:
  59. GOARCH: amd64
  60. osx-x86_64:
  61. var:
  62. GOOS: darwin
  63. GOARCH: amd64
  64. arch_deps:
  65. - faketime
  66. linux:
  67. var:
  68. GOOS: linux
  69. linux-x86_64:
  70. var:
  71. GOARCH: amd64
  72. linux-i686:
  73. var:
  74. GOARCH: 386
  75. input_files:
  76. - project: container-image
  77. - name: '[% c("var/compiler") %]'
  78. project: '[% c("var/compiler") %]'
  79. enable: '[% c("var/windows") || c("var/osx") %]'
  80. - URL: 'https://golang.org/dl/go[% c("version") %].src.tar.gz'
  81. name: go
  82. sha256sum: 5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6
  83. - URL: 'https://golang.org/dl/go[% c("var/go14_version") %].src.tar.gz'
  84. name: go14
  85. sha256sum: 9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959