summaryrefslogtreecommitdiff
path: root/dev-libs/marisa
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /dev-libs/marisa
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'dev-libs/marisa')
-rw-r--r--dev-libs/marisa/Manifest2
-rw-r--r--dev-libs/marisa/files/marisa-0.3.1-fix-swig-bindings.patch353
-rw-r--r--dev-libs/marisa/files/marisa-0.3.1-install-all-configs.patch21
-rw-r--r--dev-libs/marisa/marisa-0.2.7.ebuild121
-rw-r--r--dev-libs/marisa/marisa-0.3.1-r2.ebuild90
-rw-r--r--dev-libs/marisa/marisa-9999.ebuild86
-rw-r--r--dev-libs/marisa/metadata.xml20
7 files changed, 693 insertions, 0 deletions
diff --git a/dev-libs/marisa/Manifest b/dev-libs/marisa/Manifest
new file mode 100644
index 000000000000..039d2a192fb7
--- /dev/null
+++ b/dev-libs/marisa/Manifest
@@ -0,0 +1,2 @@
+DIST marisa-0.2.7.tar.gz 214468 BLAKE2B 58a3f5a38099e16aaccd523df4e3fa49a7222d41a3b242dc7d328eca6d3fae09aaaa092b94e5e83d8a21ee36be86abe37007860271369e3de95b722f556e0570 SHA512 5e162d1e4b6e78e60354c19dbb419088d1d832591a701ee5a844f9e61747b0ec0333732d2832a771e2a1bae7cc9e199a9eae5098e430ff331b4de372ccce4798
+DIST marisa-0.3.1.tar.gz 212791 BLAKE2B 130735eb3743a78a32e9e2389da84b8cd251031c8362843d1fb26f32ee2d1a3a0acf1de413e0554959e0488b8f445bac92c41c3fa54b6c1dad5bb245dfe1584f SHA512 60757e354e4f0ff47662930af5c32a762c5f348c60019abb2d502c6c21ec220731edd9be8ea36e3ec68df90a6584eb311fe1e3d4258b3392609a87b0ef427121
diff --git a/dev-libs/marisa/files/marisa-0.3.1-fix-swig-bindings.patch b/dev-libs/marisa/files/marisa-0.3.1-fix-swig-bindings.patch
new file mode 100644
index 000000000000..85c2a9e7c5bc
--- /dev/null
+++ b/dev-libs/marisa/files/marisa-0.3.1-fix-swig-bindings.patch
@@ -0,0 +1,353 @@
+https://github.com/s-yata/marisa-trie/pull/123
+https://github.com/s-yata/marisa-trie/commit/cf4602f08df49861d987d122bd85bfdb456fe7a0
+
+From cf4602f08df49861d987d122bd85bfdb456fe7a0 Mon Sep 17 00:00:00 2001
+From: Weng Xuetian <wengxt@gmail.com>
+Date: Sat, 9 Aug 2025 02:31:06 -0700
+Subject: [PATCH] Fix binding build and add CI to test it on linux. (#123)
+
+Fix #121
+Fix #122
+---
+ .github/workflows/linux.yml | 23 +++++++++++++++++++++++
+ bindings/marisa-swig-python3.cxx | 15 +++++----------
+ bindings/marisa-swig.cxx | 15 +++++----------
+ bindings/perl/marisa-swig.cxx | 15 +++++----------
+ bindings/python/marisa-swig.cxx | 17 ++++++-----------
+ bindings/python3/marisa-swig-python3.cxx | 15 +++++----------
+ bindings/ruby/marisa-swig.cxx | 15 +++++----------
+ 7 files changed, 54 insertions(+), 61 deletions(-)
+
+diff --git a/bindings/marisa-swig-python3.cxx b/bindings/marisa-swig-python3.cxx
+index 50ab6b0..10bbad3 100644
+--- a/bindings/marisa-swig-python3.cxx
++++ b/bindings/marisa-swig-python3.cxx
+@@ -27,8 +27,7 @@ size_t Query::query_id() const {
+ return query_.id();
+ }
+
+-Keyset::Keyset() : keyset_(new (std::nothrow) marisa::Keyset) {
+- MARISA_THROW_IF(keyset_ == NULL, ::MARISA_MEMORY_ERROR);
++Keyset::Keyset() : keyset_(new marisa::Keyset) {
+ }
+
+ Keyset::~Keyset() {
+@@ -82,8 +81,7 @@ void Keyset::clear() {
+ }
+
+ Agent::Agent()
+- : agent_(new (std::nothrow) marisa::Agent), buf_(NULL), buf_size_(0) {
+- MARISA_THROW_IF(agent_ == NULL, ::MARISA_MEMORY_ERROR);
++ : agent_(new marisa::Agent), buf_(NULL), buf_size_(0) {
+ }
+
+ Agent::~Agent() {
+@@ -101,8 +99,7 @@ void Agent::set_query(const char *ptr, size_t length) {
+ new_buf_size *= 2;
+ }
+ }
+- char *new_buf = new (std::nothrow) char[new_buf_size];
+- MARISA_THROW_IF(new_buf == NULL, MARISA_MEMORY_ERROR);
++ char *new_buf = new char[new_buf_size];
+ delete [] buf_;
+ buf_ = new_buf;
+ buf_size_ = new_buf_size;
+@@ -141,8 +138,7 @@ size_t Agent::query_id() const {
+ return agent_->query().id();
+ }
+
+-Trie::Trie() : trie_(new (std::nothrow) marisa::Trie) {
+- MARISA_THROW_IF(trie_ == NULL, ::MARISA_MEMORY_ERROR);
++Trie::Trie() : trie_(new marisa::Trie) {
+ }
+
+ Trie::~Trie() {
+@@ -195,8 +191,7 @@ void Trie::reverse_lookup(size_t id,
+ marisa::Agent agent;
+ agent.set_query(id);
+ trie_->reverse_lookup(agent);
+- char * const buf = new (std::nothrow) char[agent.key().length()];
+- MARISA_THROW_IF(buf == NULL, MARISA_MEMORY_ERROR);
++ char * const buf = new char[agent.key().length()];
+ std::memcpy(buf, agent.key().ptr(), agent.key().length());
+ *ptr_out_to_be_deleted = buf;
+ *length_out = agent.key().length();
+diff --git a/bindings/marisa-swig.cxx b/bindings/marisa-swig.cxx
+index 6c9037c..593f5f0 100644
+--- a/bindings/marisa-swig.cxx
++++ b/bindings/marisa-swig.cxx
+@@ -27,8 +27,7 @@ size_t Query::id() const {
+ return query_.id();
+ }
+
+-Keyset::Keyset() : keyset_(new (std::nothrow) marisa::Keyset) {
+- MARISA_THROW_IF(keyset_ == NULL, ::MARISA_MEMORY_ERROR);
++Keyset::Keyset() : keyset_(new marisa::Keyset) {
+ }
+
+ Keyset::~Keyset() {
+@@ -82,8 +81,7 @@ void Keyset::clear() {
+ }
+
+ Agent::Agent()
+- : agent_(new (std::nothrow) marisa::Agent), buf_(NULL), buf_size_(0) {
+- MARISA_THROW_IF(agent_ == NULL, ::MARISA_MEMORY_ERROR);
++ : agent_(new marisa::Agent), buf_(NULL), buf_size_(0) {
+ }
+
+ Agent::~Agent() {
+@@ -101,8 +99,7 @@ void Agent::set_query(const char *ptr, size_t length) {
+ new_buf_size *= 2;
+ }
+ }
+- char *new_buf = new (std::nothrow) char[new_buf_size];
+- MARISA_THROW_IF(new_buf == NULL, MARISA_MEMORY_ERROR);
++ char *new_buf = new char[new_buf_size];
+ delete [] buf_;
+ buf_ = new_buf;
+ buf_size_ = new_buf_size;
+@@ -141,8 +138,7 @@ size_t Agent::query_id() const {
+ return agent_->query().id();
+ }
+
+-Trie::Trie() : trie_(new (std::nothrow) marisa::Trie) {
+- MARISA_THROW_IF(trie_ == NULL, ::MARISA_MEMORY_ERROR);
++Trie::Trie() : trie_(new marisa::Trie) {
+ }
+
+ Trie::~Trie() {
+@@ -195,8 +191,7 @@ void Trie::reverse_lookup(size_t id,
+ marisa::Agent agent;
+ agent.set_query(id);
+ trie_->reverse_lookup(agent);
+- char * const buf = new (std::nothrow) char[agent.key().length()];
+- MARISA_THROW_IF(buf == NULL, MARISA_MEMORY_ERROR);
++ char * const buf = new char[agent.key().length()];
+ std::memcpy(buf, agent.key().ptr(), agent.key().length());
+ *ptr_out_to_be_deleted = buf;
+ *length_out = agent.key().length();
+diff --git a/bindings/perl/marisa-swig.cxx b/bindings/perl/marisa-swig.cxx
+index 6c9037c..593f5f0 100644
+--- a/bindings/perl/marisa-swig.cxx
++++ b/bindings/perl/marisa-swig.cxx
+@@ -27,8 +27,7 @@ size_t Query::id() const {
+ return query_.id();
+ }
+
+-Keyset::Keyset() : keyset_(new (std::nothrow) marisa::Keyset) {
+- MARISA_THROW_IF(keyset_ == NULL, ::MARISA_MEMORY_ERROR);
++Keyset::Keyset() : keyset_(new marisa::Keyset) {
+ }
+
+ Keyset::~Keyset() {
+@@ -82,8 +81,7 @@ void Keyset::clear() {
+ }
+
+ Agent::Agent()
+- : agent_(new (std::nothrow) marisa::Agent), buf_(NULL), buf_size_(0) {
+- MARISA_THROW_IF(agent_ == NULL, ::MARISA_MEMORY_ERROR);
++ : agent_(new marisa::Agent), buf_(NULL), buf_size_(0) {
+ }
+
+ Agent::~Agent() {
+@@ -101,8 +99,7 @@ void Agent::set_query(const char *ptr, size_t length) {
+ new_buf_size *= 2;
+ }
+ }
+- char *new_buf = new (std::nothrow) char[new_buf_size];
+- MARISA_THROW_IF(new_buf == NULL, MARISA_MEMORY_ERROR);
++ char *new_buf = new char[new_buf_size];
+ delete [] buf_;
+ buf_ = new_buf;
+ buf_size_ = new_buf_size;
+@@ -141,8 +138,7 @@ size_t Agent::query_id() const {
+ return agent_->query().id();
+ }
+
+-Trie::Trie() : trie_(new (std::nothrow) marisa::Trie) {
+- MARISA_THROW_IF(trie_ == NULL, ::MARISA_MEMORY_ERROR);
++Trie::Trie() : trie_(new marisa::Trie) {
+ }
+
+ Trie::~Trie() {
+@@ -195,8 +191,7 @@ void Trie::reverse_lookup(size_t id,
+ marisa::Agent agent;
+ agent.set_query(id);
+ trie_->reverse_lookup(agent);
+- char * const buf = new (std::nothrow) char[agent.key().length()];
+- MARISA_THROW_IF(buf == NULL, MARISA_MEMORY_ERROR);
++ char * const buf = new char[agent.key().length()];
+ std::memcpy(buf, agent.key().ptr(), agent.key().length());
+ *ptr_out_to_be_deleted = buf;
+ *length_out = agent.key().length();
+diff --git a/bindings/python/marisa-swig.cxx b/bindings/python/marisa-swig.cxx
+index ec7460a..593f5f0 100644
+--- a/bindings/python/marisa-swig.cxx
++++ b/bindings/python/marisa-swig.cxx
+@@ -27,8 +27,7 @@ size_t Query::id() const {
+ return query_.id();
+ }
+
+-Keyset::Keyset() : keyset_(new (std::nothrow) marisa::Keyset) {
+- MARISA_THROW_IF(keyset_ == NULL, ::MARISA_MEMORY_ERROR);
++Keyset::Keyset() : keyset_(new marisa::Keyset) {
+ }
+
+ Keyset::~Keyset() {
+@@ -82,8 +81,7 @@ void Keyset::clear() {
+ }
+
+ Agent::Agent()
+- : agent_(new (std::nothrow) marisa::Agent), buf_(NULL), buf_size_(0) {
+- MARISA_THROW_IF(agent_ == NULL, ::MARISA_MEMORY_ERROR);
++ : agent_(new marisa::Agent), buf_(NULL), buf_size_(0) {
+ }
+
+ Agent::~Agent() {
+@@ -101,8 +99,7 @@ void Agent::set_query(const char *ptr, size_t length) {
+ new_buf_size *= 2;
+ }
+ }
+- char *new_buf = new (std::nothrow) char[new_buf_size];
+- MARISA_THROW_IF(new_buf == NULL, MARISA_MEMORY_ERROR);
++ char *new_buf = new char[new_buf_size];
+ delete [] buf_;
+ buf_ = new_buf;
+ buf_size_ = new_buf_size;
+@@ -141,8 +138,7 @@ size_t Agent::query_id() const {
+ return agent_->query().id();
+ }
+
+-Trie::Trie() : trie_(new (std::nothrow) marisa::Trie) {
+- MARISA_THROW_IF(trie_ == NULL, ::MARISA_MEMORY_ERROR);
++Trie::Trie() : trie_(new marisa::Trie) {
+ }
+
+ Trie::~Trie() {
+@@ -153,7 +149,7 @@ void Trie::build(Keyset &keyset, int config_flags) {
+ trie_->build(*keyset.keyset_, config_flags);
+ }
+
+-void Trie::mmap(const char *filename, , int flags) {
++void Trie::mmap(const char *filename, int flags) {
+ trie_->mmap(filename, flags);
+ }
+
+@@ -195,8 +191,7 @@ void Trie::reverse_lookup(size_t id,
+ marisa::Agent agent;
+ agent.set_query(id);
+ trie_->reverse_lookup(agent);
+- char * const buf = new (std::nothrow) char[agent.key().length()];
+- MARISA_THROW_IF(buf == NULL, MARISA_MEMORY_ERROR);
++ char * const buf = new char[agent.key().length()];
+ std::memcpy(buf, agent.key().ptr(), agent.key().length());
+ *ptr_out_to_be_deleted = buf;
+ *length_out = agent.key().length();
+diff --git a/bindings/python3/marisa-swig-python3.cxx b/bindings/python3/marisa-swig-python3.cxx
+index 50ab6b0..10bbad3 100644
+--- a/bindings/python3/marisa-swig-python3.cxx
++++ b/bindings/python3/marisa-swig-python3.cxx
+@@ -27,8 +27,7 @@ size_t Query::query_id() const {
+ return query_.id();
+ }
+
+-Keyset::Keyset() : keyset_(new (std::nothrow) marisa::Keyset) {
+- MARISA_THROW_IF(keyset_ == NULL, ::MARISA_MEMORY_ERROR);
++Keyset::Keyset() : keyset_(new marisa::Keyset) {
+ }
+
+ Keyset::~Keyset() {
+@@ -82,8 +81,7 @@ void Keyset::clear() {
+ }
+
+ Agent::Agent()
+- : agent_(new (std::nothrow) marisa::Agent), buf_(NULL), buf_size_(0) {
+- MARISA_THROW_IF(agent_ == NULL, ::MARISA_MEMORY_ERROR);
++ : agent_(new marisa::Agent), buf_(NULL), buf_size_(0) {
+ }
+
+ Agent::~Agent() {
+@@ -101,8 +99,7 @@ void Agent::set_query(const char *ptr, size_t length) {
+ new_buf_size *= 2;
+ }
+ }
+- char *new_buf = new (std::nothrow) char[new_buf_size];
+- MARISA_THROW_IF(new_buf == NULL, MARISA_MEMORY_ERROR);
++ char *new_buf = new char[new_buf_size];
+ delete [] buf_;
+ buf_ = new_buf;
+ buf_size_ = new_buf_size;
+@@ -141,8 +138,7 @@ size_t Agent::query_id() const {
+ return agent_->query().id();
+ }
+
+-Trie::Trie() : trie_(new (std::nothrow) marisa::Trie) {
+- MARISA_THROW_IF(trie_ == NULL, ::MARISA_MEMORY_ERROR);
++Trie::Trie() : trie_(new marisa::Trie) {
+ }
+
+ Trie::~Trie() {
+@@ -195,8 +191,7 @@ void Trie::reverse_lookup(size_t id,
+ marisa::Agent agent;
+ agent.set_query(id);
+ trie_->reverse_lookup(agent);
+- char * const buf = new (std::nothrow) char[agent.key().length()];
+- MARISA_THROW_IF(buf == NULL, MARISA_MEMORY_ERROR);
++ char * const buf = new char[agent.key().length()];
+ std::memcpy(buf, agent.key().ptr(), agent.key().length());
+ *ptr_out_to_be_deleted = buf;
+ *length_out = agent.key().length();
+diff --git a/bindings/ruby/marisa-swig.cxx b/bindings/ruby/marisa-swig.cxx
+index 6c9037c..593f5f0 100644
+--- a/bindings/ruby/marisa-swig.cxx
++++ b/bindings/ruby/marisa-swig.cxx
+@@ -27,8 +27,7 @@ size_t Query::id() const {
+ return query_.id();
+ }
+
+-Keyset::Keyset() : keyset_(new (std::nothrow) marisa::Keyset) {
+- MARISA_THROW_IF(keyset_ == NULL, ::MARISA_MEMORY_ERROR);
++Keyset::Keyset() : keyset_(new marisa::Keyset) {
+ }
+
+ Keyset::~Keyset() {
+@@ -82,8 +81,7 @@ void Keyset::clear() {
+ }
+
+ Agent::Agent()
+- : agent_(new (std::nothrow) marisa::Agent), buf_(NULL), buf_size_(0) {
+- MARISA_THROW_IF(agent_ == NULL, ::MARISA_MEMORY_ERROR);
++ : agent_(new marisa::Agent), buf_(NULL), buf_size_(0) {
+ }
+
+ Agent::~Agent() {
+@@ -101,8 +99,7 @@ void Agent::set_query(const char *ptr, size_t length) {
+ new_buf_size *= 2;
+ }
+ }
+- char *new_buf = new (std::nothrow) char[new_buf_size];
+- MARISA_THROW_IF(new_buf == NULL, MARISA_MEMORY_ERROR);
++ char *new_buf = new char[new_buf_size];
+ delete [] buf_;
+ buf_ = new_buf;
+ buf_size_ = new_buf_size;
+@@ -141,8 +138,7 @@ size_t Agent::query_id() const {
+ return agent_->query().id();
+ }
+
+-Trie::Trie() : trie_(new (std::nothrow) marisa::Trie) {
+- MARISA_THROW_IF(trie_ == NULL, ::MARISA_MEMORY_ERROR);
++Trie::Trie() : trie_(new marisa::Trie) {
+ }
+
+ Trie::~Trie() {
+@@ -195,8 +191,7 @@ void Trie::reverse_lookup(size_t id,
+ marisa::Agent agent;
+ agent.set_query(id);
+ trie_->reverse_lookup(agent);
+- char * const buf = new (std::nothrow) char[agent.key().length()];
+- MARISA_THROW_IF(buf == NULL, MARISA_MEMORY_ERROR);
++ char * const buf = new char[agent.key().length()];
+ std::memcpy(buf, agent.key().ptr(), agent.key().length());
+ *ptr_out_to_be_deleted = buf;
+ *length_out = agent.key().length();
diff --git a/dev-libs/marisa/files/marisa-0.3.1-install-all-configs.patch b/dev-libs/marisa/files/marisa-0.3.1-install-all-configs.patch
new file mode 100644
index 000000000000..eb23fc0e148e
--- /dev/null
+++ b/dev-libs/marisa/files/marisa-0.3.1-install-all-configs.patch
@@ -0,0 +1,21 @@
+Remove CONFIGURATIONS Release from install() so the library and tools
+are installed regardless of the cmake build type (e.g. RelWithDebInfo).
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -258,7 +258,6 @@
+ install(
+ TARGETS marisa
+ EXPORT MarisaTargets
+- CONFIGURATIONS Release
+ DESTINATION ${LIB_INSTALL_DIR}
+ COMPONENT Library
+ )
+@@ -272,7 +271,6 @@
+ if(ENABLE_TOOLS)
+ install(
+ TARGETS ${MARISA_TOOLS}
+- CONFIGURATIONS Release
+ COMPONENT Binaries
+ )
+ endif()
diff --git a/dev-libs/marisa/marisa-0.2.7.ebuild b/dev-libs/marisa/marisa-0.2.7.ebuild
new file mode 100644
index 000000000000..0ec1d6aba61f
--- /dev/null
+++ b/dev-libs/marisa/marisa-0.2.7.ebuild
@@ -0,0 +1,121 @@
+# Copyright 2014-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+PYTHON_COMPAT=( python3_{13..14} )
+DISTUTILS_USE_PEP517="setuptools"
+DISTUTILS_OPTIONAL="1"
+DISTUTILS_EXT=1
+
+inherit autotools distutils-r1 toolchain-funcs
+
+if [[ "${PV}" == "9999" ]]; then
+ inherit git-r3
+
+ EGIT_REPO_URI="https://github.com/s-yata/marisa-trie"
+fi
+
+DESCRIPTION="Matching Algorithm with Recursively Implemented StorAge"
+HOMEPAGE="https://github.com/s-yata/marisa-trie https://code.google.com/archive/p/marisa-trie/"
+if [[ "${PV}" != "9999" ]]; then
+ SRC_URI="https://github.com/s-yata/marisa-trie/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+fi
+
+LICENSE="|| ( BSD-2 LGPL-2.1+ )"
+SLOT="0"
+KEYWORDS="amd64 arm64 ~hppa ~loong ppc ppc64 ~riscv ~sparc x86"
+IUSE="python static-libs"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+BDEPEND="python? (
+ ${PYTHON_DEPS}
+ ${DISTUTILS_DEPS}
+ dev-lang/swig
+ )"
+DEPEND="python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+
+if [[ "${PV}" != "9999" ]]; then
+ S="${WORKDIR}/marisa-trie-${PV}"
+fi
+
+src_prepare() {
+ default
+ eautoreconf
+
+ sed -e "s:^\([[:space:]]*\)libraries=:\1include_dirs=[\"../../include\"],\n\1library_dirs=[\"../../lib/marisa/.libs\"],\n&:" \
+ -i bindings/python/setup.py || die
+
+ if use python; then
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_prepare
+ popd > /dev/null || die
+ fi
+}
+
+src_configure() {
+ local -x CPPFLAGS="${CPPFLAGS} ${CXXFLAGS}"
+
+ cpu_instructions_option() {
+ local option="${1}"
+ local macros="${2}"
+ local result="--enable-${option}"
+ local macro
+ for macro in ${macros}; do
+ if ! $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P -dM - < /dev/null 2> /dev/null \
+ | grep -Eq "^#define ${macro}([[:space:]]|$)"; then
+ result="--disable-${option}"
+ fi
+ done
+ echo "${result}"
+ }
+
+ local options=(
+ $(cpu_instructions_option sse2 __SSE2__)
+ $(cpu_instructions_option sse3 __SSE3__)
+ $(cpu_instructions_option ssse3 __SSSE3__)
+ $(cpu_instructions_option sse4.1 __SSE4_1__)
+ $(cpu_instructions_option sse4.2 __SSE4_2__)
+ $(cpu_instructions_option sse4 __POPCNT__ __SSE4_2__)
+ $(cpu_instructions_option sse4a __SSE4A__)
+ $(cpu_instructions_option popcnt __POPCNT__)
+ $(cpu_instructions_option bmi __BMI__)
+ $(cpu_instructions_option bmi2 __BMI2__)
+ $(use_enable static-libs static)
+ )
+
+ econf "${options[@]}"
+
+ if use python; then
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_configure
+ popd > /dev/null || die
+ fi
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ emake -C bindings swig-python
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_compile
+ popd > /dev/null || die
+ fi
+}
+
+src_install() {
+ default
+ find "${ED}" -name "*.la" -delete || die
+
+ (
+ docinto html
+ dodoc docs/*
+ )
+
+ if use python; then
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_install
+ popd > /dev/null || die
+ fi
+}
diff --git a/dev-libs/marisa/marisa-0.3.1-r2.ebuild b/dev-libs/marisa/marisa-0.3.1-r2.ebuild
new file mode 100644
index 000000000000..69968ee8bc82
--- /dev/null
+++ b/dev-libs/marisa/marisa-0.3.1-r2.ebuild
@@ -0,0 +1,90 @@
+# Copyright 2014-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+PYTHON_COMPAT=( python3_{13..14} )
+DISTUTILS_USE_PEP517="setuptools"
+DISTUTILS_OPTIONAL="1"
+DISTUTILS_EXT=1
+
+inherit cmake distutils-r1
+
+DESCRIPTION="Matching Algorithm with Recursively Implemented StorAge"
+HOMEPAGE="https://github.com/s-yata/marisa-trie"
+SRC_URI="https://github.com/s-yata/marisa-trie/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+S="${WORKDIR}/marisa-trie-${PV}"
+
+LICENSE="|| ( BSD-2 LGPL-2.1+ )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="python tools"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+BDEPEND="python? (
+ ${PYTHON_DEPS}
+ ${DISTUTILS_DEPS}
+ dev-lang/swig
+ )"
+DEPEND="python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-install-all-configs.patch"
+ "${FILESDIR}/${P}-fix-swig-bindings.patch"
+)
+
+src_prepare() {
+ cmake_src_prepare
+
+ sed -e "s:^\([[:space:]]*\)libraries=:\1include_dirs=[\"${S}/include\"],\n\1library_dirs=[\"${BUILD_DIR}\"],\n&:" \
+ -e "s:setup(name = \"marisa\":setup(name = \"marisa\", version = \"${PV}\":" \
+ -i bindings/python/setup.py || die
+
+ if use python; then
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_prepare
+ popd > /dev/null || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
+ -DENABLE_TOOLS=$(usex tools)
+ -DBUILD_TESTING=OFF
+ )
+ cmake_src_configure
+
+ if use python; then
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_configure
+ popd > /dev/null || die
+ fi
+}
+
+src_compile() {
+ cmake_src_compile
+
+ if use python; then
+ emake -C bindings swig-python
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_compile
+ popd > /dev/null || die
+ fi
+}
+
+src_install() {
+ cmake_src_install
+
+ (
+ docinto html
+ dodoc docs/*
+ )
+
+ if use python; then
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_install
+ popd > /dev/null || die
+ fi
+}
diff --git a/dev-libs/marisa/marisa-9999.ebuild b/dev-libs/marisa/marisa-9999.ebuild
new file mode 100644
index 000000000000..c2a411bbf169
--- /dev/null
+++ b/dev-libs/marisa/marisa-9999.ebuild
@@ -0,0 +1,86 @@
+# Copyright 2014-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+PYTHON_COMPAT=( python3_{13..14} )
+DISTUTILS_USE_PEP517="setuptools"
+DISTUTILS_OPTIONAL="1"
+DISTUTILS_EXT=1
+
+inherit cmake distutils-r1 git-r3
+
+DESCRIPTION="Matching Algorithm with Recursively Implemented StorAge"
+HOMEPAGE="https://github.com/s-yata/marisa-trie"
+EGIT_REPO_URI="https://github.com/s-yata/marisa-trie"
+
+LICENSE="|| ( BSD-2 LGPL-2.1+ )"
+SLOT="0"
+IUSE="python tools"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+BDEPEND="python? (
+ ${PYTHON_DEPS}
+ ${DISTUTILS_DEPS}
+ dev-lang/swig
+ )"
+DEPEND="python? ( ${PYTHON_DEPS} )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/marisa-0.3.1-install-all-configs.patch"
+)
+
+src_prepare() {
+ cmake_src_prepare
+
+ sed -e "s:^\([[:space:]]*\)libraries=:\1include_dirs=[\"${S}/include\"],\n\1library_dirs=[\"${BUILD_DIR}\"],\n&:" \
+ -e "s:setup(name = \"marisa\":setup(name = \"marisa\", version = \"${PV}\":" \
+ -i bindings/python/setup.py || die
+
+ if use python; then
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_prepare
+ popd > /dev/null || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLIB_INSTALL_DIR="${EPREFIX}/usr/$(get_libdir)"
+ -DENABLE_TOOLS=$(usex tools)
+ -DBUILD_TESTING=OFF
+ )
+ cmake_src_configure
+
+ if use python; then
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_configure
+ popd > /dev/null || die
+ fi
+}
+
+src_compile() {
+ cmake_src_compile
+
+ if use python; then
+ emake -C bindings swig-python
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_compile
+ popd > /dev/null || die
+ fi
+}
+
+src_install() {
+ cmake_src_install
+
+ (
+ docinto html
+ dodoc docs/*
+ )
+
+ if use python; then
+ pushd bindings/python > /dev/null || die
+ distutils-r1_src_install
+ popd > /dev/null || die
+ fi
+}
diff --git a/dev-libs/marisa/metadata.xml b/dev-libs/marisa/metadata.xml
new file mode 100644
index 000000000000..8f74f7d7adb6
--- /dev/null
+++ b/dev-libs/marisa/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>vowstar@gmail.com</email>
+ <name>Huang Rui</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>cjk@gentoo.org</email>
+ <name>Cjk</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <use>
+ <flag name="tools">Build command-line tools</flag>
+ </use>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>