From eb083bfd3fc95c452d0f963422554b02a039004c Mon Sep 17 00:00:00 2001 From: Alex Zinchenko Date: Sun, 7 Jun 2015 18:31:00 +0300 Subject: [PATCH] dex 1.0 (new formula) dex is a small and easy to use text editor Closes Homebrew/homebrew#40477. Signed-off-by: Mike McQuaid --- Formula/dex.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Formula/dex.rb diff --git a/Formula/dex.rb b/Formula/dex.rb new file mode 100644 index 0000000000..f8846ff6a1 --- /dev/null +++ b/Formula/dex.rb @@ -0,0 +1,27 @@ +class Dex < Formula + desc "Dextrous text editor" + homepage "https://github.com/tihirvon/dex" + url "https://github.com/tihirvon/dex/archive/v1.0.tar.gz" + sha256 "4468b53debe8da6391186dccb78288a8a77798cb4c0a00fab9a7cdc711cd2123" + + head "https://github.com/tihirvon/dex.git" + + depends_on "homebrew/dupes/ncurses" => :optional + depends_on "homebrew/dupes/libiconv" => :optional + + def install + args = ["prefix=#{prefix}", + "CC=#{ENV.cc}", + "HOST_CC=#{ENV.cc}"] + + args << "VERSION=#{version}" if build.head? + + inreplace "Makefile", /-lcurses/, "-lncurses" if build.with? "ncurses" + + system "make", "install", *args + end + + test do + system bin/"dex", "-V" + end +end