summaryrefslogtreecommitdiff
path: root/hstcal-git/build.sh
blob: 32024ebd033cdd142272ddb929c6ebd371bf3e8b (plain) (blame)
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
#!/bin/bash
name=hstcal
version=2.3.2
revision=0
sources=()
build_depends=(
    "git"
    "python"
    "gcc==8.4.0"
)
depends=(
    "cfitsio"
)

_waf_version=2.0.20

function use_git_version() {
    version=$( set -o pipefail
        git describe --long 2>/dev/null \
            | sed 's/^[v|V]-//;s/\([^-]*-g\)/r\1/;s/-/\+/g' \
            || printf "r%s+%s" \
            "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    )
    spm_build_update_metadata
}

function prepare() {
    curl -L https://waf.io/waf-${_waf_version} > waf
    chmod +x waf

    git clone https://github.com/spacetelescope/${name}
    cd ${name}
    use_git_version

    if [[ $(uname -s) == Darwin ]]; then
        CC="${_runtime}/bin/gcc"
        LDFLAGS="-L${_runtime}/lib"

        export CC
    fi
}

function build() {
   ./waf configure --prefix="${_prefix}"
}

function package() {
    ./waf install --destdir="${_pkgdir}"
}