summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c284a28c7c5ad2b0188394813b72cde499b74be6 (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
54
55
56
57
# Maintainer: Moritz Poldrack <moritz@poldrack.dev>
# Contributor: Gökberk Yaltıraklı <aur at gkbrk dot com>
# Contributor: Stefan Tatschner <stefan@rumpelsepp.org>
# Contributor: Drew DeVault <sir@cmpwn.com>

pkgname=aerc-git
_pkgname=aerc
pkgver=0.14.0.r24.g276c30f
pkgrel=1
pkgdesc='Email Client for your Terminal'
arch=('x86_64')
url='https://aerc-mail.org/'
license=('MIT')
depends=('notmuch')
makedepends=('go' 'git' 'scdoc')
optdepends=('w3m: html viewer support' 'dante: proxy support')
provides=('aerc')
conflicts=('aerc')
source=(
	"${_pkgname}::git+https://git.sr.ht/~rjarry/${_pkgname}"
	"makefile-fix.patch"
)
sha512sums=(
	'SKIP'
	'aa374d17c4e704ec9adf696db547e6c8bdd4b13cacc4d0dbeb4010a687e3ad14db3ae8dfee1fd588ed004fcb21b871b8f2f967c38e93765750e32f31f3b2553b'
)
options=('!buildflags')

pkgver () {
    cd "${srcdir}/${_pkgname}"

    ( set -o pipefail
      git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
      printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    )
}

prepare () {
    cd "${srcdir}/${_pkgname}"
    git apply "${srcdir}/makefile-fix.patch"
}

build () {
    cd "${srcdir}/${_pkgname}"
    export CGO_LDFLAGS="${LDFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"
    export GOFLAGS="-buildmode=pie -trimpath -modcacherw -tags=notmuch"
    make PREFIX=/usr LIBEXECDIR=/usr/lib/aerc VERSION="${pkgver}" all
}

package () {
    cd "${srcdir}/${_pkgname}"
    make PREFIX=/usr LIBEXECDIR=/usr/lib/aerc DESTDIR=$pkgdir install
    install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/aerc/"
}