forked from keitheis/homebrew-dupes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibedit.rb
39 lines (34 loc) · 1.26 KB
/
libedit.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class Libedit < Formula
desc "BSD-style licensed readline alternative"
homepage "http://thrysoee.dk/editline/"
url "http://thrysoee.dk/editline/libedit-20160903-3.1.tar.gz"
version "20160903-3.1"
sha256 "0ccbd2e7d46097f136fcb1aaa0d5bc24e23bb73f57d25bee5a852a683eaa7567"
bottle do
cellar :any
sha256 "aa5bebaa567a011aec09ae73ebac1a41c10b1281bcbda8db6b34856c0ad72fa5" => :sierra
sha256 "c59f6ef3c9fa7a3936dbd26c8d46c2d99120b320f59716cfa89c8dbd9bf7db66" => :el_capitan
sha256 "5fb64cf9e71fe11c38bb6f1c69c3254a93bfa78300601904193e8f746809cbfb" => :yosemite
end
keg_only :provided_by_osx
depends_on "homebrew/dupes/ncurses" unless OS.mac?
def install
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--enable-widec",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <stdio.h>
#include <histedit.h>
int main(int argc, char *argv[]) {
EditLine *el = el_init(argv[0], stdin, stdout, stderr);
return (el == NULL);
}
EOS
system ENV.cc, "test.c", "-o", "test", "-L#{lib}", "-ledit", "-I#{include}"
system "./test"
end
end