[1/3] package/libdivsufsort: new package

Message ID 20241004215451.1198861-1-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • [1/3] package/libdivsufsort: new package
Related show

Commit Message

Dario Binacchi Oct. 4, 2024, 9:54 p.m. UTC
The commit adds the libdivsufsort library. This library implements a
lightweight suffix array construction algorithm.

I set the package version to the most recent commit because the latest
released version (i. e. 2.0.1) had license and compilation issues, which
were fixed in subsequent commits.

Cc: Colin Percival <cperciva@freebsd.org>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 DEVELOPERS                               |  1 +
 package/Config.in                        |  1 +
 package/libdivsufsort/Config.in          |  7 +++++++
 package/libdivsufsort/libdivsufsort.hash |  3 +++
 package/libdivsufsort/libdivsufsort.mk   | 23 +++++++++++++++++++++++
 5 files changed, 35 insertions(+)
 create mode 100644 package/libdivsufsort/Config.in
 create mode 100644 package/libdivsufsort/libdivsufsort.hash
 create mode 100644 package/libdivsufsort/libdivsufsort.mk

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 44b19474876b..458da4e4e051 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -798,6 +798,7 @@  F:	configs/stm32f769_disco_sd_defconfig
 F:	package/armadillo/
 F:	package/babeld/
 F:	package/iana-assignments/
+F:	package/libdivsufsort/
 F:	package/sscep/
 F:	package/tinyinit/
 F:	package/uuu/
diff --git a/package/Config.in b/package/Config.in
index e1ceb81dc0a2..40caa6fb3461 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2209,6 +2209,7 @@  menu "Other"
 	source "package/libdaemon/Config.in"
 	source "package/libdex/Config.in"
 	source "package/libdill/Config.in"
+	source "package/libdivsufsort/Config.in"
 	source "package/libeastl/Config.in"
 	source "package/libee/Config.in"
 	source "package/libev/Config.in"
diff --git a/package/libdivsufsort/Config.in b/package/libdivsufsort/Config.in
new file mode 100644
index 000000000000..b00e9c77e5fe
--- /dev/null
+++ b/package/libdivsufsort/Config.in
@@ -0,0 +1,7 @@ 
+config BR2_PACKAGE_LIBDIVSUFSORT
+	bool "libdivsufsort"
+	help
+	  libdivsufsort is a software library that implements a
+	  lightweight suffix array construction algorithm.
+
+	  https://github.com/y-256/libdivsufsort
diff --git a/package/libdivsufsort/libdivsufsort.hash b/package/libdivsufsort/libdivsufsort.hash
new file mode 100644
index 000000000000..ed99c2272dd8
--- /dev/null
+++ b/package/libdivsufsort/libdivsufsort.hash
@@ -0,0 +1,3 @@ 
+# Locally calculated
+sha256  705a122a142eda16f05996e56b45247319d140928eec32bd9db6753da13f5b5b  libdivsufsort-5f60d6f026c30fb4ac296f696b3c8b0eb71bd428.tar.gz
+sha256  29f948fde0da0929ee6ed6bf82a96114b992d54a5d906c77a42473df520da764  LICENSE
diff --git a/package/libdivsufsort/libdivsufsort.mk b/package/libdivsufsort/libdivsufsort.mk
new file mode 100644
index 000000000000..1ae2ee487e25
--- /dev/null
+++ b/package/libdivsufsort/libdivsufsort.mk
@@ -0,0 +1,23 @@ 
+################################################################################
+#
+# libdivsufsort
+#
+################################################################################
+
+LIBDIVSUFSORT_VERSION = 5f60d6f026c30fb4ac296f696b3c8b0eb71bd428
+LIBDIVSUFSORT_SITE = $(call github,y-256,libdivsufsort,$(LIBDIVSUFSORT_VERSION))
+LIBDIVSUFSORT_LICENSE = MIT
+LIBDIVSUFSORT_LICENSE_FILES = LICENSE
+LIBDIVSUFSORT_INSTALL_STAGING = YES
+
+LIBDIVSUFSORT_CONF_OPTS = \
+	-DBUILD_EXAMPLES=OFF \
+	-DBUILD_DIVSUFSORT64=ON
+
+ifeq ($(BR2_STATIC_LIBS),y)
+LIBDIVSUFSORT_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF
+else
+LIBDIVSUFSORT_CONF_OPTS += -DBUILD_SHARED_LIBS=ON
+endif
+
+$(eval $(cmake-package))