# Maintainer: Michał Adamski <michal@ert.pl>
pkgname=libsecp256k1
pkgver=0.5.0
pkgrel=1
pkgdesc="Optimized C library for EC operations on curve secp256k1"
url="https://github.com/bitcoin-core/secp256k1"
arch="all"
license="MIT"
makedepends="autoconf automake libtool"
subpackages="$pkgname-dev"
source="https://github.com/bitcoin-core/secp256k1/archive/v$pkgver/secp256k1-v$pkgver.tar.gz"
builddir="$srcdir/secp256k1-$pkgver"

prepare() {
	default_prepare

	./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-static \
		--enable-module-ecdh \
		--enable-module-recovery \
		--enable-module-schnorrsig \
		--enable-module-extrakeys \
		--disable-benchmark \
		--disable-exhaustive-tests \
		--disable-examples
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
b8511b0d8b581d371ee48f2c8a5a72930e7a0686a860200e56e83e2f58a63f2d781af75829d922e98f6648d361e20efde29abcf52c086b77647457c6c3586e78  secp256k1-v0.5.0.tar.gz
"
