package/basu: new package

basu is the sd-bus library, extracted from systemd.

Some projects rely on the sd-bus library for DBus support. However not
all systems have systemd or elogind installed. This library provides
just sd-bus (and the busctl utility).

Signed-off-by: Sergey Bobrenok <bobrofon@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Sergey Bobrenok 2024-02-29 22:21:38 +03:00 committed by Thomas Petazzoni
parent f147e3b16a
commit 9fcf0fd801
7 changed files with 130 additions and 0 deletions

View File

@ -2835,6 +2835,7 @@ F: package/systemd
F: support/scripts/pkg-stats
N: Sergey Bobrenok <bobrofon@gmail.com>
F: package/basu/
F: package/sdbus-cpp/
N: Sergey Matyukevich <geomatsi@gmail.com>

View File

@ -2103,6 +2103,7 @@ menu "Other"
source "package/armadillo/Config.in"
source "package/atf/Config.in"
source "package/avro-c/Config.in"
source "package/basu/Config.in"
source "package/bctoolbox/Config.in"
source "package/bdwgc/Config.in"
source "package/belr/Config.in"

View File

@ -0,0 +1,39 @@
From 6133c87299bce32c13dcf1692842ea5f2890c5ad Mon Sep 17 00:00:00 2001
From: Sergey Bobrenok <bobrofon@gmail.com>
Date: Wed, 28 Feb 2024 16:29:17 +0300
Subject: [PATCH] meson.build: Disable stack protection for Buildroot packaging
In Buildroot, the SSP flags are passed via the wrapper, and only flags
supported by the toolchain will be used. So the SSP flags can be
safely removed from the build files.
Fixes:
src/basic/libbasic.a.p/log.c.o: in function `write_to_console.isra.0':
log.c:(.text.write_to_console.isra.0+0x154): undefined reference to `__stack_chk_fail_local'
Upstream: N/A [Buildroot specific]
Signed-off-by: Sergey Bobrenok <bobrofon@gmail.com>
---
meson.build | 3 ---
1 file changed, 3 deletions(-)
diff --git a/meson.build b/meson.build
index 6f79707..51fd400 100644
--- a/meson.build
+++ b/meson.build
@@ -75,9 +75,6 @@ possible_cc_flags = [
'-fdiagnostics-show-option',
'-fno-strict-aliasing',
'-fvisibility=hidden',
- '-fstack-protector',
- '-fstack-protector-strong',
- '--param=ssp-buffer-size=4',
]
# --as-needed and --no-undefined are provided by meson by default,
base-commit: 684a41d68cfbb05e38aacb60a8548e21ddfbecdb
--
2.43.2

View File

@ -0,0 +1,34 @@
From 8e4960e8b9d11d9be96e83b02bd3b08178ddce1b Mon Sep 17 00:00:00 2001
From: Sergey Bobrenok <bobrofon@gmail.com>
Date: Wed, 28 Feb 2024 20:42:19 +0300
Subject: [PATCH basu] memfd-util.c: Use F_ADD_SEALS definition from missing.h
uClibc and glibc (until version 2.27, 2018) implementations don't
support F_ADD_SEALS and other F_SEAL_xxx flags.
'missing.h' was removed from 'memfd-util.c' in 37dbb2fcb ("Remove
useless includes").
Upstream: https://lists.sr.ht/~emersion/public-inbox/patches/49899
Signed-off-by: Sergey Bobrenok <bobrofon@gmail.com>
---
src/basic/memfd-util.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/basic/memfd-util.c b/src/basic/memfd-util.c
index 89893ba..7e535c6 100644
--- a/src/basic/memfd-util.c
+++ b/src/basic/memfd-util.c
@@ -7,6 +7,7 @@
#include "alloc-util.h"
#include "memfd-util.h"
+#include "missing.h"
int memfd_set_sealed(int fd) {
#if defined(__FreeBSD__) && __FreeBSD__ < 13
base-commit: 684a41d68cfbb05e38aacb60a8548e21ddfbecdb
--
2.44.0

23
package/basu/Config.in Normal file
View File

@ -0,0 +1,23 @@
config BR2_PACKAGE_BASU
bool "basu"
depends on BR2_USE_MMU # dbus
depends on BR2_USE_WCHAR # uchar.h
depends on BR2_ENABLE_LOCALE # locale_t
depends on BR2_TOOLCHAIN_HAS_SYNC_4 # __sync_add_and_fetch
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 # F_ADD_SEALS
select BR2_PACKAGE_DBUS if !BR2_PACKAGE_DBUS_BROKER # runtime
help
basu is the sd-bus library, extracted from systemd.
Some projects rely on the sd-bus library for DBus support.
However not all systems have systemd or elogind installed.
This library provides just sd-bus (and the busctl utility).
https://git.sr.ht/~emersion/basu
comment "basu needs a toolchain w/ wchar, locale, threads, headers >= 3.17"
depends on BR2_USE_MMU
depends on BR2_TOOLCHAIN_HAS_SYNC_4
depends on !BR2_USE_WCHAR || !BR2_ENABLE_LOCALE || \
!BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17

4
package/basu/basu.hash Normal file
View File

@ -0,0 +1,4 @@
# From https://git.sr.ht/~emersion/basu/refs/v0.2.1
sha256 d9b373a9fcb5d5eb5f6c1c56355f76edb7f2f52bc744570e80604e83455a19bd basu-0.2.1.tar.gz
# Locally computed:
sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 LICENSE.LGPL2.1

28
package/basu/basu.mk Normal file
View File

@ -0,0 +1,28 @@
################################################################################
#
# basu
#
################################################################################
BASU_VERSION = 0.2.1
BASU_SITE = https://git.sr.ht/~emersion/basu/refs/download/v$(BASU_VERSION)
BASU_INSTALL_STAGING = YES
BASU_LICENSE = LGPL-2.1+
BASU_LICENSE_FILES = LICENSE.LGPL2.1
BASU_DEPENDENCIES = host-gperf
ifeq ($(BR2_PACKAGE_LIBCAP),y)
BASU_DEPENDENCIES += libcap
BASU_CONF_OPTS += -Dlibcap=enabled
else
BASU_CONF_OPTS += -Dlibcap=disabled
endif
ifeq ($(BR2_PACKAGE_AUDIT),y)
BASU_DEPENDENCIES += audit
BASU_CONF_OPTS += -Daudit=enabled
else
BASU_CONF_OPTS += -Daudit=disabled
endif
$(eval $(meson-package))