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

pkgname=asciinema-git
pkgver=3.1.0.r15.gac5274c
pkgrel=1
pkgdesc="Record and share your terminal sessions"
arch=('x86_64')
url="https://github.com/asciinema/asciinema"
license=('GPL-3.0-only')
depends=('libgcc' 'glibc')
makedepends=('git' 'cargo')
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}")
source=("$pkgname::git+${url}.git")
sha256sums=('SKIP')
options=(!lto)

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 --print host-tuple)"
}

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: