summaryrefslogtreecommitdiff
path: root/dev-libs/marisa/marisa-0.2.6.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
commitd934827bf44b7cfcf6711964418148fa60877668 (patch)
tree0625f358789b5e015e49db139cc1dbc9be00428f /dev-libs/marisa/marisa-0.2.6.ebuild
parent2e34d110f164bf74d55fced27fe0000201b3eec5 (diff)
gentoo resync : 25.11.2020
Diffstat (limited to 'dev-libs/marisa/marisa-0.2.6.ebuild')
-rw-r--r--dev-libs/marisa/marisa-0.2.6.ebuild119
1 files changed, 119 insertions, 0 deletions
diff --git a/dev-libs/marisa/marisa-0.2.6.ebuild b/dev-libs/marisa/marisa-0.2.6.ebuild
new file mode 100644
index 000000000000..3f1328fe785d
--- /dev/null
+++ b/dev-libs/marisa/marisa-0.2.6.ebuild
@@ -0,0 +1,119 @@
+# Copyright 2014-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+PYTHON_COMPAT=(python{3_6,3_7,3_8,3_9})
+DISTUTILS_OPTIONAL="1"
+DISTUTILS_USE_SETUPTOOLS="no"
+
+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=""
+else
+ 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 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="python static-libs"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+BDEPEND="python? (
+ ${PYTHON_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
+}