2014-06-17 06:49:06 +00:00
|
|
|
require "formula"
|
2009-12-08 10:18:57 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Hunspell < Formula
|
2014-06-17 06:49:06 +00:00
|
|
|
homepage "http://hunspell.sourceforge.net/"
|
|
|
|
url "https://downloads.sourceforge.net/hunspell/hunspell-1.3.3.tar.gz"
|
|
|
|
sha1 "219b20f305d6690f666ff3864a16e4674908a553"
|
2009-12-08 10:18:57 +00:00
|
|
|
|
2014-06-17 06:49:06 +00:00
|
|
|
depends_on "readline"
|
2011-02-27 20:42:51 +00:00
|
|
|
|
2014-03-19 17:07:52 +00:00
|
|
|
# hunspell does not prepend $HOME to all USEROODIRs
|
|
|
|
# http://sourceforge.net/p/hunspell/bugs/236/
|
|
|
|
patch :p0, :DATA
|
2013-10-04 12:19:21 +00:00
|
|
|
|
2009-12-08 10:18:57 +00:00
|
|
|
def install
|
2011-08-14 01:53:03 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
2013-01-28 04:50:01 +00:00
|
|
|
"--with-ui",
|
|
|
|
"--with-readline"
|
2010-12-28 14:10:49 +00:00
|
|
|
system "make"
|
|
|
|
ENV.deparallelize
|
2009-12-08 10:18:57 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2014-02-22 03:39:32 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
Dictionary files (*.aff and *.dic) should be placed in
|
|
|
|
~/Library/Spelling/ or /Library/Spelling/. Homebrew itself
|
|
|
|
provides no dictionaries for Hunspell, but you can download
|
|
|
|
compatible dictionaries from other sources, such as
|
|
|
|
https://wiki.openoffice.org/wiki/Dictionaries .
|
|
|
|
EOS
|
|
|
|
end
|
2009-12-08 10:18:57 +00:00
|
|
|
end
|
2013-10-04 12:19:21 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
--- src/tools/hunspell.cxx.old 2013-08-02 18:21:49.000000000 +0200
|
|
|
|
+++ src/tools/hunspell.cxx 2013-08-02 18:20:27.000000000 +0200
|
|
|
|
@@ -28,7 +28,7 @@
|
|
|
|
#ifdef WIN32
|
|
|
|
|
|
|
|
#define LIBDIR "C:\\Hunspell\\"
|
|
|
|
-#define USEROOODIR "Application Data\\OpenOffice.org 2\\user\\wordbook"
|
|
|
|
+#define USEROOODIR { "Application Data\\OpenOffice.org 2\\user\\wordbook" }
|
|
|
|
#define OOODIR \
|
|
|
|
"C:\\Program files\\OpenOffice.org 2.4\\share\\dict\\ooo\\;" \
|
|
|
|
"C:\\Program files\\OpenOffice.org 2.3\\share\\dict\\ooo\\;" \
|
|
|
|
@@ -65,11 +65,11 @@
|
|
|
|
"/usr/share/myspell:" \
|
|
|
|
"/usr/share/myspell/dicts:" \
|
|
|
|
"/Library/Spelling"
|
|
|
|
-#define USEROOODIR \
|
|
|
|
- ".openoffice.org/3/user/wordbook:" \
|
|
|
|
- ".openoffice.org2/user/wordbook:" \
|
|
|
|
- ".openoffice.org2.0/user/wordbook:" \
|
|
|
|
- "Library/Spelling"
|
|
|
|
+#define USEROOODIR { \
|
|
|
|
+ ".openoffice.org/3/user/wordbook:", \
|
|
|
|
+ ".openoffice.org2/user/wordbook:", \
|
|
|
|
+ ".openoffice.org2.0/user/wordbook:", \
|
|
|
|
+ "Library/Spelling" }
|
|
|
|
#define OOODIR \
|
|
|
|
"/opt/openoffice.org/basis3.0/share/dict/ooo:" \
|
|
|
|
"/usr/lib/openoffice.org/basis3.0/share/dict/ooo:" \
|
|
|
|
@@ -1664,7 +1664,10 @@
|
|
|
|
path = add(path, PATHSEP); // <- check path in root directory
|
|
|
|
if (getenv("DICPATH")) path = add(add(path, getenv("DICPATH")), PATHSEP);
|
|
|
|
path = add(add(path, LIBDIR), PATHSEP);
|
|
|
|
- if (HOME) path = add(add(add(add(path, HOME), DIRSEP), USEROOODIR), PATHSEP);
|
|
|
|
+ const char* userooodir[] = USEROOODIR;
|
|
|
|
+ for (int i = 0; i < (sizeof(userooodir) / sizeof(userooodir[0])); i++) {
|
|
|
|
+ if (HOME) path = add(add(add(add(path, HOME), DIRSEP), userooodir[i]), PATHSEP);
|
|
|
|
+ }
|
|
|
|
path = add(path, OOODIR);
|
|
|
|
|
|
|
|
if (showpath) {
|