12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- # vim: filetype=yaml sw=2
- version: 1.11.5
- filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
- var:
- go14_version: 1.4.3
- container:
- use_container: 1
- setup: |
- [% c("var/setarch") -%]
- mkdir -p /var/tmp/dist
- tar -C /var/tmp/dist -xf $rootdir/[% c("go_tarfile") %]
- export GOOS=[% c("var/GOOS") %]
- export GOARCH=[% c("var/GOARCH") %]
- export GOPATH=/var/tmp/dist/gopath
- export PATH=/var/tmp/dist/go/bin:/var/tmp/dist/gopath/bin:"$PATH"
- [% IF c("var/linux-i686") -%]
- export CGO_ENABLED=1
- [% END -%]
- # Template build script for building a go library.
- # This can be called as projects/go/var/build_go_lib.
- # You need to define /var/go_lib, and optionally var/go_lib_install as
- # a list of install targets.
- build_go_lib: |
- #!/bin/bash
- [% c("var/set_default_env") -%]
- [% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
- distdir=/var/tmp/dist/[% project %]
- mkdir -p /var/tmp/build
- tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
- [% FOREACH dep = c("var/go_lib_deps") -%]
- tar -C /var/tmp/dist -xf [% c('input_files_by_name/' _ dep) %]
- [% END -%]
- mkdir -p $(dirname "$GOPATH/src/[% c("var/go_lib") %]")
- mv /var/tmp/build/[% project %]-[% c('version') %] "$GOPATH/src/[% c("var/go_lib") %]"
- cd "$GOPATH/src/[% c("var/go_lib") %]"
- for p in $(ls -1 $rootdir/*.patch 2> /dev/null | sort)
- do
- patch -p1 < $p
- done
- [% IF c("var/build_go_lib_pre"); GET c("var/build_go_lib_pre"); END; -%]
- [% IF c("var/go_lib_install") -%]
- [% FOREACH inst IN c("var/go_lib_install") %]
- go install [% inst %]
- [% END %]
- [% ELSE %]
- go install [% c("var/go_lib") %]
- [% END %]
- cd /var/tmp/dist
- [% c('tar', {
- tar_src => [ 'gopath' ],
- tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
- }) %]
- targets:
- windows:
- var:
- GOOS: windows
- windows-i686:
- var:
- GOARCH: 386
- windows-x86_64:
- var:
- GOARCH: amd64
- osx-x86_64:
- var:
- GOOS: darwin
- GOARCH: amd64
- arch_deps:
- - faketime
- linux:
- var:
- GOOS: linux
- linux-x86_64:
- var:
- GOARCH: amd64
- linux-i686:
- var:
- GOARCH: 386
- input_files:
- - project: container-image
- - name: '[% c("var/compiler") %]'
- project: '[% c("var/compiler") %]'
- enable: '[% c("var/windows") || c("var/osx") %]'
- - URL: 'https://golang.org/dl/go[% c("version") %].src.tar.gz'
- name: go
- sha256sum: bc1ef02bb1668835db1390a2e478dcbccb5dd16911691af9d75184bbe5aa943e
- - URL: 'https://golang.org/dl/go[% c("var/go14_version") %].src.tar.gz'
- name: go14
- sha256sum: 9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959
|