From 3a338a154b7fe4710427e82bdbf243a3304790e9 Mon Sep 17 00:00:00 2001 From: Caleb Xu Date: Wed, 10 Jul 2019 21:46:02 -0400 Subject: [PATCH] lsof 4.93.2 Closes #41840. Signed-off-by: Chongyu Zhu --- Formula/lsof.rb | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/Formula/lsof.rb b/Formula/lsof.rb index 590b9b0a05..1aa89732dc 100644 --- a/Formula/lsof.rb +++ b/Formula/lsof.rb @@ -1,8 +1,8 @@ class Lsof < Formula desc "Utility to list open files" homepage "https://people.freebsd.org/~abe/" - url "https://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_4.91.tar.bz2" - sha256 "c9da946a525fbf82ff80090b6d1879c38df090556f3fe0e6d782cb44172450a3" + url "https://github.com/lsof-org/lsof/archive/4.93.2.tar.gz" + sha256 "3df912bd966fc24dc73ddea3e36a61d79270b21b085936a4caabca56e5b486a2" bottle do cellar :any_skip_relocation @@ -12,28 +12,27 @@ class Lsof < Formula sha256 "59c8c1a9455e3f10c8d6326bab49ab33a85c3cfa702627aa4ba2dd9600cc7d72" => :el_capitan end + keg_only :provided_by_macos + def install - system "tar", "xf", "lsof_#{version}_src.tar" - cd "lsof_#{version}_src" do - inreplace "dialects/darwin/libproc/dfile.c", - "#extern\tstruct pff_tab\tPgf_tab[];", "extern\tstruct pff_tab\tPgf_tab[];" + ENV["LSOF_INCLUDE"] = "#{MacOS.sdk_path}/usr/include" + ENV["LSOF_CC"] = ENV.cc + ENV["LSOF_CCV"] = ENV.cxx - ENV["LSOF_INCLUDE"] = "#{MacOS.sdk_path}/usr/include" + # Source hardcodes full header paths at /usr/include + inreplace %w[ + dialects/darwin/kmem/dlsof.h + dialects/darwin/kmem/machine.h + dialects/darwin/libproc/machine.h + ], "/usr/include", "#{MacOS.sdk_path}/usr/include" - # Source hardcodes full header paths at /usr/include - inreplace %w[ - dialects/darwin/kmem/dlsof.h - dialects/darwin/kmem/machine.h - dialects/darwin/libproc/machine.h - ], "/usr/include", "#{MacOS.sdk_path}/usr/include" + mv "00README", "README" + system "./Configure", "-n", "darwin" - mv "00README", "README" - system "./Configure", "-n", "darwin" - system "make" - bin.install "lsof" - man8.install "lsof.8" - prefix.install_metafiles - end + system "make" + bin.install "lsof" + man8.install "lsof.8" + prefix.install_metafiles end test do