2015-01-20 04:47:44 +01:00
|
|
|
package=libevent
|
2023-06-20 15:28:05 +02:00
|
|
|
$(package)_version=2.1.12-stable
|
|
|
|
$(package)_download_path=https://github.com/libevent/libevent/releases/download/release-$($(package)_version)/
|
|
|
|
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
|
|
|
$(package)_sha256_hash=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
|
2024-07-04 15:28:16 +02:00
|
|
|
$(package)_patches=cmake_fixups.patch
|
2024-07-22 18:59:47 +02:00
|
|
|
$(package)_patches+=fix_mingw_link.patch
|
2024-07-04 15:28:16 +02:00
|
|
|
$(package)_build_subdir=build
|
2015-01-20 04:47:44 +01:00
|
|
|
|
2020-03-07 02:12:32 +01:00
|
|
|
# When building for Windows, we set _WIN32_WINNT to target the same Windows
|
|
|
|
# version as we do in configure. Due to quirks in libevents build system, this
|
|
|
|
# is also required to enable support for ipv6. See #19375.
|
2015-01-20 04:47:44 +01:00
|
|
|
define $(package)_set_vars
|
2024-07-04 15:28:16 +02:00
|
|
|
$(package)_config_opts=-DEVENT__DISABLE_BENCHMARK=ON -DEVENT__DISABLE_OPENSSL=ON
|
|
|
|
$(package)_config_opts+=-DEVENT__DISABLE_SAMPLES=ON -DEVENT__DISABLE_REGRESS=ON
|
|
|
|
$(package)_config_opts+=-DEVENT__DISABLE_TESTS=ON -DEVENT__LIBRARY_TYPE=STATIC
|
Merge bitcoin/bitcoin#30743: depends: build libevent with `-D_GNU_SOURCE`
556775408797d8e27154c3edaf139820b0979cce depends: build libevent with -D_GNU_SOURCE (fanquake)
Pull request description:
Currently, builds of libevent in depends, using CMake, fail on some systems, like Alpine, with the following:
```bash
/bitcoin/depends/work/build/aarch64-unknown-linux-musl/libevent/2.1.12-stable-1516ed47ea8/evmap.c: In function 'evmap_signal_add_':
/bitcoin/depends/work/build/aarch64-unknown-linux-musl/libevent/2.1.12-stable-1516ed47ea8/evmap.c:456:31: error: 'NSIG' undeclared (first use in this function)
456 | if (sig < 0 || sig >= NSIG)
```
From what I can tell the `GNU_SOURCE` "detection" in libevents CMake build system, never? really worked, primarily relies on looking for a deprecated define, and it's not clear what a nice fix is. For now, always build with `_GNU_SOURCE`, to match the autotools behaviour.
ACKs for top commit:
TheCharlatan:
ACK 556775408797d8e27154c3edaf139820b0979cce
Tree-SHA512: 4552b4a92867e8fa2af0ffa39b2be6c994bf739de7ce6a7c581590be486da81f7d93fca816854548c1e912347d33a35218c441b5058c3cbd3e82c74a9b7c78d9
2024-09-05 11:36:35 +02:00
|
|
|
$(package)_cppflags += -D_GNU_SOURCE
|
2020-03-07 02:12:32 +01:00
|
|
|
$(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0601
|
2015-01-20 04:47:44 +01:00
|
|
|
endef
|
|
|
|
|
2023-06-20 15:29:58 +02:00
|
|
|
define $(package)_preprocess_cmds
|
2024-07-22 18:59:47 +02:00
|
|
|
patch -p1 < $($(package)_patch_dir)/cmake_fixups.patch && \
|
|
|
|
patch -p1 < $($(package)_patch_dir)/fix_mingw_link.patch
|
2023-06-20 15:29:58 +02:00
|
|
|
endef
|
|
|
|
|
2015-01-20 04:47:44 +01:00
|
|
|
define $(package)_config_cmds
|
2024-07-04 15:28:16 +02:00
|
|
|
$($(package)_cmake) -S .. -B .
|
2015-01-20 04:47:44 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define $(package)_build_cmds
|
|
|
|
$(MAKE)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define $(package)_stage_cmds
|
|
|
|
$(MAKE) DESTDIR=$($(package)_staging_dir) install
|
|
|
|
endef
|
|
|
|
|
|
|
|
define $(package)_postprocess_cmds
|
2024-07-04 15:28:16 +02:00
|
|
|
rm bin/event_rpcgen.py && \
|
2022-09-16 12:55:55 +02:00
|
|
|
rm include/ev*.h && \
|
|
|
|
rm include/event2/*_compat.h
|
2015-01-20 04:47:44 +01:00
|
|
|
endef
|