aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2025-10-30 05:25:07 +0000
committerXin LI <delphij@FreeBSD.org>2026-05-01 08:20:55 +0000
commite70dc4653b10f5ea53da0a2b6ed286fe61555e22 (patch)
treebcade42af276c671f07903588c8695a22fc38403
parent6a08bd33c6b12d1812dc5ec50aa24dfd6115913d (diff)
devel/vectorscan: Add vectorscan 5.4.12
Portable fork of high-performance multiple regex matching library
-rw-r--r--devel/Makefile1
-rw-r--r--devel/vectorscan/Makefile66
-rw-r--r--devel/vectorscan/distinfo5
-rw-r--r--devel/vectorscan/files/patch-cmake_build__wrapper.sh27
-rw-r--r--devel/vectorscan/pkg-descr12
-rw-r--r--devel/vectorscan/pkg-plist14
6 files changed, 125 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 1b3717183446..aeda92049c62 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -8698,6 +8698,7 @@
SUBDIR += vc-intrinsics
SUBDIR += vcglib
SUBDIR += vdf
+ SUBDIR += vectorscan
SUBDIR += venom
SUBDIR += vera++
SUBDIR += vexcl
diff --git a/devel/vectorscan/Makefile b/devel/vectorscan/Makefile
new file mode 100644
index 000000000000..dd8bc0cea64d
--- /dev/null
+++ b/devel/vectorscan/Makefile
@@ -0,0 +1,66 @@
+PORTNAME= vectorscan
+PORTVERSION= 5.4.12
+DISTVERSIONPREFIX= vectorscan/
+CATEGORIES= devel textproc
+MASTER_SITES= SF/boost/boost/${BOOST_VERSION}:boost
+DISTFILES= boost_${BOOST_VERSION_UNDER}.tar.gz:boost
+
+MAINTAINER= delphij@FreeBSD.org
+COMMENT= Portable fork of high-performance multiple regex matching library
+WWW= https://github.com/VectorCamp/vectorscan
+
+LICENSE= BSD3CLAUSE
+
+BUILD_DEPENDS= ragel:devel/ragel
+
+USES= compiler:c++11-lib cmake pathfix python:build
+USE_GITHUB= yes
+GH_ACCOUNT= VectorCamp
+
+ONLY_FOR_ARCHS= aarch64 amd64
+
+OPTIONS_DEFINE= SHARED
+OPTIONS_RADIO= ISA
+OPTIONS_RADIO_ISA= NATIVE FAT_RUNTIME
+OPTIONS_RADIO_ISA_amd64= AVX2 AVX512 AVX512VBMI
+OPTIONS_RADIO_ISA_aarch64= SVE SVE2 SVE2_BITPERM
+OPTIONS_SUB= yes
+SHARED_DESC= Build shared library
+NATIVE_DESC= Build with native CPU tunes
+FAT_RUNTIME_DESC= Build for multiple microarchitectures with runtime ISA dispatch
+AVX2_DESC= Enable AVX2 instructions for fixed-ISA builds
+AVX512_DESC= Enable AVX512 instructions for fixed-ISA builds
+AVX512VBMI_DESC= Enable AVX512VBMI instructions for fixed-ISA builds
+SVE_DESC= Enable Arm SVE instructions
+SVE2_DESC= Enable Arm SVE2 instructions
+SVE2_BITPERM_DESC= Enable Arm SVE2 bit permutation instructions
+OPTIONS_DEFAULT= SHARED
+OPTIONS_DEFAULT_amd64= FAT_RUNTIME
+
+CMAKE_ARGS+= -DBOOST_ROOT=${WRKDIR}/boost_${BOOST_VERSION_UNDER}
+NATIVE_CMAKE_BOOL= USE_CPU_NATIVE
+FAT_RUNTIME_CMAKE_BOOL= FAT_RUNTIME
+AVX2_CMAKE_BOOL= BUILD_AVX2
+AVX512_CMAKE_ON= -DBUILD_AVX2:BOOL=ON -DBUILD_AVX512:BOOL=ON
+AVX512VBMI_CMAKE_ON= -DBUILD_AVX2:BOOL=ON -DBUILD_AVX512:BOOL=ON \
+ -DBUILD_AVX512VBMI:BOOL=ON
+SVE_CMAKE_BOOL= BUILD_SVE
+SVE2_CMAKE_ON= -DBUILD_SVE:BOOL=ON -DBUILD_SVE2:BOOL=ON
+SVE2_BITPERM_CMAKE_ON= -DBUILD_SVE:BOOL=ON -DBUILD_SVE2:BOOL=ON \
+ -DBUILD_SVE2_BITPERM:BOOL=ON
+SHARED_CMAKE_ON= -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=ON
+SHARED_CMAKE_OFF= -DBUILD_STATIC_LIBS:BOOL=ON
+SHARED_VARS= PLIST_SUB+="SOVERSION=${PORTVERSION}" \
+ PLIST_SUB+="SOSHORTVERSION=${PORTVERSION:R:R}"
+
+CFLAGS+= -fPIC
+BOOST_VERSION= 1.89.0
+BOOST_VERSION_UNDER= ${BOOST_VERSION:C/\./_/g}
+
+post-patch:
+ ${RM} ${WRKSRC}/tools/CMakeLists.txt
+
+do-test:
+ cd ${BUILD_WRKSRC} && ${MAKE_CMD} unit
+
+.include <bsd.port.mk>
diff --git a/devel/vectorscan/distinfo b/devel/vectorscan/distinfo
new file mode 100644
index 000000000000..70e3252ab674
--- /dev/null
+++ b/devel/vectorscan/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1761796423
+SHA256 (boost_1_89_0.tar.gz) = 9de758db755e8330a01d995b0a24d09798048400ac25c03fc5ea9be364b13c93
+SIZE (boost_1_89_0.tar.gz) = 190099283
+SHA256 (VectorCamp-vectorscan-vectorscan-5.4.12_GH0.tar.gz) = 1ac4f3c038ac163973f107ac4423a6b246b181ffd97fdd371696b2517ec9b3ed
+SIZE (VectorCamp-vectorscan-vectorscan-5.4.12_GH0.tar.gz) = 20849791
diff --git a/devel/vectorscan/files/patch-cmake_build__wrapper.sh b/devel/vectorscan/files/patch-cmake_build__wrapper.sh
new file mode 100644
index 000000000000..7f1908b73d1c
--- /dev/null
+++ b/devel/vectorscan/files/patch-cmake_build__wrapper.sh
@@ -0,0 +1,27 @@
+--- cmake/build_wrapper.sh.orig 2025-10-30 04:35:01 UTC
++++ cmake/build_wrapper.sh
+@@ -17,19 +17,19 @@ if [ `uname` = "FreeBSD" ]; then
+ LIBC_SO=$("$@" --print-file-name=libc.so.6)
+ NM_FLAG="-f"
+ if [ `uname` = "FreeBSD" ]; then
+- # for freebsd, we will specify the name,
++ # for freebsd, we will specify the name,
+ # we will leave it work as is in linux
+ LIBC_SO=/lib/libc.so.7
+- # also, in BSD, the nm flag -F corresponds to the -f flag in linux.
+- NM_FLAG="-F"
++ # FreeBSD nm uses -f with full format name, Linux -f uses single letters
++ NM_FLAG="-f posix"
+ fi
+ cp ${KEEPSYMS_IN} ${KEEPSYMS}
+ # get all symbols from libc and turn them into patterns
+-nm ${NM_FLAG} p -g -D ${LIBC_SO} | sed 's/\([^ @]*\).*/^\1$/' >> ${KEEPSYMS}
++nm ${NM_FLAG} -p -g -D ${LIBC_SO} | sed 's/\([^ @]*\).*/^\1$/' >> ${KEEPSYMS}
+ # build the object
+ "$@"
+ # rename the symbols in the object
+-nm ${NM_FLAG} p -g ${OUT} | cut -f1 -d' ' | grep -v -f ${KEEPSYMS} | sed -e "s/\(.*\)/\1\ ${PREFIX}_\1/" >> ${SYMSFILE}
++nm ${NM_FLAG} -p -g ${OUT} | cut -f1 -d' ' | grep -v -f ${KEEPSYMS} | sed -e "s/\(.*\)/\1\ ${PREFIX}_\1/" >> ${SYMSFILE}
+ if test -s ${SYMSFILE}
+ then
+ objcopy --redefine-syms=${SYMSFILE} ${OUT}
diff --git a/devel/vectorscan/pkg-descr b/devel/vectorscan/pkg-descr
new file mode 100644
index 000000000000..99a29731e5bf
--- /dev/null
+++ b/devel/vectorscan/pkg-descr
@@ -0,0 +1,12 @@
+Vectorscan is a portable fork of Intel's Hyperscan, a high-performance multiple
+regex matching library. It follows the regular expression syntax of the
+commonly-used libpcre library, yet functions as a standalone library with its
+own API written in C.
+
+Vectorscan uses hybrid automata techniques to allow simultaneous matching of
+large numbers (up to tens of thousands) of regular expressions, as well as
+matching of regular expressions across streams of data.
+
+This portable fork extends support beyond x86 to additional architectures
+including ARM NEON/ASIMD and Power VSX, making it suitable for a wider range
+of platforms while maintaining API compatibility with Hyperscan 5.4.
diff --git a/devel/vectorscan/pkg-plist b/devel/vectorscan/pkg-plist
new file mode 100644
index 000000000000..7b42fd94c41f
--- /dev/null
+++ b/devel/vectorscan/pkg-plist
@@ -0,0 +1,14 @@
+include/hs/hs.h
+include/hs/hs_common.h
+include/hs/hs_compile.h
+include/hs/hs_runtime.h
+include/hs/hs_version.h
+lib/libhs.a
+lib/libhs_runtime.a
+libdata/pkgconfig/libhs.pc
+%%SHARED%%lib/libhs.so.%%SOVERSION%%
+%%SHARED%%lib/libhs.so.%%SOSHORTVERSION%%
+%%SHARED%%lib/libhs.so
+%%SHARED%%lib/libhs_runtime.so.%%SOVERSION%%
+%%SHARED%%lib/libhs_runtime.so.%%SOSHORTVERSION%%
+%%SHARED%%lib/libhs_runtime.so