summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2cf1a1b4d2ca30e73eb89580c47494e25ad135f9 (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
# Maintainer: Mateusz Maćkowski <mateusz@mackowski.org>

pkgname=cargo-loc
pkgver=0.1.2
pkgrel=1
pkgdesc="Counts the lines of code across your entire dependency tree in a Cargo project"
arch=(x86_64)
url="https://github.com/Shnatsel/cargo-loc"
license=('MIT OR Apache-2.0')
depends=(glibc gcc-libs)
makedepends=(cargo git)
options=(!debug !lto)
source=("git+https://github.com/Shnatsel/cargo-loc.git#commit=5a35f7b495d4743396db7d90ab7be80913a20538")
md5sums=('SKIP')
sha256sums=('SKIP')
b2sums=('SKIP')

export RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN:-stable}
export RUSTFLAGS="${RUSTFLAGS} --remap-path-prefix $srcdir=src"

prepare() {
    cd "$pkgname"

    cargo fetch --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
    cd "$pkgname"

    cargo build --frozen --release --all-features --target-dir target
}

package() {
    cd "$pkgname"

    install -Dm 755 -t "${pkgdir}/usr/bin" target/release/cargo-loc
}