archrelease: copy trunk to extra-x86_64
[arch-packages.git] / libevent / repos / core-x86_64 / PKGBUILD
blob81ec467c78f5ad116e5cbaf11fb2cce539e8c289
1 # Contributor: Tom Gundersen <teg@jklm.no>
2 # Contributor: Judd <jvinet@zeroflux.org>
4 pkgbase=libevent
5 pkgname=(libevent libevent-docs)
6 pkgver=2.1.12
7 pkgrel=4
8 pkgdesc="Event notification library"
9 url="https://libevent.org/"
10 arch=(x86_64)
11 license=(BSD)
12 depends=(openssl)
13 makedepends=(cmake ninja python zlib doxygen)
14 options=(debug)
15 source=(
16   https://github.com/libevent/libevent/releases/download/release-$pkgver-stable/libevent-$pkgver-stable.tar.gz{,.asc}
17   EVENT__SIZEOF_TIME_T.patch
18   libevent-2.1.12-openssl-compat.patch
20 sha256sums=('92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb'
21             'SKIP'
22             '945fc885b15692721bc7ae52f5774ef4fab8cc0f6108baa8860ab368de8675cf'
23             'e41527c55f6dacc6453b13eeeea2664798496896b796abcd2a5c8304c9eb2bae')
24 validpgpkeys=('B35BF85BF19489D04E28C33C21194EBB165733EA'
25               '9E3AC83A27974B84D1B3401DB86086848EF8686D')
27 prepare() {
28   cd libevent-$pkgver-stable
30   # Fix Firefox build
31   patch -Np1 -i ../EVENT__SIZEOF_TIME_T.patch
33   # Fix build with OpenSSL 3.0
34   patch -Np1 -i ../libevent-2.1.12-openssl-compat.patch
37 build() {
38   cmake -S libevent-$pkgver-stable -B build -G Ninja \
39     -DCMAKE_BUILD_TYPE=None \
40     -DCMAKE_INSTALL_PREFIX=/usr \
41     -DCMAKE_SKIP_INSTALL_RPATH=TRUE \
42     -DEVENT__LIBRARY_TYPE=SHARED \
43     -DEVENT__DISABLE_REGRESS=OFF \
44     -DEVENT__DOXYGEN=ON
45   cmake --build build
48 check() {
49   cd build
50   ctest --output-on-failure --stop-on-failure -j$(nproc)
53 package_libevent() {
54   provides=(libevent{,_core,_extra,_openssl,_pthreads}-2.1.so)
55   optdepends=('python: event_rpcgen.py')
57   DESTDIR="$pkgdir" cmake --install build
59   mkdir -p doc/usr/share
60   mv {"$pkgdir",doc}/usr/share/doc
62   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 libevent-$pkgver-stable/LICENSE
65 package_libevent-docs() {
66   pkgdesc+=" (documentation)"
67   depends=()
69   mv doc/* "$pkgdir"