summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 87ee49cc71a41edc1f075ed548d89e3efb592321 (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
# Maintainer: Jesin <Jesin00@gmail.com>
pkgname=libb2-git
_name="${pkgname%-git}"
pkgver=0.98.1
pkgrel=1
arch=(x86_64)
pkgdesc='C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp hash functions'
url=https://blake2.net/
license=(custom:CC0)
makedepends=(git)
provides=("$_name=${pkgver%%+*}")
conflicts=("$_name")
source=("git+https://github.com/BLAKE2/$_name")
sha256sums=(SKIP)

# libb2's build system discards the $CFLAGS variable.
# We can get around this by putting those flags in $CC.
export CC="${CC-cc} $CFLAGS"

prepare() {
	cd "$_name"
	# If there are no tags, tag the initial commit so pkgver() can work.
	[ -n "$(git tag)" ] || git tag 0.0 "$(git rev-list --max-parents=0 --reverse HEAD | head -n1)"
	autoreconf -fisv
}

pkgver() {
	cd "$_name"
	local v="$(git describe --tags)"
	v="${v#v}"
	printf %s "${v//-/+}"
}

build() {
	cd "$_name"
	./configure --prefix=/usr --disable-static --enable-shared "--build=$CHOST" #--disable-native --enable-fat
	# Uncomment the flags at the end of the previous line if you intend
	# to distribute the binary package to other computers.
	make
}

check() {
	cd "$_name"
	make check
}

package() {
	cd "$_name"
	make "DESTDIR=$pkgdir" install
	install -Dm644 "-t$pkgdir/usr/share/licenses/$_name" COPYING
}