summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 93efb016f8079778bfb6eee04dd6f2d1c59c473a (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
# Maintainer: "Amhairghin" Oscar Garcia Amor (https://ogarcia.me)

pkgname=cc-cli
pkgver=0.1.5
pkgrel=1
pkgdesc='handy git-hook and cli for conventional commits'
arch=('arm' 'armv6h' 'armv7h' 'aarch64' 'i686' 'x86_64')
url='https://github.com/sousandrei/cc-cli'
license=('GPL3')
depends=('gcc-libs' 'openssl')
makedepends=('rust')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/sousandrei/${pkgname}/archive/v${pkgver}.tar.gz")
b2sums=('5203b76a6a57e54edaba9465b5a463396793238c876443044bc24c15adadd5be28b49c6277d2f6d178ea12031163746850cdd05deb593b3d6d5d7fb249a4a465')

prepare() {
  cd "${pkgname}-${pkgver}"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd "${pkgname}-${pkgver}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release
}

package() {
  # binary
  install -Dm755 "${srcdir}/${pkgname}-${pkgver}/target/release/${pkgname}" \
    "${pkgdir}/usr/bin/${pkgname}"
  # readme
  install -Dm644 "${srcdir}/${pkgname}-${pkgver}/README.md" \
    "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}