From 5e9f0437531c85e485004561ca78f78dd5067c47 Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin Date: Mon, 8 Aug 2022 14:46:45 +0300 Subject: [PATCH] Migrate Libevent build from automake to CMake (#320) --- .../crutch/0001-libevent-mbedtls.patch | 13 ----- .../libevent-openipc/libevent-openipc.mk | 49 +++++-------------- 2 files changed, 13 insertions(+), 49 deletions(-) delete mode 100644 general/package/libevent-openipc/crutch/0001-libevent-mbedtls.patch diff --git a/general/package/libevent-openipc/crutch/0001-libevent-mbedtls.patch b/general/package/libevent-openipc/crutch/0001-libevent-mbedtls.patch deleted file mode 100644 index 6bffa930..00000000 --- a/general/package/libevent-openipc/crutch/0001-libevent-mbedtls.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/buffer.c b/buffer.c -index 822d97a5..646763b4 100644 ---- a/buffer.c -+++ b/buffer.c -@@ -3070,7 +3070,7 @@ evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg) - offset_leftover = offset % page_size; - offset_rounded = offset - offset_leftover; - } -- mapped = mmap(NULL, length + offset_leftover, -+ mapped = mmap64(NULL, length + offset_leftover, - PROT_READ, - #ifdef MAP_NOCACHE - MAP_NOCACHE | /* ??? */ diff --git a/general/package/libevent-openipc/libevent-openipc.mk b/general/package/libevent-openipc/libevent-openipc.mk index 7c9150b6..3747378d 100644 --- a/general/package/libevent-openipc/libevent-openipc.mk +++ b/general/package/libevent-openipc/libevent-openipc.mk @@ -4,46 +4,24 @@ # ################################################################################ -LIBEVENT_OPENIPC_VERSION = bf3ce77f6cf113839defa70b30e183d471a0dab5 -LIBEVENT_OPENIPC_SITE = $(call github,libevent,libevent,$(LIBEVENT_OPENIPC_VERSION)) +LIBEVENT_OPENIPC_VERSION = mmap64 +LIBEVENT_OPENIPC_SITE = $(call github,widgetii,libevent,$(LIBEVENT_OPENIPC_VERSION)) LIBEVENT_OPENIPC_INSTALL_STAGING = YES LIBEVENT_OPENIPC_LICENSE = BSD-3-Clause, OpenBSD LIBEVENT_OPENIPC_LICENSE_FILES = LICENSE - -# This package uses autoconf, but not automake, so we need to call -# their special autogen.sh script, and have custom target and staging -# installation commands. - -define LIBEVENT_OPENIPC_RUN_CRUTCH - cd $(@D) && patch -i $(TOPDIR)/../general/package/libevent-openipc/crutch/0001-libevent-mbedtls.patch -endef - -define LIBEVENT_OPENIPC_RUN_AUTOGEN - cd $(@D) && PATH=$(BR_PATH) ./autogen.sh -endef - -ifeq ($(BR2_TOOLCHAIN_BUILDROOT_MUSL),y) -LIBEVENT_OPENIPC_PRE_CONFIGURE_HOOKS += LIBEVENT_OPENIPC_RUN_CRUTCH LIBEVENT_OPENIPC_RUN_AUTOGEN -else -LIBEVENT_OPENIPC_PRE_CONFIGURE_HOOKS += LIBEVENT_OPENIPC_RUN_AUTOGEN -endif - - LIBEVENT_OPENIPC_CONF_OPTS = \ - --disable-libevent-regress \ - --disable-samples \ - --disable-debug-mode \ - --disable-largefile -HOST_LIBEVENT_OPENIPC_CONF_OPTS = \ - --disable-libevent-regress \ - --disable-samples \ - --disable-openssl + -DEVENT__DISABLE_BENCHMARK=ON \ + -DEVENT__DISABLE_SAMPLES=ON \ + -DEVENT__DISABLE_TESTS=ON \ + -DCMAKE_BUILD_TYPE=Release + define LIBEVENT_OPENIPC_REMOVE_PYSCRIPT rm $(TARGET_DIR)/usr/bin/event_rpcgen.py endef define LIBEVENT_OPENIPC_DELETE_UNUSED + rm -r $(TARGET_DIR)/usr/lib/libevent-2.2.so rm -f $(TARGET_DIR)/usr/lib/libevent-2.2.so.1.0.0 rm -f $(TARGET_DIR)/usr/lib/libevent-2.2.so.1 rm -f $(TARGET_DIR)/usr/lib/libevent.so @@ -57,19 +35,18 @@ endif ifeq ($(BR2_PACKAGE_OPENSSL),y) LIBEVENT_OPENIPC_DEPENDENCIES += host-pkgconf openssl -LIBEVENT_OPENIPC_CONF_OPTS += --enable-openssl +LIBEVENT_OPENIPC_CONF_OPTS += -DEVENT__DISABLE_OPENSSL=OFF else -LIBEVENT_OPENIPC_CONF_OPTS += --disable-openssl +LIBEVENT_OPENIPC_CONF_OPTS += -DEVENT__DISABLE_OPENSSL=ON endif ifeq ($(BR2_PACKAGE_MBEDTLS_OPENIPC),y) LIBEVENT_OPENIPC_DEPENDENCIES += host-pkgconf mbedtls-openipc -LIBEVENT_OPENIPC_CONF_OPTS += --enable-mbedtls +LIBEVENT_OPENIPC_CONF_OPTS += -DEVENT__DISABLE_MBEDTLS=OFF else -LIBEVENT_OPENIPC_CONF_OPTS += --disable-mbedtls +LIBEVENT_OPENIPC_CONF_OPTS += -DEVENT__DISABLE_MBEDTLS=ON endif LIBEVENT_OPENIPC_POST_INSTALL_TARGET_HOOKS += LIBEVENT_OPENIPC_DELETE_UNUSED -$(eval $(autotools-package)) -$(eval $(host-autotools-package)) +$(eval $(cmake-package))