Unverified Commit 701b8c92 authored by Tobias Mayer's avatar Tobias Mayer
Browse files

zeek: 6.2.1 -> 7.2.1

parent ee4bf900
Loading
Loading
Loading
Loading
+0 −75
Original line number Diff line number Diff line
From 889ee4dd9e778511e2fb850e6467f55a331cded9 Mon Sep 17 00:00:00 2001
From: Tobias Mayer <tobim@fastmail.fm>
Date: Sun, 13 Nov 2022 19:06:00 +0100
Subject: [PATCH] Fix include path in exported CMake targets

---
 CMakeLists.txt | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e22b77aa..77a15314 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -209,7 +209,6 @@ if (CAF_ROOT)
   else()
     find_package(CAF REQUIRED COMPONENTS openssl test io core net)
   endif()
-  list(APPEND LINK_LIBS CAF::core CAF::io CAF::net)
   set(BROKER_USE_EXTERNAL_CAF ON)
 else ()
   message(STATUS "Using bundled CAF")
@@ -243,22 +242,18 @@ endif ()
 
 # Make sure there are no old header versions on disk.
 install(
-  CODE "MESSAGE(STATUS \"Removing: ${CMAKE_INSTALL_PREFIX}/include/broker\")"
-  CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}/include/broker\")")
+  CODE "MESSAGE(STATUS \"Removing: ${CMAKE_FULL_INSTALL_INCLUDEDIR}/broker\")"
+  CODE "file(REMOVE_RECURSE \"${CMAKE_FULL_INSTALL_INCLUDEDIR}/broker\")")
 
 # Install all headers except the files from broker/internal.
 install(DIRECTORY include/broker
-        DESTINATION include
+        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
         FILES_MATCHING PATTERN "*.hh"
                        PATTERN "include/broker/internal" EXCLUDE)
 
-include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
-
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.hh.in
                ${CMAKE_CURRENT_BINARY_DIR}/include/broker/config.hh)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/broker/config.hh DESTINATION include/broker)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/broker/config.hh DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/broker")
 
 if (NOT BROKER_EXTERNAL_SQLITE_TARGET)
   include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty)
@@ -360,6 +355,11 @@ if (ENABLE_SHARED)
                         OUTPUT_NAME broker)
   target_link_libraries(broker PUBLIC ${LINK_LIBS})
   target_link_libraries(broker PRIVATE CAF::core CAF::io CAF::net)
+  target_include_directories(
+    broker PUBLIC
+      $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
+      $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+      $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
   install(TARGETS broker
           EXPORT BrokerTargets
           DESTINATION ${CMAKE_INSTALL_LIBDIR})
@@ -373,6 +373,11 @@ if (ENABLE_STATIC)
   endif()
   target_link_libraries(broker_static PUBLIC ${LINK_LIBS})
   target_link_libraries(broker_static PRIVATE CAF::core CAF::io CAF::net)
+  target_include_directories(
+    broker_static PUBLIC
+      $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
+      $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+      $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
   install(TARGETS broker_static
           EXPORT BrokerTargets
           DESTINATION ${CMAKE_INSTALL_LIBDIR})
-- 
2.38.1
+15 −18
Original line number Diff line number Diff line
@@ -3,32 +3,31 @@
  lib,
  fetchFromGitHub,
  cmake,
  prometheus-cpp,
  python3,
  caf,
  openssl,
}:
let
  inherit (stdenv.hostPlatform) isStatic;

  src-cmake = fetchFromGitHub {
    owner = "zeek";
    repo = "cmake";
    rev = "1be78cc8a889d95db047f473a0f48e0baee49f33";
    hash = "sha256-zcXWP8CHx0RSDGpRTrYD99lHlqSbvaliXrtFowPfhBk=";
    rev = "fd0696f9077933660f7da5f81978e86b3e967647";
    hash = "sha256-21wZVwoOB05l/WX/VrVbSx+lFKFQ9MHWjQQD4weavFs=";
  };
  src-3rdparty = fetchFromGitHub {
    owner = "zeek";
    repo = "zeek-3rdparty";
    rev = "eb87829547270eab13c223e6de58b25bc9a0282e";
    hash = "sha256-AVaKcRjF5ZiSR8aPSLBzSTeWVwGWW/aSyQJcN0Yhza0=";
    rev = "a6cc3c7603bb535cf3bec7442140e7126e0577a8";
    hash = "sha256-yzhuTam9zOQ3MP7fk+ACN5P5tHtHXWbyQP73DwISIv8=";
  };
  caf' = caf.overrideAttrs (old: {
    version = "unstable-2024-01-07-zeek";
    version = "unstable-2024-09-14-zeek";
    src = fetchFromGitHub {
      owner = "zeek";
      repo = "actor-framework";
      rev = "e3048cdd13e085c97870a55eb1f9de04e25320f3";
      hash = "sha256-uisoYXiZbFQa/TfWGRrCJ23MX4bg8Ds86ffC8sZSRNQ=";
      rev = "10afbbc5ee40263b258b7cf3f0e5abb436f79e89";
      hash = "sha256-R22eKAFNP2VVA4eL6ycN6aHM0NgDHVll9aFNmOQ/pDc=";
    };
    cmakeFlags = old.cmakeFlags ++ [
      "-DCAF_ENABLE_TESTING=OFF"
@@ -36,9 +35,9 @@ let
    doCheck = false;
  });
