summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 39eb78583777d601e023a90b23395c5d8306f28d (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
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Mark Wagie <mark dot wagie at tutanota dot com>
# Contributor: atemu

pkgname=yup-git
pkgver=1.1.7.r3.g2efd810
pkgrel=1
pkgdesc="Ncurses based AUR Helper with improved searching and sorting"
arch=('x86_64' 'aarch64')
url="https://github.com/ericm/yup"
license=('GPL3')
depends=('pacman>=5.1' 'ncurses')
makedepends=('git' 'go')
optdepends=('sudo')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=('git+https://github.com/ericm/yup.git')
sha256sums=('SKIP')

prepare() {
  # Prevent creation of a `go` directory in one's home.
  # Sometimes this directory cannot be removed with even `rm -rf` unless
  # one becomes root or changes the write permissions.
  export GOPATH="$srcdir/gopath"
  go clean -modcache
}

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

build() {
  cd "$srcdir/${pkgname%-git}"
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
  make

  # Clean mod cache for makepkg -C
  go clean -modcache
}

package() {
  cd "$srcdir/${pkgname%-git}"
  make PREFIX="$pkgdir/usr" install
}