From 4e88d6570f18748111e3ec81a3121e3e0376a277 Mon Sep 17 00:00:00 2001 From: Herve Codina Date: Mon, 10 Jan 2022 15:50:04 +0100 Subject: [PATCH] package/ulog: new package The ulog library is a minimalistic logging library derived from Android logger. https://github.com/Parrot-Developers/ulog Signed-off-by: Herve Codina [yann.morin.1998@free.fr: - do not macro-ify headers install - do not parameterise static libs install dest - reordr macros decaration and use - implicit module name - BUILD_CMDS fit on a single line ] Signed-off-by: Yann E. MORIN --- DEVELOPERS | 1 + package/Config.in | 1 + package/ulog/Config.in | 12 +++++++++++ package/ulog/ulog.hash | 3 +++ package/ulog/ulog.mk | 46 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+) create mode 100644 package/ulog/Config.in create mode 100644 package/ulog/ulog.hash create mode 100644 package/ulog/ulog.mk diff --git a/DEVELOPERS b/DEVELOPERS index 33b9c1cd73..563f6df3ff 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1200,6 +1200,7 @@ F: package/php-apcu/ F: package/php-lua/ F: package/php-pam/ F: package/php-pecl-dbus/ +F: package/ulog/ F: support/testing/tests/package/test_dtbocfg.py F: support/testing/tests/package/test_lua_augeas.py F: support/testing/tests/package/test_php_apcu.py diff --git a/package/Config.in b/package/Config.in index 3a2ad30df9..39a98fcc66 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1738,6 +1738,7 @@ menu "Logging" source "package/log4qt/Config.in" source "package/opentracing-cpp/Config.in" source "package/spdlog/Config.in" + source "package/ulog/Config.in" source "package/zlog/Config.in" endmenu diff --git a/package/ulog/Config.in b/package/ulog/Config.in new file mode 100644 index 0000000000..ef155005c2 --- /dev/null +++ b/package/ulog/Config.in @@ -0,0 +1,12 @@ +config BR2_PACKAGE_ULOG + bool "ulog" + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_TOOLCHAIN_HAS_THREADS + help + This is a minimalistic logging library derived from + Android logger. + + https://github.com/Parrot-Developers/ulog + +comment "ulog needs a toolchain w/ C++, threads" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/ulog/ulog.hash b/package/ulog/ulog.hash new file mode 100644 index 0000000000..47adc093b9 --- /dev/null +++ b/package/ulog/ulog.hash @@ -0,0 +1,3 @@ +# Locally computed: +sha256 14e5773b32a79fa5380bdc7ac73a39a7cd3ab182830f57cf6f2994fb49cf38dc ulog-0389d243352255f6182326dccdae3d56dadc078f.tar.gz +sha256 cbb97dd2528af2aa2b9aee6c1b3ff1caed758044c17b2c811cf44b2528c496da COPYING diff --git a/package/ulog/ulog.mk b/package/ulog/ulog.mk new file mode 100644 index 0000000000..8e8b1aa1c1 --- /dev/null +++ b/package/ulog/ulog.mk @@ -0,0 +1,46 @@ +################################################################################ +# +# ulog +# +################################################################################ + +ULOG_VERSION = 0389d243352255f6182326dccdae3d56dadc078f +ULOG_SITE = $(call github,Parrot-Developers,ulog,$(ULOG_VERSION)) +ULOG_LICENSE = Apache-2.0 +ULOG_LICENSE_FILES = COPYING +ULOG_DEPENDENCIES = host-alchemy +ULOG_INSTALL_STAGING = YES + +define ULOG_BUILD_CMDS + $(ALCHEMY_TARGET_ENV) $(ALCHEMY_MAKE) libulog +endef + +ifeq ($(BR2_SHARED_LIBS),) +define ULOG_INSTALL_STATIC_LIBS + $(INSTALL) -D -m 644 $(@D)/alchemy-out/staging/usr/lib/libulog.a \ + $(STAGING_DIR)/usr/lib/libulog.a +endef +endif + +ifeq ($(BR2_STATIC_LIBS),) +# $(1): destination directory: target or staging +define ULOG_INSTALL_SHARED_LIBS + mkdir -p $(1)/usr/lib/ + $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libulog.so* \ + $(1)/usr/lib/ +endef +endif + +define ULOG_INSTALL_TARGET_CMDS + $(call ULOG_INSTALL_SHARED_LIBS, $(TARGET_DIR)) +endef + +define ULOG_INSTALL_STAGING_CMDS + mkdir -p $(STAGING_DIR)/usr/include/ + $(INSTALL) -m 644 $(@D)/libulog/include/* $(STAGING_DIR)/usr/include/ + $(ULOG_INSTALL_STATIC_LIBS) + $(call ULOG_INSTALL_SHARED_LIBS, $(STAGING_DIR)) + $(call ALCHEMY_INSTALL_LIB_SDK_FILE, libulog, libulog.so) +endef + +$(eval $(generic-package))