2011-03-10 05:11:03 +00:00
|
|
|
class Enchant < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Spellchecker wrapping library"
|
2015-01-06 19:45:50 +00:00
|
|
|
homepage "http://www.abisource.com/projects/enchant/"
|
|
|
|
url "http://www.abisource.com/downloads/enchant/1.6.0/enchant-1.6.0.tar.gz"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "2fac9e7be7e9424b2c5570d8affe568db39f7572c10ed48d4e13cddf03f7097f"
|
2009-12-28 00:11:47 +00:00
|
|
|
|
2015-01-07 16:32:15 +00:00
|
|
|
bottle do
|
2015-09-23 20:36:10 +00:00
|
|
|
sha256 "bbe368cbefd64aed845d98198d6f49fd533bc058b62290414865cca1ffdcc8cd" => :el_capitan
|
2015-01-07 16:32:15 +00:00
|
|
|
sha1 "12a7edc42b202159012238e0c0d3da0c1d43a74e" => :yosemite
|
|
|
|
sha1 "e6766b97a2db560403d6a1a26b3129a5c3057991" => :mavericks
|
|
|
|
sha1 "6dd74cd9a3c9f0ca1252820ada1f1e27fbf57c44" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2015-01-06 19:45:50 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2014-05-08 17:21:39 +00:00
|
|
|
depends_on :python => :optional
|
2015-01-06 19:45:50 +00:00
|
|
|
depends_on "glib"
|
|
|
|
depends_on "aspell"
|
2009-12-28 00:11:47 +00:00
|
|
|
|
2013-08-12 04:48:02 +00:00
|
|
|
# http://pythonhosted.org/pyenchant/
|
2015-01-06 19:45:50 +00:00
|
|
|
resource "pyenchant" do
|
|
|
|
url "https://pypi.python.org/packages/source/p/pyenchant/pyenchant-1.6.5.tar.gz"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "623f332a9fbb70ae6c9c2d0d4e7f7bae5922d36ba0fe34be8e32df32ebbb4f84"
|
2013-08-12 04:48:02 +00:00
|
|
|
end
|
|
|
|
|
2009-12-28 00:11:47 +00:00
|
|
|
def install
|
2012-08-18 02:37:33 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--disable-ispell",
|
|
|
|
"--disable-myspell"
|
2013-06-13 13:52:23 +00:00
|
|
|
system "make", "install"
|
2013-01-21 09:33:56 +00:00
|
|
|
|
2015-01-06 19:45:50 +00:00
|
|
|
if build.with? "python"
|
|
|
|
resource("pyenchant").stage do
|
2014-01-04 13:05:21 +00:00
|
|
|
# Don't download and install distribute now
|
2015-01-06 19:45:50 +00:00
|
|
|
inreplace "setup.py", "distribute_setup.use_setuptools()", ""
|
|
|
|
ENV["PYENCHANT_LIBRARY_PATH"] = lib/"libenchant.dylib"
|
|
|
|
system "python", "setup.py", "install", "--prefix=#{prefix}",
|
|
|
|
"--single-version-externally-managed",
|
|
|
|
"--record=installed.txt"
|
2013-01-21 09:33:56 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2015-01-06 19:45:50 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
text = "Teh quikc brwon fox iumpz ovr teh lAzy d0g"
|
|
|
|
enchant_result = text.sub("fox ", "").split.join("\n")
|
|
|
|
file = "test.txt"
|
|
|
|
(testpath/file).write text
|
|
|
|
assert_equal enchant_result, shell_output("#{bin}/enchant -l #{file}").chomp
|
|
|
|
end
|
2009-12-28 00:11:47 +00:00
|
|
|
end
|