-
-
Save hakanai/084ca6db29ef0de34a2bfa763b3559f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ru mecab-naist-jdic-0.6.3-20100801.orig/Makefile.am mecab-naist-jdic-0.6.3-20100801/Makefile.am | |
--- mecab-naist-jdic-0.6.3-20100801.orig/Makefile.am 2010-07-31 15:28:40.000000000 +1000 | |
+++ mecab-naist-jdic-0.6.3-20100801/Makefile.am 2017-04-01 22:15:44.000000000 +1100 | |
@@ -15,11 +15,3 @@ | |
export-package: | |
./upload.pl -p mecab -n @PACKAGE@ -r @VERSION@ -f @PACKAGE@-@VERSION@.tar.gz | |
- | |
-install-exec-hook: | |
- if ! [ -d $(DESTDIR)/etc/mecab/dic/naist-jdic ]; \ | |
- then mkdir -p $(DESTDIR)/etc/mecab/dic/naist-jdic; \ | |
- fi | |
- if ! [ -f $(DESTDIR)/etc/mecab/dic/naist-jdic/dicrc ]; \ | |
- then $(LN_S) @MECAB_DICDIR@/dicrc $(DESTDIR)/etc/mecab/dic/naist-jdic/dicrc; \ | |
- fi | |
diff -ru mecab-naist-jdic-0.6.3-20100801.orig/Makefile.in mecab-naist-jdic-0.6.3-20100801/Makefile.in | |
--- mecab-naist-jdic-0.6.3-20100801.orig/Makefile.in 2010-08-01 14:54:33.000000000 +1000 | |
+++ mecab-naist-jdic-0.6.3-20100801/Makefile.in 2017-04-01 22:22:16.000000000 +1100 | |
@@ -459,13 +459,6 @@ | |
export-package: | |
./upload.pl -p mecab -n @PACKAGE@ -r @VERSION@ -f @PACKAGE@-@VERSION@.tar.gz | |
-install-exec-hook: | |
- if ! [ -d $(DESTDIR)/etc/mecab/dic/naist-jdic ]; \ | |
- then mkdir -p $(DESTDIR)/etc/mecab/dic/naist-jdic; \ | |
- fi | |
- if ! [ -f $(DESTDIR)/etc/mecab/dic/naist-jdic/dicrc ]; \ | |
- then $(LN_S) @MECAB_DICDIR@/dicrc $(DESTDIR)/etc/mecab/dic/naist-jdic/dicrc; \ | |
- fi | |
# Tell versions [3.59,3.63) of GNU make to not export all variables. | |
# Otherwise a system limit (for SysV at least) may be exceeded. | |
.NOEXPORT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MecabNaistJdic < Formula | |
desc 'NAIST Japanese dictionary compiled for MeCab' | |
homepage 'http://sourceforge.jp/projects/naist-jdic/' | |
url 'http://sourceforge.jp/frs/redir.php?m=iij&f=%2Fnaist-jdic%2F48487%2Fmecab-naist-jdic-0.6.3-20100801.tar.gz' | |
version '0.6.3-20100801' | |
sha256 'a8e04a8717992887f8ba19fc9edf1e24b9e465c8635eb72c85140762c73bb23e' | |
# Via ./configure --help, valid choices are utf8 (default), euc-jp, sjis | |
option "with-charset=", "Select charset: utf8 (default), euc-jp, or sjis" | |
depends_on 'automake' | |
depends_on 'mecab' | |
link_overwrite 'lib/mecab/dic' | |
# Patch out shenanigans where the build tries to write outside the sandbox. TODO upload somewhere | |
patch :p1 do | |
url 'https://gist.githubusercontent.com/trejkaz/084ca6db29ef0de34a2bfa763b3559f3/raw/019f499c3e62a59cea614871793ba1e8fabe03bd/disable-faulty-hook.patch' | |
sha256 'd94d07b1b4ae1ac1030eb8419278d0010b921ed24f5ab5d270c1dd4e9b41cc41' | |
end | |
def install | |
charset = ARGV.value("with-charset") || "utf8" | |
args = %W[ | |
--disable-debug | |
--disable-dependency-tracking | |
--prefix=#{prefix} | |
--with-charset=#{charset} | |
--with-dicdir=#{lib}/mecab/dic/naist-jdic | |
] | |
system './configure', *args | |
system 'make', 'install' | |
end | |
def caveats; <<-EOS.undent | |
To enable mecab-naist-jdic dictionary, add to #{HOMEBREW_PREFIX}/etc/mecabrc: | |
dicdir = #{HOMEBREW_PREFIX}/lib/mecab/dic/naist-jdic | |
EOS | |
end | |
test do | |
(testpath/"mecabrc").write <<-EOS.undent | |
dicdir = #{HOMEBREW_PREFIX}/lib/mecab/dic/naist-jdic | |
EOS | |
pipe_output("mecab --rcfile=#{testpath}/mecabrc", "すもももももももものうち\n", 0) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment