summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b37de3d8a3c1209eb3c09e6199a2024c5faac673 (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
# Maintainer: a821
# Contributor: Frederic Bezies <fredbezies at gmail dot com>
# Contributor: sudokode <sudokode@gmail.com>
# Contributor: Marcin Kulik <m@kulik.com>

pkgname=asciinema-git
pkgver=3.0.0rc.3.r26.g2728a10
pkgrel=2
pkgdesc="Record and share your terminal sessions"
arch=('x86_64')
url="https://github.com/asciinema/asciinema"
license=('GPL-3.0-only')
depends=('gcc-libs' 'glibc')
makedepends=('git' 'cargo')
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}")
source=("$pkgname::git+${url}.git")
sha256sums=('SKIP')
options=(!lto !debug)

pkgver() {
  cd $pkgname
  git describe --long --tags | sed -r 's/^v//;s/-([0-9]+)-g(.+)/.r\1.g\2/;s/-//g'
}

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

build() {
  cd $pkgname
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  ASCIINEMA_GEN_DIR="$srcdir" cargo build --frozen --release --all-features
}

package() {
  install -Dm755 $pkgname/target/release/asciinema -t "${pkgdir}/usr/bin"
  install -Dm644 man/*.1 -t "${pkgdir}/usr/share/man/man1"

  pushd completion
  install -Dm644 asciinema.fish -t "${pkgdir}/usr/share/fish/vendor_completions.d/"
  install -Dm644 asciinema.bash "${pkgdir}/usr/share/bash-completion/completions/asciinema"
  install -Dm644 _asciinema -t "${pkgdir}/usr/share/zsh/site-functions/"
  install -Dm644 asciinema.elv -t "${pkgdir}/usr/share/elvish/lib"
  # not sure where these files should go; copying them to the dir below
  install -Dm644 *.ps1 -t "${pkgdir}/usr/share/${pkgname}/completion"
  popd
}

# vim:set ts=2 sw=2 et: