Skip to content

Commit

Permalink
sysdig: revision bump (grpc 1.40.0)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: BrewTestBot <[email protected]>
  • Loading branch information
carlocab authored and BrewTestBot committed Oct 18, 2021
1 parent faa2ad6 commit 5c4eb24
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions Formula/sysdig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,18 +22,24 @@ class Sysdig < Formula
depends_on "c-ares"
depends_on "jsoncpp"
depends_on "luajit"
depends_on "[email protected]"
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"
Expand All @@ -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

Expand Down

0 comments on commit 5c4eb24

Please sign in to comment.