123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- # vim: filetype=yaml sw=2
- version: 1.13.11
- filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
- var:
- go14_version: 1.4.3
- container:
- use_container: 1
- setup: |
- mkdir -p /var/tmp/dist
- tar -C /var/tmp/dist -xf $rootdir/[% c("go_tarfile") %]
- [% IF pc(c("origin_project"), "var/no_crosscompile") -%]
- export GOOS=linux
- export GOARCH=amd64
- [% ELSE -%]
- export GOOS=[% c("var/GOOS") %]
- export GOARCH=[% c("var/GOARCH") %]
- [% END -%]
- # Run in GOPATH mode: https://golang.org/cmd/go/#hdr-Module_support. (see:
- # #32027)
- export GO111MODULE=off
- export GOPATH=/var/tmp/dist/gopath
- export PATH=/var/tmp/dist/go/bin:/var/tmp/dist/gopath/bin:"$PATH"
- [% IF c("var/linux") -%]
- export CGO_LDFLAGS_ALLOW="-z|noexecstack"
- export CGO_LDFLAGS="-z noexecstack"
- [% END -%]
- [% IF c("var/linux-i686") -%]
- export CGO_ENABLED=1
- [% END -%]
- export GOTMPDIR=/var/tmp/build/go-tmp
- mkdir -p "$GOTMPDIR"
- # 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
- # Run in GOPATH mode: https://golang.org/cmd/go/#hdr-Module_support. (see:
- # #32027)
- export GO111MODULE=off
- [% 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
- linux-arm:
- var:
- GOARCH: arm
- android:
- var:
- GOOS: android
- android-x86:
- var:
- GOARCH: 386
- android-x86_64:
- var:
- GOARCH: amd64
- android-armv7:
- var:
- GOARCH: arm
- android-aarch64:
- var:
- GOARCH: arm64
- input_files:
- - project: container-image
- - name: '[% c("var/compiler") %]'
- project: '[% c("var/compiler") %]'
- enable: '[% ! c("var/linux") || c("var/linux-cross") %]'
- - URL: 'https://golang.org/dl/go[% c("version") %].src.tar.gz'
- name: go
- sha256sum: 89ed1abce25ad003521c125d6583c93c1280de200ad221f961085200a6c00679
- - URL: 'https://golang.org/dl/go[% c("var/go14_version") %].src.tar.gz'
- name: go14
- sha256sum: 9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959
- - filename: 0001-Use-fixed-go-build-tmp-directory.patch
- enable: '[% c("var/android") %]'
|