summaryrefslogtreecommitdiff
path: root/devel/cargo-c/MAKEPKG
blob: 3a56928dd46ac25acdaa49bb9805da47bb443344 (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
#!/bin/mkpkg
# description: Cargo applet to build and install C-ABI compatible libraries
# url: https://github.com/lu-zero/cargo-c

name=cargo-c
version=0.10.25
release=1
_cargo=0.99.0
depends=(rust curl libressl zlib)
makedeps=(cargo-audit)
source=(https://static.crates.io/crates/$name/$name-$version+cargo-$_cargo.crate)
renames=($name-$version.tar.gz)
sha256sums=(
    "6b2ddde58a8a773ccce4b6384acacd3ce01373f52717dd2424633ed46755c627"
)

patch() {
    export CARGO_HOME="$SRC/.cargo"
    cd $name-$version+cargo-$_cargo

    cargo vendor --locked ../vendor
    mkdir -p .cargo
    printf '%s\n' \
        '[source.crates-io]' \
        'replace-with = "vendored-sources"' \
        '' \
        '[source.vendored-sources]' \
        'directory = "../vendor"' \
        > .cargo/config.toml

    cargo audit
}

build() {
    export CARGO_HTTP_CAINFO=/etc/ssl/cert.pem
    export RUSTFLAGS="-C target-feature=-crt-static"
    cd $name-$version+cargo-$_cargo
    cargo build --release --offline --locked
    for b in cargo-cbuild cargo-cinstall cargo-ctest cargo-capi; do
        install -Dm755 target/release/$b $PKG/usr/bin/$b
    done
}

signify() {
    untrusted comment: public key
    RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
}

# vim: filetype=sh