10 inherit (stdenv.hostPlatform) isStatic;
12 src-cmake = fetchFromGitHub {
15 rev = "1be78cc8a889d95db047f473a0f48e0baee49f33";
16 hash = "sha256-zcXWP8CHx0RSDGpRTrYD99lHlqSbvaliXrtFowPfhBk=";
18 src-3rdparty = fetchFromGitHub {
20 repo = "zeek-3rdparty";
21 rev = "eb87829547270eab13c223e6de58b25bc9a0282e";
22 hash = "sha256-AVaKcRjF5ZiSR8aPSLBzSTeWVwGWW/aSyQJcN0Yhza0=";
24 caf' = caf.overrideAttrs (old: {
25 version = "unstable-2024-01-07-zeek";
26 src = fetchFromGitHub {
28 repo = "actor-framework";
29 rev = "e3048cdd13e085c97870a55eb1f9de04e25320f3";
30 hash = "sha256-uisoYXiZbFQa/TfWGRrCJ23MX4bg8Ds86ffC8sZSRNQ=";
32 cmakeFlags = old.cmakeFlags ++ [
33 "-DCAF_ENABLE_TESTING=OFF"
38 stdenv.mkDerivation rec {
39 pname = "zeek-broker";
41 outputs = [ "out" "py" ];
45 src = fetchFromGitHub {
49 hash = "sha256-SG5TzozKvYc7qcEPJgiEtsxgzdZbbJt90lmuUbCPyv0=";
52 rmdir $sourceRoot/cmake $sourceRoot/3rdparty
53 ln -s ${src-cmake} ''${sourceRoot}/cmake
54 ln -s ${src-3rdparty} ''${sourceRoot}/3rdparty
56 # Refuses to build the bindings unless this file is present, but never
58 touch $sourceRoot/bindings/python/3rdparty/pybind11/CMakeLists.txt
62 ./0001-Fix-include-path-in-exported-CMake-targets.patch
65 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
66 substituteInPlace bindings/python/CMakeLists.txt --replace " -u -r" ""
69 nativeBuildInputs = [ cmake python3 ];
70 buildInputs = [ openssl python3.pkgs.pybind11 ];
71 propagatedBuildInputs = [ caf' ];
75 "-DENABLE_STATIC_ONLY:BOOL=${if isStatic then "ON" else "OFF"}"
76 "-DPY_MOD_INSTALL_DIR=${placeholder "py"}/${python3.sitePackages}/"
79 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-faligned-allocation";
82 description = "Zeek's Messaging Library";
83 mainProgram = "broker-benchmark";
84 homepage = "https://github.com/zeek/broker";
85 license = licenses.bsd3;
86 platforms = platforms.unix;
87 maintainers = with maintainers; [ tobim ];