summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 34ca05fdaa023efa3d0fabc0afdaae2a7084dd17 (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
# Maintainer: Daniel Bermond <dbermond@archlinux.org>

pkgname=cargo-c-git
pkgver=0.6.2.r0.g59ee00a
pkgrel=1
pkgdesc='A cargo subcommand to build and install C-ABI compatibile dynamic and static libraries (git version)'
arch=('x86_64')
url='https://github.com/lu-zero/cargo-c/'
license=('MIT')
depends=('curl' 'openssl' 'zlib')
makedepends=('git' 'rust')
provides=('cargo-c')
conflicts=('cargo-c')
source=('git+https://github.com/lu-zero/cargo-c.git')
sha256sums=('SKIP')

prepare() {
    cargo fetch --manifest-path='cargo-c/Cargo.toml'
}

pkgver() {
    git -C cargo-c describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//'
}

build() {
    cargo build --release --frozen --manifest-path='cargo-c/Cargo.toml'
}

check() {
    cargo test --release --frozen --manifest-path='cargo-c/Cargo.toml'
}

package() {
    install -D -m755 cargo-c/target/release/cargo-c{build,install} -t "${pkgdir}/usr/bin"
    install -D -m644 cargo-c/LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}