config 2.51 KB
Newer Older
boklm's avatar
boklm committed
1
# vim: filetype=yaml sw=2
boklm's avatar
boklm committed
2
version: 1.7.5
boklm's avatar
boklm committed
3
4
5
6
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'

var:
  go14_version: 1.4.3
boklm's avatar
boklm committed
7
8
  container:
    use_container: 1
boklm's avatar
boklm committed
9
10
11
12
13
14
15

  setup: |
    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
boklm's avatar
boklm committed
16
    export PATH=/var/tmp/dist/go/bin:/var/tmp/dist/gopath/bin:"$PATH"
boklm's avatar
boklm committed
17
18
19
20
21
22
23

  # 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 optionaly var/go_lib_install as
  # a list of install targets.
  build_go_lib: |
    #!/bin/bash
24
    [% c("var/set_default_env") -%]
boklm's avatar
boklm committed
25
26
27
28
    [% 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
boklm's avatar
boklm committed
29
30
31
    [% FOREACH dep = c("var/go_lib_deps") -%]
      tar -C /var/tmp/dist -xf [% c('input_files_by_name/' _ dep) %]
    [% END -%]
boklm's avatar
boklm committed
32
33
34
    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") %]"
boklm's avatar
boklm committed
35
36
37
38
    for p in $(ls -1 $rootdir/*.patch 2> /dev/null | sort)
    do
      patch -p1 < $p
    done
boklm's avatar
boklm committed
39
    [% IF c("var/build_go_lib_pre"); GET c("var/build_go_lib_pre"); END; -%]
boklm's avatar
boklm committed
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
    [% 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-i686:
    var:
      GOOS: windows
      GOARCH: 386
  osx-x86_64:
    var:
      GOOS: darwin
61
      GOARCH: amd64
boklm's avatar
boklm committed
62
63
64
65
66
67
68
69
70
71
72
  linux:
    var:
      GOOS: linux
  linux-x86_64:
    var:
      GOARCH: amd64
  linux-i686:
    var:
      GOARCH: 386

input_files:
boklm's avatar
boklm committed
73
  - project: container-image
boklm's avatar
boklm committed
74
75
76
77
78
  - 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
boklm's avatar
boklm committed
79
    sha256sum: 4e834513a2079f8cbbd357502cccaac9507fd00a1efe672375798858ff291815
boklm's avatar
boklm committed
80
81
82
  - URL: 'https://golang.org/dl/go[% c("var/go14_version") %].src.tar.gz'
    name: go14
    sha256sum: 9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959