Skip to content

Instantly share code, notes, and snippets.

@bmorton
Last active February 14, 2016 20:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmorton/231bc3d6b3aa6fbefd48 to your computer and use it in GitHub Desktop.
Save bmorton/231bc3d6b3aa6fbefd48 to your computer and use it in GitHub Desktop.
class HtopOsx < Formula
desc "Improved top (interactive process viewer) for OS X"
homepage "http://hisham.hm/htop/"
url "http://hisham.hm/htop/releases/2.0.0/htop-2.0.0.tar.gz"
sha256 "d15ca2a0abd6d91d6d17fd685043929cfe7aa91199a9f4b3ebbb370a2c2424b5"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
def install
# Otherwise htop will segfault when resizing the terminal
ENV.no_optimization if ENV.compiler == :clang
system "./configure", "--prefix=#{prefix}"
system "make"
system "make", "install", "DEFAULT_INCLUDES='-iquote .'"
end
def caveats; <<-EOS.undent
htop-osx requires root privileges to correctly display all running processes.
so you will need to run `sudo htop`.
You should be certain that you trust any software you grant root privileges.
EOS
end
test do
ENV["TERM"] = "xterm"
pipe_output("#{bin}/htop", "q")
assert $?.success?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment