archrelease: copy trunk to community-any
[ArchLinux/community.git] / lib32-libevent / repos / multilib-x86_64 / PKGBUILD
blobb423fc832582bdccda51bfc1c8fef0f02e03a323
1 # Maintainer: Sven-Hendrik Haase <svenstaro@gmail.com>
2 # Contributor: Tom Gundersen <teg@jklm.no>
3 # Contributor: Judd <jvinet@zeroflux.org>
5 pkgname=lib32-libevent
6 pkgver=2.1.12
7 pkgrel=3
8 pkgdesc="Event notification library (32-bit)"
9 url="https://libevent.org/"
10 arch=(x86_64)
11 license=(BSD)
12 depends=(lib32-openssl libevent)
13 makedepends=(cmake ninja python lib32-zlib)
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
19   multilib.diff
21 sha256sums=('92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb'
22             'SKIP'
23             '945fc885b15692721bc7ae52f5774ef4fab8cc0f6108baa8860ab368de8675cf'
24             'e41527c55f6dacc6453b13eeeea2664798496896b796abcd2a5c8304c9eb2bae'
25             '4a28281e4dad7651db9167e7740d334274abbf762a03bcd41de4e075acde0e82')
26 validpgpkeys=('B35BF85BF19489D04E28C33C21194EBB165733EA'
27               '9E3AC83A27974B84D1B3401DB86086848EF8686D')
29 prepare() {
30   cd libevent-$pkgver-stable
32   # Fix Firefox build
33   patch -Np1 -i ../EVENT__SIZEOF_TIME_T.patch
35   # Fix build with OpenSSL 3.0
36   patch -Np1 -i ../libevent-2.1.12-openssl-compat.patch
38   # Install to /usr/lib32
39   patch -Np1 -i ../multilib.diff
42 build() {
43   export CC="gcc -m32"
44   export CXX="g++ -m32"
45   export PKG_CONFIG="i686-pc-linux-gnu-pkg-config"
47   cmake -S libevent-$pkgver-stable -B build -G Ninja \
48     -DCMAKE_BUILD_TYPE=None \
49     -DCMAKE_INSTALL_PREFIX=/usr \
50     -DCMAKE_SKIP_INSTALL_RPATH=TRUE \
51     -DEVENT__LIBRARY_TYPE=SHARED \
52     -DEVENT__DISABLE_REGRESS=OFF \
53     -DEVENT__DOXYGEN=OFF
54   cmake --build build
57 check() {
58   cd build
59   ctest --output-on-failure --stop-on-failure -j$(nproc)
62 package() {
63   provides=(libevent{,_core,_extra,_openssl,_pthreads}-2.1.so)
65   DESTDIR="$pkgdir" cmake --install build
67   rm -r "$pkgdir"/usr/{bin,include}
69   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 libevent-$pkgver-stable/LICENSE