summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8969d77b3082ba162bfb2874c273d2e1c63c671d (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
50
51
52
53
54
55
# Maintainer: tuftedocelot@fastmail.fm
# Maintainer: Filipe Nascimento <flipee at tuta dot io>

_pkgname=exa
pkgname=${_pkgname}-git
pkgver=0.10.1.r33.g3f24f7c
pkgrel=1
pkgdesc='Replacement for ls written in Rust'
arch=('i686' 'x86_64')
url="https://github.com/ogham/exa"
license=('MIT')
depends=('libgit2')
makedepends=('cargo' 'git' 'pandoc')
provides=('exa')
conflicts=('exa')
source=("git+https://github.com/ogham/exa.git")
md5sums=('SKIP')

pkgver() {
    cd $_pkgname
    printf "%s" "$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')"
}

prepare() {
    cd $_pkgname
    cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
    cd $_pkgname
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cargo build --frozen --release
    mkdir -p target/release/man
    pandoc --standalone -f markdown -t man man/exa.1.md        > "target/release/man/exa.1"
    pandoc --standalone -f markdown -t man man/exa_colors.5.md > "target/release/man/exa_colors.5"
}

package() {
    cd $_pkgname
    install -Dm755 "target/release/$_pkgname" \
        -t "$pkgdir/usr/bin"
    install -Dm644 completions/bash/$_pkgname \
        -t "$pkgdir/usr/share/bash-completion/completions"
    install -Dm644 completions/zsh/_$_pkgname \
        -t "$pkgdir/usr/share/zsh/site-functions"
    install -Dm644 completions/fish/$_pkgname.fish \
        -t "$pkgdir/usr/share/fish/vendor_completions.d"
    install -Dm644 LICEN?E \
        "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    install -Dm644 "target/release/man/$_pkgname.1" \
        -t "$pkgdir/usr/share/man/man1"
    install -Dm644 "target/release/man/${_pkgname}_colors.5" \
        -t "$pkgdir/usr/share/man/man5"
}