From 38ba3d31a4905cc41b87a2ff9e6fee198d416a92 Mon Sep 17 00:00:00 2001 From: Brandon Maier Date: Fri, 3 May 2024 01:59:57 +0000 Subject: [PATCH] package/bats-support: new package This library provides support functions needed by the bats-assert and bats-file libraries. This library does not provide an installer. Manually install the files under /usr/lib/bats/bats-support which is what the Arch Linux package does[1]. This makes the library loadable using `bats_load_library`[2]. [1] https://gitlab.archlinux.org/archlinux/packaging/packages/bats-support/-/blob/main/PKGBUILD?ref_type=heads [2] https://bats-core.readthedocs.io/en/stable/writing-tests.html#bats-load-library-load-system-wide-libraries There are going to be a few such helpers to be introduced later, so we make them all appear as sub-options of the main package, bats-core. Signed-off-by: Brandon Maier [yann.morin.1998@free.fr: - move as sub-option of bats-core - explain why in commit log ] Signed-off-by: Yann E. MORIN --- DEVELOPERS | 1 + package/bats-core/Config.in | 6 ++++++ package/bats-support/Config.in | 7 +++++++ package/bats-support/bats-support.hash | 5 +++++ package/bats-support/bats-support.mk | 18 ++++++++++++++++++ 5 files changed, 37 insertions(+) create mode 100644 package/bats-support/Config.in create mode 100644 package/bats-support/bats-support.hash create mode 100644 package/bats-support/bats-support.mk diff --git a/DEVELOPERS b/DEVELOPERS index 5d198567d8..7fc46d6b43 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -540,6 +540,7 @@ F: package/ncdu/ N: Brandon Maier F: board/freescale/ls1046a-frwy/ F: configs/ls1046a-frwy_defconfig +F: package/bats-support/ F: package/python-pysensors/ F: package/qoriq-fm-ucode/ F: package/unifdef/ diff --git a/package/bats-core/Config.in b/package/bats-core/Config.in index 73c38e5a04..7ba119a412 100644 --- a/package/bats-core/Config.in +++ b/package/bats-core/Config.in @@ -9,3 +9,9 @@ config BR2_PACKAGE_BATS_CORE write behave as expected. https://github.com/bats-core/bats-core + +if BR2_PACKAGE_BATS_CORE + +source "package/bats-support/Config.in" + +endif diff --git a/package/bats-support/Config.in b/package/bats-support/Config.in new file mode 100644 index 0000000000..ce60978197 --- /dev/null +++ b/package/bats-support/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_BATS_SUPPORT + bool "bats-support" + help + bats-support is a supporting library providing common + functions to test helper libraries written for Bats. + + https://github.com/bats-core/bats-support diff --git a/package/bats-support/bats-support.hash b/package/bats-support/bats-support.hash new file mode 100644 index 0000000000..847f39e7c7 --- /dev/null +++ b/package/bats-support/bats-support.hash @@ -0,0 +1,5 @@ +# Locally calculated +sha256 7815237aafeb42ddcc1b8c698fc5808026d33317d8701d5ec2396e9634e2918f bats-support-0.3.0.tar.gz + +# License files +sha256 36ffd9dc085d529a7e60e1276d73ae5a030b020313e6c5408593a6ae2af39673 LICENSE diff --git a/package/bats-support/bats-support.mk b/package/bats-support/bats-support.mk new file mode 100644 index 0000000000..765e08ffce --- /dev/null +++ b/package/bats-support/bats-support.mk @@ -0,0 +1,18 @@ +################################################################################ +# +# bats-support +# +################################################################################ + +BATS_SUPPORT_VERSION = 0.3.0 +BATS_SUPPORT_SITE = $(call github,bats-core,bats-support,v$(BATS_SUPPORT_VERSION)) +BATS_SUPPORT_LICENSE = CC0-1.0 +BATS_SUPPORT_LICENSE_FILES = LICENSE + +define BATS_SUPPORT_INSTALL_TARGET_CMDS + $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/bats/bats-support/src + $(INSTALL) -m 0755 $(@D)/*.bash -t $(TARGET_DIR)/usr/lib/bats/bats-support + $(INSTALL) -m 0755 $(@D)/src/*.bash -t $(TARGET_DIR)/usr/lib/bats/bats-support/src +endef + +$(eval $(generic-package))