Skip to content

Instantly share code, notes, and snippets.

@vibrog
Created December 28, 2010 17:28
Show Gist options
  • Save vibrog/757437 to your computer and use it in GitHub Desktop.
Save vibrog/757437 to your computer and use it in GitHub Desktop.
Patch to Homebrew formula: Hunspell, include /Library/Spelling
diff --git a/hunspell.rb.1 b/hunspell.rb
index 34f696b..5481bcb 100644
--- a/hunspell.rb.1
+++ b/hunspell.rb
@@ -7,6 +7,14 @@ class Hunspell <Formula
depends_on 'readline'
+ def patches
+ # Change Hunspell's dictionary path to use dictionaries installed
+ # in /Library/Spelling or ~/Library/Spelling, which is used by OS X.
+ # See also this Hunspell feature request:
+ # http://sourceforge.net/tracker/?func=detail&aid=3142010&group_id=143754&atid=756398
+ DATA
+ end
+
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--with-ui", "--with-readline",
@@ -16,3 +24,22 @@ class Hunspell <Formula
system "make install"
end
end
+
+__END__
+diff --git a/src/tools/hunspell.cxx b/src/tools/hunspell.cxx
+index 827f75b..582a1f3 100644
+--- a/src/tools/hunspell.cxx
++++ b/src/tools/hunspell.cxx
+@@ -61,10 +61,12 @@
+ #include "firstparser.hxx"
+
+ #define LIBDIR \
++ "/Library/Spelling:" \
+ "/usr/share/hunspell:" \
+ "/usr/share/myspell:" \
+ "/usr/share/myspell/dicts"
+ #define USEROOODIR \
++ "Library/Spelling:" \
+ ".openoffice.org/3/user/wordbook:" \
+ ".openoffice.org2/user/wordbook:" \
+ ".openoffice.org2.0/user/wordbook"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment