You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
2.2 KiB
86 lines
2.2 KiB
# Copyright 1999-2015 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
# $Id$
|
|
|
|
EAPI=5
|
|
|
|
PYTHON_COMPAT=( python{2_7,3_3,3_4} )
|
|
DISTUTILS_OPTIONAL=1
|
|
|
|
inherit distutils-r1 eutils
|
|
|
|
DESCRIPTION="Matching Algorithm with Recursively Implemented StorAge"
|
|
HOMEPAGE="https://code.google.com/p/marisa-trie/"
|
|
SRC_URI="https://marisa-trie.googlecode.com/files/${P}.tar.gz"
|
|
|
|
LICENSE="BSD"
|
|
SLOT="0"
|
|
KEYWORDS="amd64 ~arm64 ~ppc ppc64 ~x86"
|
|
IUSE="python doc static-libs cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_ssse3 cpu_flags_x86_sse4_1 cpu_flags_x86_sse4_2 cpu_flags_x86_sse4a cpu_flags_x86_popcnt"
|
|
|
|
DEPEND="python? ( dev-lang/swig ${PYTHON_DEPS} )"
|
|
RDEPEND="python? ( ${PYTHON_DEPS} )"
|
|
|
|
# implied by --enable switches
|
|
REQUIRED_USE="
|
|
cpu_flags_x86_popcnt? ( cpu_flags_x86_sse3 )
|
|
cpu_flags_x86_sse4a? ( cpu_flags_x86_popcnt cpu_flags_x86_sse3 )
|
|
cpu_flags_x86_sse4_2? ( cpu_flags_x86_popcnt cpu_flags_x86_sse4_1 )
|
|
cpu_flags_x86_sse4_1? ( cpu_flags_x86_ssse3 )
|
|
cpu_flags_x86_ssse3? ( cpu_flags_x86_sse3 )
|
|
cpu_flags_x86_sse3? ( cpu_flags_x86_sse2 )
|
|
"
|
|
|
|
src_prepare() {
|
|
epatch "${FILESDIR}/${P}-python.patch"
|
|
if use python; then
|
|
pushd bindings/python || die
|
|
ln -sf ../marisa-swig.i marisa-swig.i || die
|
|
ln -sf ../marisa-swig.h marisa-swig.h || die
|
|
ln -sf ../marisa-swig.cxx marisa-swig.cxx || die
|
|
distutils-r1_src_prepare
|
|
popd || die
|
|
fi
|
|
}
|
|
|
|
src_configure() {
|
|
local myeconfargs=(
|
|
$(use_enable static-libs static)
|
|
$(use_enable cpu_flags_x86_sse2 sse2)
|
|
$(use_enable cpu_flags_x86_sse3 sse3)
|
|
$(use_enable cpu_flags_x86_ssse3 ssse3)
|
|
$(use_enable cpu_flags_x86_sse4_1 sse4.1)
|
|
$(use_enable cpu_flags_x86_sse4_2 sse4.2)
|
|
# sse4 is just an alias to sse4.2
|
|
$(use_enable cpu_flags_x86_sse4a sse4a)
|
|
$(use_enable cpu_flags_x86_popcnt popcnt)
|
|
)
|
|
econf "${myeconfargs[@]}"
|
|
|
|
if use python; then
|
|
pushd bindings/python || die
|
|
distutils-r1_src_prepare
|
|
popd || die
|
|
fi
|
|
}
|
|
|
|
src_compile() {
|
|
default
|
|
if use python; then
|
|
pushd bindings/python || die
|
|
distutils-r1_src_compile
|
|
popd || die
|
|
fi
|
|
}
|
|
|
|
src_install() {
|
|
default
|
|
if use python; then
|
|
pushd bindings/python || die
|
|
distutils-r1_src_install
|
|
popd || die
|
|
fi
|
|
use doc && dohtml docs/readme.en.html
|
|
prune_libtool_files
|
|
}
|