diff mbox series

[1/2] package/libucontext: new package

Message ID 20220811063502.1823571-1-james.hilliard1@gmail.com
State New
Headers show
Series [1/2] package/libucontext: new package | expand

Commit Message

James Hilliard Aug. 11, 2022, 6:35 a.m. UTC
This package provides a ucontext.h C API on musl libc.

Architecture support table based on:
https://github.com/kaniini/libucontext/tree/libucontext-1.2#supported-features

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/libucontext/Config.in        | 33 ++++++++++++++++++++++++++++
 package/libucontext/libucontext.hash |  4 ++++
 package/libucontext/libucontext.mk   | 17 ++++++++++++++
 5 files changed, 56 insertions(+)
 create mode 100644 package/libucontext/Config.in
 create mode 100644 package/libucontext/libucontext.hash
 create mode 100644 package/libucontext/libucontext.mk
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index d2bd0d809a..b843acca9e 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1334,6 +1334,7 @@  F:	package/exfatprogs/
 F:	package/gensio/
 F:	package/lua-std-debug/
 F:	package/lua-std-normalize/
+F:	package/libucontext/
 F:	package/lilv/
 F:	package/lv2/
 F:	package/pipewire/
diff --git a/package/Config.in b/package/Config.in
index d1c098c48f..3fe0dcc3c8 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2050,6 +2050,7 @@  menu "Other"
 	source "package/libtpl/Config.in"
 	source "package/libubox/Config.in"
 	source "package/libuci/Config.in"
+	source "package/libucontext/Config.in"
 	source "package/libunwind/Config.in"
 	source "package/liburcu/Config.in"
 	source "package/liburing/Config.in"
diff --git a/package/libucontext/Config.in b/package/libucontext/Config.in
new file mode 100644
index 0000000000..84a6e89f23
--- /dev/null
+++ b/package/libucontext/Config.in
@@ -0,0 +1,33 @@ 
+config BR2_PACKAGE_LIBUCONTEXT_ARCH_SUPPORTS
+	bool
+	default y if BR2_aarch64
+	default y if BR2_aarch64_be
+	default y if BR2_arm
+	default y if BR2_armeb
+	default y if BR2_m68k
+	default y if BR2_mips
+	default y if BR2_mipsel
+	default y if BR2_mips64
+	default y if BR2_mips64el
+	default y if BR2_or1k
+	default y if BR2_powerpc
+	default y if BR2_powerpc64
+	default y if BR2_powerpc64le
+	default y if BR2_riscv && BR2_RISCV_32
+	default y if BR2_riscv && BR2_RISCV_64
+	default y if BR2_s390x
+	default y if BR2_sh4
+	default y if BR2_sh4eb
+	default y if BR2_sh4a
+	default y if BR2_sh4aeb
+	default y if BR2_i386
+	default y if BR2_x86_64
+	depends on BR2_TOOLCHAIN_USES_MUSL
+
+config BR2_PACKAGE_LIBUCONTEXT
+	bool "libucontext"
+	depends on BR2_PACKAGE_LIBUCONTEXT_ARCH_SUPPORTS
+	help
+	  Ucontext implementation featuring glibc-compatible ABI.
+
+	  https://github.com/kaniini/libucontext
diff --git a/package/libucontext/libucontext.hash b/package/libucontext/libucontext.hash
new file mode 100644
index 0000000000..a8e1e23e36
--- /dev/null
+++ b/package/libucontext/libucontext.hash
@@ -0,0 +1,4 @@ 
+# Locally calculated
+sha256  937fba9d0beebd7cf957b79979b19fe3a29bb9c4bfd25e869477d7154bbf8fd3  libucontext-1.2.tar.gz
+# License files, locally calculated
+sha256  ecf4be354bbb6ccebdf150d1a8f2b3caeb10cf7c8a580f278a30799372f9e037  LICENSE
diff --git a/package/libucontext/libucontext.mk b/package/libucontext/libucontext.mk
new file mode 100644
index 0000000000..75c4f9b9e4
--- /dev/null
+++ b/package/libucontext/libucontext.mk
@@ -0,0 +1,17 @@ 
+################################################################################
+#
+# libucontext
+#
+################################################################################
+
+LIBUCONTEXT_VERSION = 1.2
+LIBUCONTEXT_SITE = $(call github,kaniini,libucontext,libucontext-$(LIBUCONTEXT_VERSION))
+LIBUCONTEXT_LICENSE = ISC
+LIBUCONTEXT_LICENSE_FILES = LICENSE
+LIBUCONTEXT_INSTALL_STAGING = YES
+
+LIBUCONTEXT_CONF_OPTS = \
+	-Dfreestanding=false \
+	-Dexport_unprefixed=true
+
+$(eval $(meson-package))