aboutsummaryrefslogblamecommitdiffstats
path: root/community/vectorscan/APKBUILD
blob: 618613788fddb91940442424a407fd35a6be2aa5 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                   
                  
            
        

                                                              
                                                  
                      
                                                                           
                                                      

                                                                                                            
                                            




                                                

                                                  







                                                                                          


















                                                                              
                                             



                                                       

                                                                             
                                                           
 
 
         
                                                                

 



                                                                                                                                                         
# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=vectorscan
pkgver=5.4.2
pkgrel=3
pkgdesc="High-performance regular expression matching library"
url="https://www.hyperscan.io"
arch="x86 x86_64 aarch64"  #requires SSSE3 or Neon
license="BSD-3-Clause"
makedepends="cmake ragel boost-dev pcre-dev sqlite-dev py3-breathe chrpath"
subpackages="$pkgname-doc $pkgname-dev $pkgname-utils"
source="$pkgname-$pkgver.tar.gz::https://github.com/vectorcamp/vectorscan/archive/v$pkgver+vectorscan.tar.gz
	static.patch"
builddir="$srcdir/$pkgname-$pkgver-$pkgname"
build() {
	local _march="-march=native"
	case "${CARCH:-native}" in
		x86|x86_64)
			_march="-march=core2" ;;
		aarch64)
			_march="-march=armv8-a" ;;
	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 \
		-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
	for _f in hsbench hscheck hscollider;
	do
		mv "$builddir"/build/bin/"$_f" usr/bin/
		chrpath -d usr/bin/"$_f"
	done
	mkdir -p usr/share/html
	mv "$builddir"/build/doc/dev-reference/html usr/share/html/"$pkgname"
	mv usr/share/doc/hyperscan usr/share/doc/"$pkgname"
}

utils() {
	amove usr/bin/hsbench usr/bin/hscheck usr/bin/hscollider
}

sha512sums="
fcabf7d1459780c3df36504308b7d0669735c9336c72553dec2c02dbdb75bbccfd316492731e8216f0b6561ce64ea5964c817b4bd2d3debe6f676b7098bcb4da  vectorscan-5.4.2.tar.gz
f0cb6ccb52f561659042334e3bc9713633f7fbc7dbcb58d6e82e221290a98e09c99579b036c1f6c645b9855217d350d64e953ec949514a08b460fd19ddff29a4  static.patch
"