summaryrefslogtreecommitdiffstats
path: root/examples/packages/repo/pkg.toml
blob: a16c49c6dd8503ac8cd3c608df2a01f3421215ce (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
version_is_semver = false
patches = []

[dependencies]
build = []
runtime = []

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

[phases]

sourcecheck.script = '''
    filename="/inputs/src-{{this.sources.src.hash.hash}}.source"
    [[ -e $filename ]] || {
        echo  "MISSING: $filename"
        {{state "ERR" "Missing input"}}
        exit 1
    }
'''

depcheck.script = '''
    {{#each this.dependencies.runtime}}
        # Try to find sha of dependency {{this}}
        exp_sha="$(echo {{this}} | sed 's,.*\ =,,' | sha1sum | sed 's,\ \ -,,')"
        sha1sum /inputs/*pkg | grep "$exp_sha" || {
            echo "FAILED TO FIND SHA: $exp_sha"
            {{state "ERR" "Failed to find SHA"}}
            exit 1
        }
    {{/each}}
'''

build.script = '''
    mkdir /outputs
    echo "{{this.version}}" > /outputs/{{this.name}}-{{this.version}}.pkg

    {{state "OK"}}
'''