summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f277d84cf6ad758e27fd31410498714ec089ba20 (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
pkgname="paths-bookmarks-git"
pkgver=r106.3c2a675
pkgrel=1
pkgdesc="Save often used directories like bookmarks"
arch=("x86_64")
url="https://github.com/sproott/pat.hs"
license=("MIT")
makedepends=("git" "stack")
optdepends=()
install="${pkgname}.install"
provides=("paths-bookmarks")
source=("${pkgname}::git+https://github.com/sproott/pat.hs.git")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${pkgname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "${srcdir}/${pkgname}"
  mkdir -p "bin"
  stack --local-bin-path "bin/" install
}

package() {
  cd "${srcdir}/${pkgname}"

  # Install binary
  install -Dm755 "bin/paths" "${pkgdir}/usr/share/paths/paths"
  install -Dm755 "bin/paths.sh" "${pkgdir}/usr/share/paths/paths.sh"
  install -Dm755 "bin/paths.fish" "${pkgdir}/usr/share/paths/paths.fish"

  # Install shell completions
  install -Dm644 "bin/completions/bashcompletion.sh" "${pkgdir}/usr/share/bash-completion/completions/paths"
  install -Dm644 "bin/completions/fishcompletion.fish" "${pkgdir}/usr/share/fish/completions/paths.fish"
}