From 01ada42799375baf2689970b29c4a980a934d595 Mon Sep 17 00:00:00 2001 From: Duncan Bellamy Date: Fri, 2 Oct 2020 06:49:33 +0000 Subject: testing/hyperscan: new aport fix lint error try x86 fix cmake invovation fix lint error remove x86 as needs sse3 add libs sub-package fix lint errors try x86 with -msse3 fix libs location fix typo remove unused sphinx variable remove libs package as main package only 12k with seperate libs change from -msse3 to -march=prescott add -msse3 back to x86 try and disable avx2 for x86 * change x86 to -march=core2 as docs say to use for ssse3 * remove libpcap as for example code add tools subpackage fix tools sub package try and fix tools again check location change permissions on tools try recursive chmod change " to wavy brackets use cp not mv mkdir change to builddir mobe in package remove {} from package remove {} from tools subpackage merge x86 x86_64 case change url add reason for x86 and x86_64 only make MARCH local and give default value fix lint error make _march default better build dec docs add all build target as well add --target to build move html dir instead of copy files fix src html location try -march=prescott for x86 change x86 back to -march=core2 --- testing/hyperscan/APKBUILD | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 testing/hyperscan/APKBUILD diff --git a/testing/hyperscan/APKBUILD b/testing/hyperscan/APKBUILD new file mode 100644 index 0000000000..461500ba0c --- /dev/null +++ b/testing/hyperscan/APKBUILD @@ -0,0 +1,58 @@ +# Contributor: Duncan Bellamy +# Maintainer: Duncan Bellamy +pkgname=hyperscan +pkgver=5.3.0 +pkgrel=0 +pkgdesc="High-performance regular expression matching library" +url="https://www.hyperscan.io" +arch="x86 x86_64" #requires SSSE3 +license="BSD-3-Clause" +makedepends="cmake ragel boost-dev pcre-dev sqlite-dev py3-breathe" +subpackages="$pkgname-doc $pkgname-dev $pkgname-tools" +source="$pkgname-$pkgver.tar.gz::https://github.com/intel/hyperscan/archive/v$pkgver.tar.gz" + +build() { + local _march="-march=native" + case "${CARCH:-native}" in + x86|x86_64) + _march="-march=core2" ;; + esac + + if [ "$CBUILD" != "$CHOST" ]; then + CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" + fi + cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_C_FLAGS="$CFLAGS $_march" \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS $_march" \ + -DBUILD_STATIC_AND_SHARED=ON \ + "$CMAKE_CROSSOPTS" . + cmake --build build --target all dev-reference +} + +check() { + cd build + ./bin/unit-hyperscan +} + +package() { + DESTDIR="$pkgdir" cmake --build build --target install + + cd "$pkgdir" + install -Dm644 "$builddir"/LICENSE usr/share/licenses/$pkgname/LICENSE + mkdir -p usr/bin + mv "$builddir"/build/bin/hsdump \ + "$builddir"/build/bin/hscheck \ + "$builddir"/build/bin/hsbench usr/bin/ + mkdir -p usr/share/html + mv "$builddir"/build/doc/dev-reference/html usr/share/html/"$pkgname" +} + +tools() { + amove usr/bin/hsdump usr/bin/hscheck usr/bin/hsbench +} + +sha512sums="a4d85ffd2264e8e6745340ba51431361775a1e7a2da78edd31f6f53552ac61fdef718710ae53a254b7d5000f9ec1aafe7a48d9c55e76f5c6822486150bbc6c56 hyperscan-5.3.0.tar.gz" -- cgit v1.2.3