summaryrefslogtreecommitdiff
path: root/ybd/config/defaults.conf
blob: 8a20f31e3395e59870180bd7b2613845163307c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# Valid fields in a morph file
morph-fields: ['arch',
               'artifacts',
               'build-depends',
               'build-mode',
               'build-system',
               'chunks',
               'configuration-extensions',
               'contents',
               'description',
               'devices',
               'kind',
               'max-jobs',
               'morph',
               'name',
               'path',
               'prefix',
               'products',
               'strata',
               'ref',
               'repo',
               'sha',
               'subsystems',
               'submodules',
               'systems',
               'system-integration',
               'unpetrify-ref']

# Mapping from arch to cpu defaults
cpus:
  x86_32: 'i686'
  armv8l64: 'aarch64'
  armv8b64: 'aarch64_be'
  mips64b: 'mips64'
  mips64l: 'mips64el'
  mips32b: 'mips'
  mips32l: 'mipsel'

# Baserock definitions defaults
build-steps: ['pre-bootstrap-commands',
              'bootstrap-commands',
              'post-bootstrap-commands',
              'pre-configure-commands',
              'configure-commands',
              'post-configure-commands',
              'pre-build-commands',
              'build-commands',
              'post-build-commands',
              'pre-test-commands',
              'test-commands',
              'post-test-commands',
              'pre-install-commands',
              'install-commands',
              'post-install-commands',
              'pre-strip-commands',
              'strip-commands',
              'post-strip-commands']

build-systems:
  manual:
    # The special, default 'no-op' build system.
    configure-commands: []
    build-commands: []
    install-commands: []
    strip-commands: []
    indicators: []

  autotools:
    # GNU Autoconf and GNU Automake, or anything which follow the same pattern.
    configure-commands:
    - |
      export NOCONFIGURE=1
      if [ -e bootstrap ]; then ./bootstrap
      elif [ -e bootstrap.sh ]; then ./bootstrap.sh
      elif [ -e autogen ]; then ./autogen
      elif [ -e autogen.sh ]; then ./autogen.sh
      elif [ ! -e ./configure ]; then autoreconf -ivf
      fi
      ./configure --prefix="$PREFIX"
    build-commands:
    - make
    install-commands:
    - make DESTDIR="$DESTDIR" install
    strip-commands:
      - &autotools-strip-commands |
        find "$DESTDIR" -type f \
          '(' -perm -111 -o -name '*.so*' -o -name '*.cmxs' -o -name '*.node' ')' \
          -exec sh -ec \
          'read -n4 hdr <"$1"   # check for elf header
          if [ "$hdr" != "$(printf \x7ELF)" ]; then
            exit 0
          fi
          debugfile="$DESTDIR$PREFIX/lib/debug/$(basename "$1")"
          mkdir -p "$(dirname "$debugfile")"
          objcopy --only-keep-debug "$1" "$debugfile"
          chmod 644 "$debugfile"
          strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1"
          objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'
    indicators: [
            'autogen',
            'autogen.sh',
            'configure',
            'configure.ac',
            'configure.in',
            'configure.in.in', ]

  python-distutils:
    # The Python distutils build systems.
    configure-commands: []
    build-commands:
    - python setup.py build
    install-commands:
    - python setup.py install --prefix "$PREFIX" --root "$DESTDIR"
    strip-commands:
      - *autotools-strip-commands
    indicators: [ 'setup.py', ]

  cpan:
    # The Perl ExtUtil::MakeMaker build system.
    configure-commands:
      # This is subject to change, see: https://gerrit.baserock.org/#/c/986/
      - |
        perl Makefile.PL INSTALLDIRS=perl \
            INSTALLARCHLIB="$PREFIX/lib/perl" \
            INSTALLPRIVLIB="$PREFIX/lib/perl" \
            INSTALLBIN="$PREFIX/bin" \
            INSTALLSCRIPT="$PREFIX/bin" \
            INSTALLMAN1DIR="$PREFIX/share/man/man1" \
            INSTALLMAN3DIR="$PREFIX/share/man/man3"
    build-commands:
    - make
    install-commands:
    - make DESTDIR="$DESTDIR" install
    strip-commands:
      - *autotools-strip-commands
    indicators: [ 'Makefile.PL', ]

  cmake:
    # The CMake build system.
    configure-commands:
    - cmake -DCMAKE_INSTALL_PREFIX="$PREFIX"
    build-commands:
    - make
    install-commands:
    - make DESTDIR="$DESTDIR" install
    strip-commands:
      - *autotools-strip-commands
    indicators: [ 'CMakeLists.txt', ]

  qmake:
    # The Qt build system.
    configure-commands:
    - qmake -makefile
    build-commands:
    - make
    install-commands:
    - make INSTALL_ROOT="$DESTDIR" install
    strip-commands:
      - *autotools-strip-commands
    indicators: [ '.pro', ]

split-rules:
  chunk:
    - artifact: -bins
      include:
        - (usr/)?s?bin/.*
    - artifact: -libs
      include:
        - (usr/)?lib(32|64)?/lib[^/]*\.so(\.\d+)*
        - (usr/)libexec/.*
    - artifact: -devel
      include:
        - (usr/)?include/.*
        - (usr/)?lib(32|64)?/lib.*\.a
        - (usr/)?lib(32|64)?/lib.*\.la
        - (usr/)?(lib(32|64)?|share)/pkgconfig/.*\.pc
    - artifact: -doc
      include:
        - (usr/)?share/doc/.*
        - (usr/)?share/man/.*
        - (usr/)?share/info/.*
    - artifact: -locale
      include:
        - (usr/)?share/locale/.*
        - (usr/)?share/i18n/.*
        - (usr/)?share/zoneinfo/.*
    - artifact: -misc
      include:
        - .*

  stratum:
    - artifact: -devel
      include:
        - .*-devel
        - .*-debug
        - .*-doc
    - artifact: -runtime
      include:
        - .*-bins
        - .*-libs
        - .*-locale
        - .*-misc
        - .*