package/libfutils: new package

The libfutils library is a library that contains some common
useful functions (list, hash, time).

https://github.com/Parrot-Developers/libfutils

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
[yann.morin.1998@free.fr:
  - do not macro-ify headers install
  - do not parameterise static libs install dest
  - reorder macros decaration and use
  - implicit module name
  - BUILD_CMDS fit on a single line
  - LIBFUTILS_TARGET_ENV is all env, not just extra env
  - add missing mkdir in shared-libs case
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Herve Codina 2022-01-10 15:50:05 +01:00 committed by Yann E. MORIN
parent 4e88d6570f
commit ef5d311a84
5 changed files with 76 additions and 0 deletions

View File

@ -1194,6 +1194,7 @@ F: package/alchemy/
F: package/dtbocfg/
F: package/libdbi/
F: package/libdbi-drivers/
F: package/libfutils/
F: package/lua-augeas/
F: package/modsecurity2/
F: package/php-apcu/

View File

@ -1986,6 +1986,7 @@ menu "Other"
source "package/libevent/Config.in"
source "package/libexecinfo/Config.in"
source "package/libffi/Config.in"
source "package/libfutils/Config.in"
source "package/libgee/Config.in"
source "package/libgeos/Config.in"
source "package/libglib2/Config.in"

View File

@ -0,0 +1,15 @@
config BR2_PACKAGE_LIBFUTILS
bool "libfutils"
depends on BR2_TOOLCHAIN_HAS_ATOMIC
depends on BR2_INSTALL_LIBSTDCPP # ulog
depends on BR2_TOOLCHAIN_HAS_THREADS # ulog
select BR2_PACKAGE_ULOG
help
This library contains some common useful functions (list,
hash, time)
https://github.com/Parrot-Developers/libfutils
comment "libfutils needs a toolchain w/ C++, threads"
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_TOOLCHAIN_HAS_ATOMIC

View File

@ -0,0 +1,3 @@
# Locally computed:
sha256 b38d40c46b83e448d8c1716ddfb04b7ecd384f5cd2cb773db5c26c0589accdb3 libfutils-c326ce0cc2a7354381265a7664bb215be587fac6.tar.gz
sha256 eca11a1c62fae8d64a1247d93271375baecff8396141d7ff8d89671ee7e3ed0d COPYING

View File

@ -0,0 +1,56 @@
################################################################################
#
# libfutils
#
################################################################################
LIBFUTILS_VERSION = c326ce0cc2a7354381265a7664bb215be587fac6
LIBFUTILS_SITE = $(call github,Parrot-Developers,libfutils,$(LIBFUTILS_VERSION))
LIBFUTILS_LICENSE = BSD-3-Clause
LIBFUTILS_LICENSE_FILES = COPYING
LIBFUTILS_DEPENDENCIES = host-alchemy ulog
LIBFUTILS_INSTALL_STAGING = YES
LIBFUTILS_TARGET_ENV = \
$(ALCHEMY_TARGET_ENV) \
ALCHEMY_TARGET_SDK_DIRS="$(ALCHEMY_SDK_BASEDIR)/ulog"
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
LIBFUTILS_TARGET_ENV += TARGET_GLOBAL_LDLIBS='-latomic'
endif
define LIBFUTILS_BUILD_CMDS
$(LIBFUTILS_TARGET_ENV) $(ALCHEMY_MAKE) libfutils
endef
ifeq ($(BR2_STATIC_LIBS),)
# $(1): destination directory: target or staging
define LIBFUTILS_INSTALL_SHARED_LIBS
mkdir -p $(1)/usr/lib/
$(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libfutils.so* \
$(1)/usr/lib/
endef
endif
ifeq ($(BR2_SHARED_LIBS),)
define LIBFUTILS_INSTALL_STATIC_LIBS
mkdir -p $(1)/usr/lib/
$(INSTALL) -D -m 644 $(@D)/alchemy-out/staging/usr/lib/libfutils.a \
$(STAGING_DIR)/usr/lib/libfutils.a
endef
endif
define LIBFUTILS_INSTALL_TARGET_CMDS
$(call LIBFUTILS_INSTALL_SHARED_LIBS, $(TARGET_DIR))
endef
define LIBFUTILS_INSTALL_STAGING_CMDS
mkdir -p $(STAGING_DIR)/usr/include/futils
$(INSTALL) -m 644 $(@D)/include/futils/* \
$(STAGING_DIR)/usr/include/futils/
$(LIBFUTILS_INSTALL_STATIC_LIBS)
$(call LIBFUTILS_INSTALL_SHARED_LIBS, $(STAGING_DIR))
$(call ALCHEMY_INSTALL_LIB_SDK_FILE, libfutils, libfutils.so, libulog)
endef
$(eval $(generic-package))