2019年10月22日火曜日

CentOS7 で mlterm をビルドする

~/.mlterm/msg.log に出力されるエラーを見ながら、トライアル&エラーでビルドしたので、備忘録です。

まず、ビルドに必要なもの、途中メモらなかったので、history から抜粋です。もしかしたら、不完全かもです。
[root@hoge ~]# history | grep -w "yum install" | grep 2019-10-22 | sort -k +3
14624   2019-10-22 04:42:31  yum install xcb-util-image.x86_64
14627   2019-10-22 04:44:31  yum install libX11-devel
14691   2019-10-22 08:13:48  yum install cairo-devel
14722   2019-10-22 08:29:17  yum install harfbuzz-devel
14729   2019-10-22 08:37:55  yum install fribidi-devel
14817   2019-10-22 08:48:07  yum install gtk3-devel
特に最後の gtk3-devel が入ってないと、Ctrl+マウス右ボタン(設定を呼び出す)が使えません。入ってなくても、それにまつわる機能が disable になってビルドされてしまうので、厄介でした。最後の最後に、見出しました。

ソース tar の中には、spec ファイルが含まれていますが、少し手直しする必要がありました。次は差分です。
[root@hoge ~]# diff -u mlterm-3.8.8/mlterm.spec.org mlterm-3.8.8/mlterm.spec
--- mlterm-3.8.8/mlterm.spec.org 2019-03-31 22:10:47.000000000 +0900
+++ mlterm-3.8.8/mlterm.spec 2019-10-22 08:57:24.925819688 +0900
@@ -19,7 +19,7 @@
 URL:         http://mlterm.sourceforge.net/
 Source0:     http://prdownloads.sourceforge.net/mlterm/mlterm-%{version}.tar.gz
 Packager:    The mlterm team
-Requires:    gtk+
+Requires:    gtk3
 BuildRoot:   /var/tmp/%{name}-%{version}-root
 
 %description
@@ -68,7 +68,7 @@
 %{bindir}/mlfc
 %{libdir}/libpobl.*
 %{libdir}/libmef.*
-%{libdir}/libmlterm_core.*
+#%{libdir}/libmlterm_core.*
 %{libdir}/libmlterm_coreotl.*
 %{libdir}/mef/
 %{libdir}/mlterm/
@@ -79,9 +79,10 @@
 %{mandir}/man1/mlcc.1*
 %{pixmapdir}/mlterm*
 %{datadir}/locale/*/LC_MESSAGES/mlconfig.mo
+%{datadir}/mlterm/scrollbars/sample3/
 
 %changelog
-* Sun Mar 31 2018 Araki Ken 
+* Sun Mar 31 2019 Araki Ken 
 - Source version 3.8.8
 
 * Sat Oct 27 2018 Araki Ken 
@@ -153,7 +154,7 @@
 * Tue Oct 28 2014 Araki Ken 
 - Source version 3.4.0
 
-* Sun Aug 16 2014 Araki Ken 
+* Sat Aug 16 2014 Araki Ken 
 - Source version 3.3.8
 
 * Sun Jul 06 2014 Araki Ken 
@@ -240,7 +241,7 @@
 * Sat Jun 04 2011 Araki Ken 
 - Source version 3.0.5
 
-* Sat May 29 2011 Araki Ken 
+* Sun May 29 2011 Araki Ken 
 - Source version 3.0.4
 
 * Sun Mar 20 2011 Araki Ken 
@@ -261,7 +262,7 @@
 * Sun May 07 2006 Seiichi SATO 
 - Source version 2.9.3
 
-* Sat Mar 04 2005 Seiichi SATO 
+* Fri Mar 04 2005 Seiichi SATO 
 - Source version 2.9.2
 
 * Sun Nov 28 2004 Seiichi SATO 
@@ -283,7 +284,7 @@
 * Sun Jan 12 2003 Araki Ken 
 - Source version 2.6.3
 
-* Thu Oct 1 2002 Araki Ken 
+* Tue Oct 1 2002 Araki Ken 
 - Source version 2.6.2
 
 * Thu Sep 12 2002 Araki Ken 
後半の changelog の年月日や曜日の間違いは、「あるある」だなあと思いました。それと、spec ファイル書いてくれた方、ありがとうございます。やはり、make install より、rpm のほうが取り回しが良いですよね。

あとは、ビルドです。
[root@hoge ~]# ls -l rpmbuild/SOURCES/mlterm-3.8.8.tar.gz  ※ここに tar ボール配置
-rw-r--r-- 1 root root 4035215 10月 22 04:35 rpmbuild/SOURCES/mlterm-3.8.8.tar.gz
[root@hoge ~]# rpmbuild -ba mlterm-3.8.8/mlterm.spec
...
[root@hoge ~]# ls -l --full-time rpmbuild/RPMS/x86_64/
合計 4777
-rw-r--r-- 1 root root 2392004 2019-10-22 08:58:58.737085241 +0900 mlterm-3.8.8-1.x86_64.rpm
-rw-r--r-- 1 root root 2535872 2019-10-22 08:58:59.713098408 +0900 mlterm-debuginfo-3.8.8-1.x86_64.rpm

[root@hoge ~]# dmidecode --type 1
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.

Handle 0x000C, DMI type 1, 27 bytes
System Information
 Manufacturer: LENOVO
 Product Name: 20K70003JP
 Version: ThinkPad 25
 Serial Number: PF0XJ53D
 UUID: 307f584c-2bae-11b2-a85c-c18b88313792
 Wake-up Type: Power Switch
 SKU Number: LENOVO_MT_20K7_BU_Think_FM_ThinkPad 25
 Family: ThinkPad 25

[root@hoge ~]# uversion 
CentOS Linux release 7.7.1908           20K70003JP

BIOS version  : N1QET85W (1.60 )  08/30/2019  1.60
Firmware rev. : 1.34
System serial : PF0XJ53D

CPU model  : Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Processors : 4  (1 sockets, 2 cores per CPU, Hyperthreading: enabled)

Memory : 31772 MB

Linux : 3.10.0-1062.1.2.el7.x86_64  x86_64  (hoge)

[root@hoge ~]# rpm -qi mlterm
Name        : mlterm
Version     : 3.8.8
Release     : 1
Architecture: x86_64
Install Date: 2019年10月22日 08時59分37秒
Group       : User Interface/X
Size        : 17492735
License     : Modified BSD-style license
Signature   : (none)
Source RPM  : mlterm-3.8.8-1.src.rpm
Build Date  : 2019年10月22日 08時58分57秒
Build Host  : hoge
Relocations : (not relocatable)
Packager    : The mlterm team
URL         : http://mlterm.sourceforge.net/
Summary     : Multi Lingual TERMinal emulator on X
Description :
mlterm is a multi-lingual terminal emulator written from
scratch, which supports various character sets and encodings
in the world.  It also supports various unique feature such as
anti-alias using FreeType, multiple windows, scrollbar API,
scroll by mouse wheel, automatic selection of encoding,
and so on. Multiple xims are also supported.
You can dynamically change various xims.
格闘の記録。msg.log も貼っておきます。
[root@hoge ~]# cat .mlterm/msg.log 
Oct 22 04:58:27[16165] ERROR(No such file or directory): cairo: Could not load.
Oct 22 04:58:27[16165] Fall back to xcore.
Oct 22 04:58:27[16165] ERROR(No such file or directory): BiDi: Could not load.
Oct 22 04:58:40[16165] Font(id 2d1) width(10) is not matched with standard width(20).
Oct 22 04:58:40[16165] Characters (cs d1) are drawn *one by one *to arrange column width.
Oct 22 04:59:32[16165] Font(id 6d1) width(10) is not matched with standard width(20).
Oct 22 04:59:32[16165] Characters (cs d1) are drawn *one by one *to arrange column width.
Oct 22 05:08:13[17324] ERROR(No such file or directory): cairo: Could not load.
Oct 22 05:08:13[17324] Fall back to xcore.
Oct 22 05:08:13[17324] ERROR(No such file or directory): BiDi: Could not load.
Oct 22 05:08:24[17384] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 05:08:30[17391] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 05:08:32[17394] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 05:08:35[17399] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 05:13:28[17995] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 05:13:30[17998] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 05:13:33[18003] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 05:13:34[18006] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 05:14:59[18140] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 05:15:00[18142] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 05:19:24[17324] Font(id 2d1) width(10) is not matched with standard width(20).
Oct 22 05:19:24[17324] Characters (cs d1) are drawn *one by one *to arrange column width.
Oct 22 07:39:49[6408] ERROR(No such file or directory): cairo: Could not load.
Oct 22 07:39:49[6408] Fall back to xcore.
Oct 22 07:39:49[6408] ERROR(No such file or directory): BiDi: Could not load.
Oct 22 07:39:53[6459] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 07:39:55[6462] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 07:39:56[6463] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 07:39:56[6465] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 07:40:45[6408] Fall back to xcore.
Oct 22 07:43:36[6408] Fall back to xcore.
Oct 22 07:43:38[6408] Fall back to xcore.
Oct 22 07:44:28[6408] Font(id 2d1) width(10) is not matched with standard width(20).
Oct 22 07:44:28[6408] Characters (cs d1) are drawn *one by one *to arrange column width.
Oct 22 08:10:51[10440] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:20:55[11806] ERROR(No such file or directory): BiDi: Could not load.
Oct 22 08:21:05[11806] Font(id 2d1) width(21) is not matched with standard width(16).
Oct 22 08:23:07[12239] ERROR(No such file or directory): BiDi: Could not load.
Oct 22 08:23:09[12278] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:23:10[12280] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:23:10[12281] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:23:13[12284] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:23:14[12286] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:23:14[12287] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:26:08[12644] ERROR(No such file or directory): BiDi: Could not load.
Oct 22 08:26:15[12692] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:26:15[12694] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:28:45[12644] Font(id 2d1) width(21) is not matched with standard width(16).
Oct 22 08:34:21[14473] ERROR(Resource temporarily unavailable): BiDi: Could not load.
Oct 22 08:34:26[14527] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 08:34:37[14581] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 08:35:08[14652] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 08:35:09[14653] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:35:57[14706] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 08:35:57[14708] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:35:58[14710] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 08:37:21[14473] Font(id 2d1) width(21) is not matched with standard width(16).
Oct 22 08:41:51[16532] Font(id 2d1) width(21) is not matched with standard width(16).
Oct 22 08:42:07[16743] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 08:42:08[16746] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:42:13[16764] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 08:42:14[16765] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:42:14[16767] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlconfig.
Oct 22 08:42:15[16768] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
Oct 22 08:42:15[16769] ERROR(No such file or directory): Failed to exec /usr/libexec/mlterm/mlterm/mlterm-menu.
[root@hoge ~]# 
それにしても、CentOS や Fedora で利用している人は、あまり居ないのでしょうかね。ググってもなかなか情報を見つけられず、時間かかりました。
mlterm の「良さ」などについては、ネット検索すると、いろいろと解説が出てくるので、そちらを参照ください。

わたしの目的は、これがしたかっただけです。別途 img2sixel を入れる必要がありますが、そちらは簡単でした。

ターミナルの中で png が見えるー。ひゃっほー。Windows なら Rlogin が Sixel 対応しているようです。

2019-10-22 17時 追記
CentOS8 が入ってる別マシンでも、同様の手順で rpm 作成できることを確かめました。


2019-10-22 21時 追記
背景画像設定して、カラーを調整(前景色を白に設定)したら、良い感じになりました。


2019-10-24追記
Mac の iTerm2 では、imgcat というツールがよく使われるらしいですが、mlterm でも使えました。
https://iterm2.com/utilities/imgcat

大きめの画像を表示する場合は、どういうわけか imgcat のほうが反応が良い(処理時間短い)ようです。それと imgcat のほうが名前を覚えやすいですね。名前重要。
imgls というツールもあり、これまた便利なようです。mlterm でも使えました。

0 件のコメント:

コメントを投稿

人気ブログランキングへ にほんブログ村 IT技術ブログへ