in
stdenv.mkDerivation rec {
stdenv.mkDerivation {
  pname = "zeek-broker";
  version = "6.2.0";
  version = "2.6.0-unstable-2025-04-23";
  outputs = [
    "out"
    "py"
@@ -49,8 +48,8 @@ stdenv.mkDerivation rec {
  src = fetchFromGitHub {
    owner = "zeek";
    repo = "broker";
    rev = "v${version}";
    hash = "sha256-SG5TzozKvYc7qcEPJgiEtsxgzdZbbJt90lmuUbCPyv0=";
    rev = "5b6cbb8c2d9124aa1fb0bea5799433138dc64cf9";
    hash = "sha256-L6Z+ltX3tJEwZ05zEftrJlOhwbhs06MY9cEJDM2kcck=";
  };
  postUnpack = ''
    rmdir $sourceRoot/cmake $sourceRoot/3rdparty
@@ -62,10 +61,6 @@ stdenv.mkDerivation rec {
    touch $sourceRoot/bindings/python/3rdparty/pybind11/CMakeLists.txt
  '';

  patches = [
    ./0001-Fix-include-path-in-exported-CMake-targets.patch
  ];

  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
    substituteInPlace bindings/python/CMakeLists.txt --replace " -u -r" ""
  '';
@@ -76,14 +71,16 @@ stdenv.mkDerivation rec {
  ];
  buildInputs = [
    openssl
    prometheus-cpp
    python3.pkgs.pybind11
  ];
  propagatedBuildInputs = [ caf' ];

  cmakeFlags = [
    "-DCAF_ROOT=${caf'}"
    "-DENABLE_STATIC_ONLY:BOOL=${if isStatic then "ON" else "OFF"}"
    "-DENABLE_STATIC_ONLY:BOOL=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}"
    "-DPY_MOD_INSTALL_DIR=${placeholder "py"}/${python3.sitePackages}/"
    "-Dprometheus-cpp_ROOT=${lib.getDev prometheus-cpp}"
  ];

  meta = with lib; {
+5 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ diff --git a/auxil/zeekctl/CMakeLists.txt b/auxil/zeekctl/CMakeLists.txt
index 1ebe7c2..1435509 100644
--- a/auxil/zeekctl/CMakeLists.txt
+++ b/auxil/zeekctl/CMakeLists.txt
@@ -9,7 +9,7 @@ file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" VERSION LIMIT_COUNT 1)
@@ -9,7 +9,7 @@
 set(PREFIX "${CMAKE_INSTALL_PREFIX}")
 set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
 set(ZEEKSCRIPTDIR "${ZEEK_SCRIPT_INSTALL_PATH}")
@@ -37,7 +37,7 @@ index 1ebe7c2..1435509 100644
 
 ########################################################################
 ## Dependency Configuration
@@ -186,38 +186,9 @@ else ()
@@ -186,41 +186,9 @@
     set(LOGS ${VAR}/logs)
 endif ()
 
@@ -56,6 +56,8 @@ index 1ebe7c2..1435509 100644
-            DIRECTORY_PERMISSIONS ${perms})
-    install(DIRECTORY DESTINATION ${SPOOL}/brokerstore
-            DIRECTORY_PERMISSIONS ${perms})
-    install(DIRECTORY DESTINATION ${SPOOL}/extract_files
-            DIRECTORY_PERMISSIONS ${perms})
-    install(DIRECTORY DESTINATION ${LOGS}
-            DIRECTORY_PERMISSIONS ${perms})
-    set(EMPTY_WORLD_DIRS
@@ -65,6 +67,7 @@ index 1ebe7c2..1435509 100644
-    install(DIRECTORY DESTINATION ${SPOOL})
-    install(DIRECTORY DESTINATION ${SPOOL}/tmp)
-    install(DIRECTORY DESTINATION ${SPOOL}/brokerstore)
-    install(DIRECTORY DESTINATION ${SPOOL}/extract_files)
-    install(DIRECTORY DESTINATION ${LOGS})
-endif ()
-
+7 −6
Original line number Diff line number Diff line
@@ -28,13 +28,13 @@ let
    p.semantic-version
  ]);
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "zeek";
  version = "6.2.1";
  version = "7.2.1";

  src = fetchurl {
    url = "https://download.zeek.org/zeek-${version}.tar.gz";
    hash = "sha256-ZOOlK9mfZVrfxvgFREgqcRcSs18EMpADD8Y4Ev391Bw=";
    url = "https://download.zeek.org/zeek-${finalAttrs.version}.tar.gz";
    hash = "sha256-nbq25TGq/HubTfAysxuVHU34xp3AkJp8yBHB20FlUC0=";
  };

  strictDeps = true;
@@ -110,12 +110,13 @@ stdenv.mkDerivation rec {
  meta = {
    description = "Network analysis framework much different from a typical IDS";
    homepage = "https://www.zeek.org";
    changelog = "https://github.com/zeek/zeek/blob/v${version}/CHANGES";
    changelog = "https://github.com/zeek/zeek/blob/v${finalAttrs.version}/CHANGES";
    license = lib.licenses.bsd3;
    mainProgram = "zeek";
    maintainers = with lib.maintainers; [
      pSub
      tobim
    ];
    platforms = lib.platforms.unix;
  };
}
})