Skip to content

Instantly share code, notes, and snippets.

@yewton
Created July 14, 2012 19:52
Show Gist options
  • Save yewton/3113048 to your computer and use it in GitHub Desktop.
Save yewton/3113048 to your computer and use it in GitHub Desktop.
Formula for cmigemo
# -*- coding: utf-8 -*-
require 'formula'
class Cmigemo < Formula
url 'http://cmigemo.googlecode.com/files/cmigemo-default-src-20110227.zip'
homepage 'http://www.kaoriya.net/software/cmigemo'
sha1 '25e279c56d3a8f1e82cbfb3526d1b38742d1d66c'
depends_on 'nkf'
def patches
DATA
end
def install
File.chmod(0755, "./configure")
system "./configure", "--prefix=#{prefix}"
system "make osx"
system "make osx-dict"
Dir.chdir 'dict' do
system "make utf-8"
end
mkdir "#{prefix}/lib"
mkdir "#{prefix}/share"
mkdir "#{prefix}/share/migemo"
mkdir "#{prefix}/share/migemo/cp932"
mkdir "#{prefix}/share/migemo/euc-jp"
mkdir "#{prefix}/share/migemo/utf-8"
system "make osx-install"
system "install_name_tool -change libmigemo.1.dylib #{prefix}/lib/libmigemo.1.dylib #{prefix}/bin/cmigemo"
end
end
__END__
--- a/src/wordbuf.c 2011-07-29 13:05:12.000000000 +0900
+++ b/src/wordbuf.c 2011-07-29 13:04:28.000000000 +0900
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "wordbuf.h"
#define WORDLEN_DEF 64
--- a/compile/config.mk.in 2011-02-27 19:45:40.000000000 +0900
+++ b/compile/config.mk.in 2012-07-15 05:21:08.000000000 +0900
@@ -33,6 +33,7 @@
PERL = perl
BUNZIP2 = bzip2 -d
GUNZIP = gzip -d
+TAR = tar zxvf
FILTER_CP932 = ${PROGRAM_ENCODEFILTER} -s
FILTER_EUCJP = ${PROGRAM_ENCODEFILTER} -e
FILTER_UTF8 = iconv -t utf-8 -f cp932
--- a/compile/config_default.mk 2012-07-15 04:13:22.000000000 +0900
+++ b/compile/config_default.mk 2012-07-15 02:02:10.000000000 +0900
@@ -35,6 +35,7 @@
PERL = perl
BUNZIP2 = bzip2 -d
GUNZIP = gzip -d
+TAR = tar zxvf
FILTER_CP932 = qkc -q -u -s
FILTER_EUCJP = qkc -q -u -e
FILTER_UTF8 = iconv -t utf-8 -f cp932
--- a/dict/dict.mak 2011-02-27 19:45:40.000000000 +0900
+++ b/dict/dict.mak 2012-07-15 04:32:14.000000000 +0900
@@ -6,8 +6,10 @@
DICT = migemo-dict
DICT_BASE = base-dict
-SKKDIC_BASEURL = http://openlab.ring.gr.jp/skk/dic
SKKDIC_FILE = SKK-JISYO.L
+SKKDIC_ARCHIVE_BASE_URL = http://ftp.debian.org/debian/pool/main/s/skkdic
+SKKDIC_ARCHIVE_FILE = skkdic_20110529.orig.tar.gz
+SKKDIC_ARCHIVE_DIR = skkdic-20110529.orig
EUCJP_DIR = euc-jp.d
UTF8_DIR = utf-8.d
@@ -20,10 +22,11 @@
$(PERL) ../tools/skk2migemo.pl < $(SKKDIC_FILE) > dict.tmp
$(PERL) ../tools/optimize-dict.pl < dict.tmp > $@
-$(RM) dict.tmp
-$(SKKDIC_FILE):
- $(HTTP) $(SKKDIC_BASEURL)/[email protected]
- $(GUNZIP) [email protected]
-
+$(SKKDIC_FILE): $(SKKDIC_ARCHIVE_FILE)
+ $(TAR) $(SKKDIC_ARCHIVE_FILE)
+ -$(CP) $(SKKDIC_ARCHIVE_DIR)/$@ ./
+$(SKKDIC_ARCHIVE_FILE):
+ $(HTTP) $(SKKDIC_ARCHIVE_BASE_URL)/$@
##############################################################################
# Dictionary in cp932
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment