summaryrefslogtreecommitdiffstats
path: root/examples/packages/1/repo/pkg.toml
blob: b13f0693cba0f4f6a678b538bf33fa46c052fbff (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
version           = "1"
version_is_semver = false

# no patches by default
patches = []

[sources.src]
hash.type = "sha1"

[dependencies]
build           = []
runtime         = []

# Root description of phases
# can be overridden as well
[phases]

checksource.script = '''
    {{phase "Checking sources"}}
    {{progress 0}}

    echo "Sources for this Package:"
    {{#each sources}}
    echo "{{@key}} : {{this.url}}"
    echo "{{this.hash.type}}: {{this.hash.hash}}"

    if [ ! -e /inputs/{{@key}}-{{this.hash.hash}}.source ]; then
        {{state "ERR" "Failed to find source" }}
        exit 1
    fi
    {{/each}}
    {{progress 20}}

    echo "All sources:"
    echo "------------"

    ls /inputs

    echo "------------"
'''

unpack.script = '''
    {{phase "Unpacking sources"}}

    mkdir /build
    {{#each sources}}
    mv /inputs/{{@key}}-{{this.hash.hash}}.source /build/
    {{/each}}
    {{progress 40}}

    echo "Moving dependencies to /build"
    mv /inputs/*.pkg /build/
    {{progress 60}}


    ls /build
'''

package.script = '''
    {{phase "package"}}

    mkdir /outputs
    for f in /build/*; do
        cat "$f" | sed 's,^,  ,' >> /outputs/{{name}}-{{version}}.pkg
    done

    {{progress 100}}
    {{state "OK" "Finished"}}
'''