summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a53a0f74e59074b0e23bee443b6f3f3a6342e42a (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
# Maintainer: willemw <willemw12@gmail.com>
# Contributor: NicerSlicer <jans_coid at posteo dot de>
# Contributor: Christian Wieden <wiedenchr at gmail dot com>
# Contributor: Ricardo Band <me at xengi dot de>
# Contributor: Filip SzymaƄski <fszymanski at, fedoraproject.org>

pkgname=hstr-git
pkgver=2.3.r3.g6507ac7
pkgrel=1
pkgdesc="Bash and Zsh shell history suggest box - easily view, navigate, search and manage your command history"
arch=('x86_64')
url="https://github.com/dvorka/hstr"
license=('Apache')
makedepends=('git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

pkgver() {
  git -C $pkgname describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  sed -i "s|<ncursesw/curses.h>|<curses.h>|g" $pkgname/src/include/hstr{,_curses}.h
}

build() {
  cd $pkgname/build/tarball
  ./tarball-automake.sh

  CFLAGS=${CFLAGS/-Werror=format-security/}
  CXXFLAGS=${CXXFLAGS/-Werror=format-security/}

  cd ../..
  ./configure --prefix=/usr
  make
}

package() {
  install -Dm644 $pkgname/{Changelog,README.md} -t "$pkgdir/usr/share/doc/${pkgname%-git}"

  make -C $pkgname DESTDIR="$pkgdir/" install
  rm -f "$pkgdir/usr/bin/hh"
}