summaryrefslogtreecommitdiffstats
path: root/abs/core/libevent/PKGBUILD
blob: 96e87935f19e11f0b00db48dbe7aa805c779b227 (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
# Maintainer: Tom Gundersen <teg@jklm.no>
# Contributor: Judd <jvinet@zeroflux.org>

pkgname=libevent
pkgver=2.1.11
pkgrel=5
pkgdesc="An event notification library"
arch=('x86_64')
url="https://libevent.org/"
license=('BSD')
depends=('openssl')
makedepends=('cmake' 'python')
optdepends=('python: to use event_rpcgen.py')
source=(https://github.com/libevent/libevent/releases/download/release-$pkgver-stable/$pkgname-$pkgver-stable.tar.gz{,.asc}
        https://raw.githubusercontent.com/libevent/libevent/release-2.1.11-stable/cmake/Uninstall.cmake.in
        0001-Warn-if-forked-from-the-event-loop-during-event_reinit.patch)
sha256sums=('a65bac6202ea8c5609fd5c7e480e6d25de467ea1917c08290c521752f147283d'
            'SKIP'
            '1584d6e36642d930ac99d014a485fe886ec705b3f998d128c6d6f227e0454b72'
            '436e56c74c0af0b70c43eaae6bd32b760601d2d5fa98b8d2d026ffad18474e13')
validpgpkeys=('B35BF85BF19489D04E28C33C21194EBB165733EA'
              '9E3AC83A27974B84D1B3401DB86086848EF8686D')

prepare() {
  cd ${pkgname}-${pkgver}-stable
  patch -Np1 -R < ../0001-Warn-if-forked-from-the-event-loop-during-event_reinit.patch

  cp -n ../Uninstall.cmake.in cmake # https://github.com/libevent/libevent/issues/914 
}

build() {
  cd ${pkgname}-${pkgver}-stable
  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DEVENT__LIBRARY_TYPE=SHARED -S . -B build
  cmake --build build
}

check() {
  cd ${pkgname}-${pkgver}-stable
  cmake --build build --target test
}

package() {
  cd ${pkgname}-${pkgver}-stable
  cmake --build build --target install -- DESTDIR="$pkgdir"
  install -Dm 644 LICENSE "${pkgdir}"/usr/share/licenses/libevent/LICENSE
}