about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/vectorscan/default.nix
blob: 12fa0735b27f16240800331bf1ea3d6861270d21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ lib
, stdenv
, fetchFromGitHub
, cmake
, ragel
, util-linux
, python3
, boost
, enableShared ? !stdenv.hostPlatform.isStatic
}:

stdenv.mkDerivation rec {
  pname = "vectorscan";
  version = "5.4.10.1";

  src = fetchFromGitHub {
    owner = "VectorCamp";
    repo = "vectorscan";
    rev = "vectorscan/${version}";
    hash = "sha256-x6FefOrUvpN/A4GXTd+3SGZEAQL6pXt83ufxRIY3Q9k=";
  };

  nativeBuildInputs = [
    cmake
    ragel
    python3
  ] ++ lib.optional stdenv.isLinux util-linux;

  buildInputs = [
    boost
  ];

  cmakeFlags = lib.optional enableShared "-DBUILD_STATIC_AND_SHARED=ON"
    ++ [ "-DFAT_RUNTIME=${if stdenv.hostPlatform.isLinux then "ON" else "OFF"}" ]
    ++ lib.optional stdenv.hostPlatform.avx2Support "-DBUILD_AVX2=ON"
    ++ lib.optional stdenv.hostPlatform.avx512Support "-DBUILD_AVX512=ON"
  ;

  meta = with lib; {
    description = "A portable fork of the high-performance regular expression matching library";
    longDescription = ''
      A fork of Intel's Hyperscan, modified to run on more platforms. Currently
      ARM NEON/ASIMD is 100% functional, and Power VSX are in development.
      ARM SVE2 will be implemented when hardware becomes accessible to the
      developers. More platforms will follow in the future, on demand/request.

      Vectorscan will follow Intel's API and internal algorithms where possible,
      but will not hesitate to make code changes where it is thought of giving
      better performance or better portability. In addition, the code will be
      gradually simplified and made more uniform and all architecture specific
      code will be abstracted away.
    '';
    homepage = "https://www.vectorcamp.gr/vectorscan/";
    changelog = "https://github.com/VectorCamp/vectorscan/blob/${src.rev}/CHANGELOG-vectorscan.md";
    platforms = platforms.unix;
    license = with licenses; [ bsd3 /* and */ bsd2 /* and */ licenses.boost ];
    maintainers = with maintainers; [ tnias vlaci ];
  };
}