Unverified Commit 3b11e0c5 authored by Franz Pletz's avatar Franz Pletz
Browse files

vectorscan: reformat

parent fac85fd1
Loading
Loading
Loading
Loading
+50 −25
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, ragel
, util-linux
, python3
, boost
, sqlite
, pcre
, enableShared ? !stdenv.hostPlatform.isStatic
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  pkg-config,
  ragel,
  util-linux,
  python3,
  boost,
  sqlite,
  pcre,
  enableShared ? !stdenv.hostPlatform.isStatic,
}:

stdenv.mkDerivation rec {
@@ -55,13 +56,30 @@ stdenv.mkDerivation rec {
  #
  # For generic builds (e.g. x86_64) this can mean using an implementation not optimized for the
  # potentially available more modern hardware extensions (e.g. x86_64 with AVX512).
  cmakeFlags = [ (if enableShared then "-DBUILD_SHARED_LIBS=ON" else "BUILD_STATIC_LIBS=ON") ]
    ++
    (if lib.elem stdenv.hostPlatform.system [ "x86_64-linux" "i686-linux" ] then
      [ "-DBUILD_AVX2=ON" "-DBUILD_AVX512=ON" "-DBUILD_AVX512VBMI=ON" "-DFAT_RUNTIME=ON" ]
  cmakeFlags =
    [ (if enableShared then "-DBUILD_SHARED_LIBS=ON" else "BUILD_STATIC_LIBS=ON") ]
    ++ (
      if
        lib.elem stdenv.hostPlatform.system [
          "x86_64-linux"
          "i686-linux"
        ]
      then
        [
          "-DBUILD_AVX2=ON"
          "-DBUILD_AVX512=ON"
          "-DBUILD_AVX512VBMI=ON"
          "-DFAT_RUNTIME=ON"
        ]
      else
      (if (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) then
        [ "-DBUILD_SVE=ON" "-DBUILD_SVE2=ON" "-DBUILD_SVE2_BITPERM=ON" "-DFAT_RUNTIME=ON" ]
        (
          if (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) then
            [
              "-DBUILD_SVE=ON"
              "-DBUILD_SVE2=ON"
              "-DBUILD_SVE2_BITPERM=ON"
              "-DFAT_RUNTIME=ON"
            ]
          else
            [ "-DFAT_RUNTIME=OFF" ]
            ++ lib.optional stdenv.hostPlatform.avx2Support "-DBUILD_AVX2=ON"
@@ -95,7 +113,14 @@ stdenv.mkDerivation rec {
    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 ];
    license = with licenses; [
      bsd3 # and
      bsd2 # and
      licenses.boost
    ];
    maintainers = with maintainers; [
      tnias
      vlaci
    ];
  };
}