summaryrefslogtreecommitdiff
path: root/tests/show-dependencies.setup
blob: 74d10c2b64cba06f25eb6437a9d4a73a9f8f44b4 (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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
#!/bin/bash
#
# Copyright (C) 2012-2014  Codethink Limited
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

set -e

source "$SRCDIR/scripts/fix-committer-info"

# Create a repository
repo="$DATADIR/test-repo"
mkdir "$repo"
cd "$repo"
git init --quiet

# Add a single source file to simulate compiling
cat <<EOF > hello.c
#include <stdio.h>
int main(void)
{
    puts("hello, world");
    return 0;
}
EOF
git add hello.c

# Define a couple of chunk morphologies for the GTK stack
gtkcomponents=(freetype fontconfig cairo pango glib gdk-pixbuf gtk 
               dbus-glib dbus)
for component in "${gtkcomponents[@]}"
do
    cat <<EOF > $component.morph
name: $component
kind: chunk
build-commands:
  - gcc -o hello hello.c
install-commands:
  - install -d "\$DESTDIR"/etc
  - install -d "\$DESTDIR"/bin
  - install hello "\$DESTDIR"/bin/$component
EOF
    git add $component.morph
done
git commit --quiet -m "add .c source file and GTK chunk morphologies" 

# Define a stratum for the GTK stack
cat <<EOF > gtk-stack.morph
name: gtk-stack
kind: stratum
build-depends: []
chunks:
  - name: freetype
    repo: test:test-repo
    ref: master
    build-depends: []
    build-mode: bootstrap
  - name: fontconfig
    repo: test:test-repo
    ref: master
    build-depends: []
    build-mode: bootstrap
  - name: cairo
    repo: test:test-repo
    ref: master
    build-depends: []
    build-mode: bootstrap
  - name: pango
    repo: test:test-repo
    ref: master
    build-depends:
      - freetype
      - fontconfig
  - name: glib
    repo: test:test-repo
    ref: master
    build-depends: []
    build-mode: bootstrap
  - name: gdk-pixbuf
    repo: test:test-repo
    ref: master
    build-depends:
      - glib
  - name: gtk
    repo: test:test-repo
    ref: master
    build-depends:
      - cairo
      - gdk-pixbuf
      - glib
      - pango
  - name: dbus
    repo: test:test-repo
    ref: master
    build-depends: []
    build-mode: bootstrap
  - name: dbus-glib
    repo: test:test-repo
    ref: master
    build-depends:
      - dbus
      - glib
EOF
git add gtk-stack.morph
git commit --quiet -m "add gtk-stack.morph stratum"

# Add a single source file to simulate compiling
cat <<EOF > hello.c
#include <stdio.h>
int main(void)
{
    puts("hello, world");
    return 0;
}
EOF
git add hello.c

# Define a couple of chunk morphologies for the GTK stack
xfcecomponents=(xfce4-dev-tools libxfce4util libxfce4ui exo xfconf garcon 
                thunar tumbler xfce4-panel xfce4-settings xfce4-session 
                xfwm4 xfdesktop xfce4-appfinder gtk-xfce-engine)
for component in "${xfcecomponents[@]}"
do
    cat <<EOF > $component.morph
name: $component
kind: chunk
build-commands:
  - gcc -o hello hello.c
install-commands:
  - install -d "\$DESTDIR"/etc
  - install -d "\$DESTDIR"/bin
  - install hello "\$DESTDIR"/bin/$component
EOF
    git add $component.morph
done
git commit --quiet -m "add .c source file and GTK chunk morphologies"

# Define a stratum for the Xfce core
cat <<EOF > xfce-core.morph
name: xfce-core
kind: stratum
build-depends:
  - morph: gtk-stack
chunks:
  - name: libxfce4util
    repo: test:test-repo
    ref: master
    build-depends: []
  - name: xfconf
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4util
  - name: libxfce4ui
    repo: test:test-repo
    ref: master
    build-depends:
      - xfconf
  - name: exo
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4util
  - name: garcon
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4util
  - name: thunar
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4ui
      - exo
  - name: tumbler
    repo: test:test-repo
    ref: master
    build-depends: []
  - name: xfce4-panel
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4ui
      - exo
      - garcon
  - name: xfce4-settings
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4ui
      - exo
      - xfconf
  - name: xfce4-session
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4ui
      - exo
      - xfconf
  - name: xfwm4
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4ui
      - xfconf
  - name: xfdesktop
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4ui
      - xfconf
  - name: xfce4-appfinder
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4ui
      - garcon
      - xfconf
  - name: gtk-xfce-engine
    repo: test:test-repo
    ref: master
    build-depends:
      - libxfce4ui
      - garcon
      - xfconf
EOF
git add xfce-core.morph
git commit --quiet -m "add xfce-core.morph stratum"

cat <<EOF > xfce-system.morph
name: xfce-system
kind: system
arch: $("$SRCDIR/scripts/test-morph" print-architecture)
strata:
  - morph: xfce-core
    build-mode: bootstrap
EOF
git add xfce-system.morph
git commit --quiet -m "add xfce-system"