summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 45f3a5f7fafd69654ac2090565d49adafb28195a (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
58
59
60
# Maintainer: Vitaly Drogan <vitaliy.drogan@gmail.com>

# Previos maintainer: Andy Weidenbaum <archbaum@gmail.com>

pkgname=libsecp256k1-git
pkgver=20220206
pkgrel=1
pkgdesc="Optimized C library for EC operations on curve secp256k1"
arch=('aarch64' 'arm' 'armv6h' 'armv7h' 'i686' 'x86_64')
url="https://github.com/bitcoin-core/secp256k1"
makedepends=('autoconf' 'automake' 'git' 'm4' 'make' 'pkg-config')
license=('MIT')
source=(${pkgname%-git}::git+https://github.com/bitcoin-core/secp256k1)
sha256sums=('SKIP')
provides=('libsecp256k1')
conflicts=('libsecp256k1')

pkgver() {
  cd ${pkgname%-git}
  git log -1 --format="%cd" --date=short --no-show-signature | sed "s|-||g"
}

build() {
  cd ${pkgname%-git}

  msg2 'Building...'
  ./autogen.sh
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --libexecdir=/usr/lib/libsecp256k1 \
    --sysconfdir=/etc \
    --sharedstatedir=/usr/share/libsecp256k1 \
    --localstatedir=/var/lib/libsecp256k1 \
    --enable-module-ecdh \
    --enable-module-recovery \
    --enable-module-extrakeys \
    --enable-experimental \
    --enable-module-schnorrsig \
    --disable-tests \
    --with-gnu-ld
  make
}

package() {
  cd ${pkgname%-git}

  msg2 'Installing license...'
  install -Dm 644 COPYING -t "$pkgdir/usr/share/licenses/libsecp256k1"

  msg2 'Installing documentation'
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/libsecp256k1"

  msg2 'Installing...'
  make DESTDIR="$pkgdir" install

  msg2 'Cleaning up pkgdir...'
  find "$pkgdir" -type d -name .git -exec rm -r '{}' +
  find "$pkgdir" -type f -name .gitignore -exec rm -r '{}' +
}