gentoo/dev-libs/vectorscan/vectorscan-5.4.12.ebuild
Sam James 379762753a
dev-libs/vectorscan: Stabilize 5.4.12 x86, #962120
Signed-off-by: Sam James <sam@gentoo.org>
2025-12-16 10:23:40 +00:00

81 lines
1.6 KiB
Bash

# Copyright 2023-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake edo flag-o-matic
DESCRIPTION="A portable fork of the high-performance regular expression matching library"
HOMEPAGE="
https://vectorcamp.gr/vectorscan/
https://github.com/VectorCamp/vectorscan
"
SRC_URI="
https://github.com/VectorCamp/vectorscan/archive/refs/tags/${PN}/${PV}.tar.gz
-> ${P}.tar.gz
"
S="${WORKDIR}/${PN}-${P}"
LICENSE="BSD"
SLOT="0/5"
KEYWORDS="amd64 x86"
IUSE="cpu_flags_x86_avx2 cpu_flags_x86_sse4_2"
DEPEND="
dev-libs/boost:=
"
RDEPEND="
${DEPEND}
!dev-libs/hyperscan
"
BDEPEND="
dev-util/ragel
virtual/pkgconfig
"
REQUIRED_USE="
x86? ( cpu_flags_x86_sse4_2 )
amd64? ( cpu_flags_x86_sse4_2 )
"
PATCHES=(
"${FILESDIR}"/${PN}-5.4.12-build.patch
)
src_prepare() {
local sedargs=(
# Respect user -m flags (march/mtune)
-e '/set(ARCH_CX*_FLAG/d'
# Respect user -O flags
-e '/set(OPT_CX*_FLAG/d'
)
sed -i "${sedargs[@]}" CMakeLists.txt cmake/cflags-x86.cmake || die
sed -i '/-Werror/d' cmake/cflags-generic.cmake || die
cmake_src_prepare
}
src_configure() {
use cpu_flags_x86_avx2 && append-flags -mavx2
use cpu_flags_x86_sse4_2 && append-flags -msse4.2
local mycmakeargs=(
-DBUILD_BENCHMARKS=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_SHARED_LIBS=ON
-DBUILD_AVX2=$(usex cpu_flags_x86_avx2)
-DFAT_RUNTIME=OFF
-DUSE_CPU_NATIVE=OFF
)
cmake_src_configure
}
src_test() {
# The unit target cannot be used currently due to a bug in it,
# see https://github.com/VectorCamp/vectorscan/issues/202
#cmake_build unit
edo "${BUILD_DIR}/bin/unit-hyperscan"
}