ほんとのこと知りたいだけなのに。

夏休みはもうおわり。

babel2 パッケージごとの依存関係

パッケージ定義

パッケージの定義はこんな感じ。

綺麗なものである。

 +--------+                                           +-------------+
 | babel2 |<-----------------------------------------o| common-lisp |
 |        |                            +------------+ |             |
 |        |<--------------------------o| alexandria | |             |
 |        |    +------------------+    |            | |             |
 |        |<--o| babel2-encodings |<--o|            | |             |
 |        |    |                  |    +------------+ |             |
 |        |    |                  |<-----------------o|             |
 +--------+    +------------------+                   +-------------+

ソース

babel2

まぁこちらのパッケージはbabel2-encodingsに依存することは問題ない。

だけど、いちおう調べておく。

わかる範囲で。

結果はこんな感じ。

file babel2-encodings 依存
external-format.lisp lookup-mapping が依存
sharp-backslash.lisp sharp-backslash-reader が依存
strings.lisp なし。ほんまかな。

babel2-encodings

こちらのパッケージでbabel2を参照しているものがいると問題。

結果としては一つあった。

file babel2 依存
enc-ascii.lisp なし。
enc-cp1251.lisp なし。
enc-cp1252.lisp なし。
enc-ebcdic-int.lisp なし。
enc-ebcdic.lisp なし。
enc-gbk.lisp なし。
enc-iso-8859.lisp なし。
enc-jpn.lisp なし。
enc-koi8.lisp なし。
enc-unicode.lisp なし。
encodings.lisp なし。
gbk-map.lisp gbk-unicode-mapping が依存
jpn-table.lisp なし。

パッケージの依存関係で衝突が発生している。

以下の場所で衝突が発生していることがわかった。

結論としては babel2:unicode-string を外出しに出来れば寄さそう。

item value
file gbk-map.lisp
symbol gbk-unicode-mapping
confrict babel2:unicode-string をコールしている。

babel2:unicode-string とは?

unicode-string は type な様子。

file:strings.lisp で定義されています。

対応としては type は別パッケージにして、各パッケージがそれを :use する。で解決できそう。

deftype は別パッケージにする。

以下のイシューで別パッケージにする対応を実施しました。

[deftype を外出しにする。 #6]9https://github.com/yanqirenshi/babel2/issues/6)

これでパッケージの依存度合いは以下のように綺麗になりました。

 +--------+                                                +-------------+
 | babel2 |<----------------------------------------------o| common-lisp |
 |        |                            +------------+      |             |
 |        |<--------------------------o| alexandria |      |             |
 |        |    +------------------+    |            |      |             |
 |        |<--o| babel2.encodings |<--o|            |      |             |
 |        |    |                  |    +------------+      |             |
 |        |    |                  |<----------------------o|             |
 |        |    |                  |    +--------------+    |             |
 |        |    |                  |<--o| bable2.types |<--o|             |
 |        |    +------------------+    |              |    |             |
 |        |<--------------------------o|              |    |             |
 +--------+                            +--------------+    +-------------+

おわり。

やはり型はパッケージの共通領域で定義したほうが良いよね。

Class どか Constant とかもその方が良いんじゃないかな。

Chef-zero のインストール

openSUSE 13.2 がリリースされるので 再インストールする必要があります。

最近、再インストールする回数も増えているので Chef を利用することにしました。

とりあえず今回はインストールだけしてみます。

インストール

Chef Development Kit

以下をダウンロード

Red Hat Enterprise Linux 7
Works on 64 bit (x86_64) versions of Red Hat Enterprise Linux and CentOS 7

サイトにしたがって以下のコマンドでインストール。

sudo rpm -Uvh chefdk-0.19.6-1.el7.x86_64.rpm

~/Downloads> sudo rpm -Uvh chefdk-0.19.6-1.el7.x86_64.rpm
root's password:
warning: chefdk-0.19.6-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:chefdk-0.19.6-1.el7              ################################# [100%]
Thank you for installing Chef Development Kit!

んでバージョンを確認する。

~/Downloads> chef --version
Chef Development Kit Version: 0.19.6
chef-client version: 12.15.19
delivery version: master (802e801d920ea6b6d48db735aa7c6e7a6194bea4)
berks version: 5.1.0
kitchen version: 1.13.2

knife-zeroをインストール。 なんか警告でてるけど無視。

~/Downloads> sudo chef gem install knife-zero
Fetching: knife-zero-1.17.1.gem (100%)
WARNING:  You don't have /root/.chefdk/gem/ruby/2.3.0/bin in your PATH,
      gem executables will not run.
Successfully installed knife-zero-1.17.1
1 gem installed

おわり

つぎはリポジトリを作って、ちょっと動かしてみるところまでやります。

OSインストール後のやつだと面倒です。

なのでユーザー追加後にいつも実施している内容を自動かしてみます。

参照

続・openSUSE に MeCab をインストール

先日 MeCab を xx 経由でインストールしましたが、どうやらこれではイマイチみたい。

openSUSE に MeCab をインストール

なので今回は再度インストールします。

発生した問題

libmecab-dev(かな?)相当のものがインストールされていないっぽい。

mecab-python3 をインストール中に mecab.h が無いと叱られた。

> sudo pip3 install mecab-python3
       : 
       : 
    MeCab_wrap.cxx:3052:19: fatal error: mecab.h: No such file or directory
     #include "mecab.h"
                       ^

MeCab 自体は動くんだけれども。。。。

再度インストール

それではインストール開始。

ダウンロード

本家 の以下のメニューにあるものをダウンロードする。

ダウンロード > MeCab 本体 > Source

解答&インストール

本家の方法ですんなりインストール。

Downloads> tar zxvf mecab-0.996.tar.gz
    :
mecab-0.996/Makefile.am
Downloads> cd mecab-0.996/
mecab-0.996> ./configure
    :
config.status: executing default commands
mecab-0.996> make
    :
make[1]: Leaving directory '/home/somewrite/Downloads/mecab-0.996'
mecab-0.996> make check
    :
==================
All 3 tests passed
==================
make[2]: Leaving directory '/home/somewrite/Downloads/mecab-0.996/tests'
make[1]: Leaving directory '/home/somewrite/Downloads/mecab-0.996/tests'
make[1]: Entering directory '/home/somewrite/Downloads/mecab-0.996'
make[1]: Leaving directory '/home/somewrite/Downloads/mecab-0.996'
mecab-0.996> sudo make install
    :
make[1]: Leaving directory '/home/somewrite/Downloads/mecab-0.996'
mecab-0.996> mecab -v
mecab of 0.994

ついでに mecab-python3 をインストール

問題なく通過

mecab-0.996> sudo pip install mecab-python3
Collecting mecab-python3
  Using cached mecab-python3-0.7.tar.gz
Installing collected packages: mecab-python3
  Running setup.py install for mecab-python3 ... done
Successfully installed mecab-python3-0.7

おわり。

はやく zypper でインストールできるようになると良いですね。