Unverified Commit e889770f authored by Brian McGillion's avatar Brian McGillion
Browse files

libdaq: init at 3.0.18



used in the snort3+ package.

Signed-off-by: default avatarBrian McGillion <bmg.avoin@gmail.com>
parent 64e75cd4
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  autoreconfHook,
  pkg-config,
  libpcap,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "libdaq";
  version = "3.0.18";

  src = fetchFromGitHub {
    owner = "snort3";
    repo = "libdaq";
    tag = "v${finalAttrs.version}";
    hash = "sha256-PMb8q8QcfUXxEf0s2UdaZogmxzqUCw0wRdzfT1xio/E=";
  };

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
  ];

  buildInputs = [
    libpcap
    stdenv.cc.cc # libstdc++
  ];

  outputs = [
    "lib"
    "dev"
    "out"
  ];

  autoreconfPhase = ''
    ./bootstrap
  '';

  postInstall = ''
    # remove build directory (/build/**, or /tmp/nix-build-**) from RPATHs
    for f in "$out"/bin/*; do
      local nrp="$(patchelf --print-rpath "$f" | sed -E 's@(:|^)'$NIX_BUILD_TOP'[^:]*:@\1@g')"
      patchelf --set-rpath "$nrp" "$f"
    done
  '';

  meta = {
    description = "Data AcQuisition library (libDAQ), for snort packet I/O";
    homepage = "https://www.snort.org";
    maintainers = with lib.maintainers; [
      aycanirican
      brianmcgillion
    ];
    license = lib.licenses.gpl2;
    outputsToInstall = [
      "lib"
      "dev"
    ];
    platforms = with lib.platforms; linux;
  };
})