hyperscan: 5.1.0 -> 5.1.1 (#59500)
* hyperscan: 5.1.0 -> 5.1.1 * provide misc utils needed by build * hyperscan: build shared libs only by default Only consumer now (rspamd) needs only the shared libs + add a switch to build both shared and static if needed + cleaner outputs (previously there was static lib and symlink to shared lib in $dev) + fix pkgconfig template for v5.1.1 otherwise "includedir" path is wrong * hyperscan: restrict to x86_64-linux Fails to find 'nm' on x64 darwin
This commit is contained in:
parent
31df64d45a
commit
eb327edc2a
|
@ -1,5 +1,7 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, cmake, ragel, python27
|
{ stdenv, fetchFromGitHub, cmake, ragel, python3
|
||||||
|
, coreutils, gnused, utillinux
|
||||||
, boost
|
, boost
|
||||||
|
, withStatic ? false # build only shared libs by default, build static+shared if true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# NOTICE: pkgconfig, pcap and pcre intentionally omitted from build inputs
|
# NOTICE: pkgconfig, pcap and pcre intentionally omitted from build inputs
|
||||||
|
@ -8,45 +10,41 @@
|
||||||
# I not see any reason (for now) to backport 8.41.
|
# I not see any reason (for now) to backport 8.41.
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "${pname}-${version}";
|
|
||||||
pname = "hyperscan";
|
pname = "hyperscan";
|
||||||
version = "5.1.0";
|
version = "5.1.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "intel";
|
owner = "intel";
|
||||||
repo = "hyperscan";
|
repo = pname;
|
||||||
sha256 = "0r2c7s7alnq14yhbfhpkq6m28a3pyfqd427115k0754afxi82vbq";
|
sha256 = "11adkz5ln2d2jywwlmixfnwqp5wxskq1104hmmcpws590lhkjv6j";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
buildInputs = [ boost ];
|
buildInputs = [ boost ];
|
||||||
nativeBuildInputs = [ cmake ragel python27 ];
|
nativeBuildInputs = [
|
||||||
|
cmake ragel python3
|
||||||
|
# Consider simply using busybox for these
|
||||||
|
# Need at least: rev, sed, cut, nm
|
||||||
|
coreutils gnused utillinux
|
||||||
|
];
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DFAT_RUNTIME=ON"
|
"-DFAT_RUNTIME=ON"
|
||||||
"-DBUILD_AVX512=ON"
|
"-DBUILD_AVX512=ON"
|
||||||
"-DBUILD_STATIC_AND_SHARED=ON"
|
]
|
||||||
];
|
++ stdenv.lib.optional (withStatic) "-DBUILD_STATIC_AND_SHARED=ON"
|
||||||
|
++ stdenv.lib.optional (!withStatic) "-DBUILD_SHARED_LIBS=ON";
|
||||||
|
|
||||||
prePatch = ''
|
postPatch = ''
|
||||||
sed -i '/examples/d' CMakeLists.txt
|
sed -i '/examples/d' CMakeLists.txt
|
||||||
|
substituteInPlace libhs.pc.in \
|
||||||
|
--replace "libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@" "libdir=@CMAKE_INSTALL_LIBDIR@" \
|
||||||
|
--replace "includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@" "includedir=@CMAKE_INSTALL_INCLUDEDIR@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
meta = with stdenv.lib; {
|
||||||
mkdir -p $dev/lib
|
|
||||||
mv $out/lib/*.a $dev/lib/
|
|
||||||
ln -sf $out/lib/libhs.so $dev/lib/
|
|
||||||
ln -sf $out/lib/libhs_runtime.so $dev/lib/
|
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup = ''
|
|
||||||
sed -i "s,$out/include,$dev/include," $dev/lib/pkgconfig/libhs.pc
|
|
||||||
sed -i "s,$out/lib,$dev/lib," $dev/lib/pkgconfig/libhs.pc
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "High-performance multiple regex matching library";
|
description = "High-performance multiple regex matching library";
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
Hyperscan is a high-performance multiple regex matching library.
|
Hyperscan is a high-performance multiple regex matching library.
|
||||||
|
@ -61,9 +59,9 @@ stdenv.mkDerivation rec {
|
||||||
Hyperscan is typically used in a DPI library stack.
|
Hyperscan is typically used in a DPI library stack.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
homepage = https://www.hyperscan.io/;
|
homepage = "https://www.hyperscan.io/";
|
||||||
maintainers = with lib.maintainers; [ avnik ];
|
maintainers = with maintainers; [ avnik ];
|
||||||
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
platforms = [ "x86_64-linux" ]; # can't find nm on darwin ; might build on aarch64 but untested
|
||||||
license = lib.licenses.bsd3;
|
license = licenses.bsd3;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue