From 5c4eb24ed0d75b59f905ad6a31ce1478575f75ca Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Sat, 11 Sep 2021 15:00:05 +0800 Subject: [PATCH] sysdig: revision bump (grpc 1.40.0) Also, deparallelise the build on Linux and make dependencies explicit, and compile using C++17 in order to use `abseil`. Closes #84990. Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/sysdig.rb | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/Formula/sysdig.rb b/Formula/sysdig.rb index 8fcaa2bdf8c2..4150f16d94bd 100644 --- a/Formula/sysdig.rb +++ b/Formula/sysdig.rb @@ -4,7 +4,7 @@ class Sysdig < Formula url "https://github.com/draios/sysdig/archive/0.27.1.tar.gz" sha256 "b9d05854493d245a7a7e75f77fc654508f720aab5e5e8a3a932bd8eb54e49bda" license "Apache-2.0" - revision 2 + revision 3 livecheck do url :stable @@ -22,18 +22,24 @@ class Sysdig < Formula depends_on "c-ares" depends_on "jsoncpp" depends_on "luajit" + depends_on "openssl@1.1" depends_on "tbb" uses_from_macos "curl" + uses_from_macos "ncurses" + uses_from_macos "zlib" on_linux do depends_on "elfutils" + depends_on "gcc" depends_on "grpc" depends_on "jq" depends_on "libb64" depends_on "protobuf" end + fails_with gcc: "5" # C++17 + # More info on https://gist.github.com/juniorz/9986999 resource "sample_file" do url "https://gist.githubusercontent.com/juniorz/9986999/raw/a3556d7e93fa890a157a33f4233efaf8f5e01a6f/sample.scap" @@ -45,15 +51,35 @@ def install -DSYSDIG_VERSION=#{version} -DUSE_BUNDLED_DEPS=OFF -DCREATE_TEST_TARGETS=OFF + -DDIR_ETC=#{etc} ] - args << "-DBUILD_DRIVER=OFF" if OS.linux? - mkdir "build" do - system "cmake", "..", *args - system "make" - system "make", "install" + # `USE_BUNDLED_*=OFF` flags are implied by `USE_BUNDLED_DEPS=OFF`, but let's be explicit. + %w[LUAJIT JSONCPP ZLIB TBB JQ NCURSES B64 OPENSSL CURL CARES PROTOBUF GRPC].each do |dep| + args << "-DUSE_BUNDLED_#{dep}=OFF" end + if OS.linux? + # Workaround for: + # error adding symbols: DSO missing from command line + abseil_libdir = Formula["abseil"].opt_lib + ENV.append "LDFLAGS", "-L#{abseil_libdir} -Wl,-rpath,#{abseil_libdir}" + + # We need to compile with C++17 to use abseil. + args += %w[ + -DBUILD_DRIVER=OFF + -DCMAKE_CXX_STANDARD=17 + ] + end + + # From upstream build instructions: + # "Note: Sysdig's build can get confused with GNU make's parallel job option (-j)." + # https://github.com/draios/sysdig/wiki/How-to-Install-Sysdig-from-the-Source-Code#linux-and-osx + ENV.deparallelize if OS.linux? + system "cmake", "-S", ".", "-B", "build", *args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + (pkgshare/"demos").install resource("sample_file").files("sample.scap") end