今回は、TeXLive と LyX をインストールしていきます。

 

まず、TeXLive ですが、

https://texwiki.texjp.org/Linux

 


を参考にして、必ずフルパッケージでインストールしてください。上記サイトからネットワークインストーラを使ってインストールする時に、 ENTER キーだけ押していては正常にインストール出来ません。(特に、Openindiana は)

 

 

 

必ず、<S> を選んでフルパッケージでインストールします。忘れずに実行してください。パスの設定は、~/.profile で行うこともお忘れなく。(私は不注意に ~/.bashrc に設定したことがあって悩みました)TeXLive インストール後、一度ログアウトして再ログイン。テストしてみます。

 

test.tex

---

\documentclass{jsarticle}
\usepackage{amsmath,amssymb,amsfonts}
\begin{document}
二次方程式の解の公式は
\begin{equation}
x = \frac{-b\pm\sqrt{b^2-4ac}}{2a}
\end{equation}
\end{document}
---

 

$ platex test.tex

$ dvipdfmx test.dvi

 

として、PDF を作成し、Atril ドキュメントビューアーでプレビューして問題が無いことを確認してください。Atril は最初から入っています。(アプリケーションメニューのオフィスにあります。)

 

問題なく TeXLive がインストールされているとして、 LyX のビルドを開始します。まず

https://www.lyx.org/WebJa.Home

 

を訪れて、最新の LyX の tar.gz をダウンロードし、展開します。展開したソースのトップディレクトリに入り、インストール要件を確認します。INSTALL を見ると、Requirements に Python2.7 が必要なことが書かれています。インストールしておきます。(Openindianaのデフォルトはpython3)

 

# pkg install python-27

 

前回までに、必要なパッケージはあらかた入っていると思いますが、おまじないを一つ追加します。iconv です。UTF-8版以外のものも入れてください。

 

root@illumos:~# pkg list | grep iconv
system/library/iconv/extra                        0.5.11-2020.0.1.20026      i--
system/library/iconv/unicode                      0.5.11-2020.0.1.20026      i--
system/library/iconv/utf-8                        0.5.11-2020.0.1.20026      i--
system/library/iconv/xsh4/latin                   0.5.11-2020.0.1.20026      i--

上記の状態にしてください。gettext は既に /usr/bin にあるはずです。pkg-config も入っていなければ入れてください。

 

いよいよ、LyX (本稿最新版は 2.3.5.2)をビルドします。その前に、再度 .bashrc を確認します。

 

~/.bashrc

---

#
# Define default prompt to <username>@<hostname>:<path><"($|#) ">
# and print '#' for user "root" and '$' for normal users.
#

typeset +x PS1="\u@\h:\w\\$ "
export CUPS_SERVER=localhost

alias ls='gls -AF --color=auto'
alias grep='ggrep'
alias p2f='ps2pdf14'

CXXFLAGS="-m32"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/qt/4.8/lib
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig

GS_FONTPATH=/usr/share/fonts/TrueType/ipafont
export GS_FONTPATH PATH PKG_CONFIG LD_LIBRARY_PATH CXXFLAGS

---

 

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/qt/4.8/lib
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig
 

pkg-config で、Qt4 を始め様々なライブラリのパスやコンパイラのオプションを拾ってきます。また、32bit でコンパイルし  Qt4.8 ライブラリをリンクしますので、実行時のライブラリの場所を指定しています。(64bit , Qt5 は何故か実行時にエラー終了してしまうので、32bit Qt4 仕様でビルドしました。)

 

そして、~/.profile

---

#
# Uncommenting PATH below will place /usr/gnu/bin at front,
# adds /usr/sbin and /sbin to the end.
#
# export PATH=/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin
#
# Define default prompt to <username>@<hostname>:<path><"($|#) ">
# and print '#' for user "root" and '$' for normal users.
#
# override default prompt for bash
# case "$0" in
# -bash)
#    export PS1="\u@\h:\w\\$ "
# esac

PATH=/usr/gnu/bin:/usr/local/texlive/2020/bin/x86_64-solaris:/usr/lib/cups/bin:$PATH

export PATH

---

 

上記の設定がなされているとしてビルドに進みます。

 

$ ./configure --prefix=/usr

 

Openindiana の Mate は /usr/bin にインストールすると自動的にメニュー(オフィス)に登録してくれますので。

 

$ make

$ make check

# make  install

 

の手順は同じです。無事にインストールまで済めば、起動し、TeX の自動設定などを経て

 

 

LyX が起動します。LyX の設定については

https://texwiki.texjp.org/LyX

 


などを参考にして適宜ご自身の好みで設定してください。ただ、プレビューだけ設定を記します。

 

 

「ツール」「設定」「ファイル形式」で PDF(dvipdfm) のビューワーを atril にしておいてください。

 

ここまでですが、何かビルド上でお困りのことがあれば、コメントをください。できる限り加筆・修正していきます。

 

 

 

 

 

 

 

 

 

 

 

 

今回は、OpenIndiana 2020.4 に 定番アプリを入れていく。レポジトリの設定は

 

http://pkg.openindiana.org/hipster 

http://pkg.openindiana.org/hipster-encumbered 


を設定できているものとする。

 

まずは、Libre Office 6.4 から。

root@illumos:~# pkg list | grep libre
desktop/office/libreoffice                        6.4.3-2020.0.1.1           i--
image/djvulibre                                   3.5.27-2020.0.1.0          i--
library/c++/librevenge                            0.0.4-2020.0.1.1           i--

# pkg install libreoffice

 

で一発インストール。MS Office との互換性はマアマアと言ったところか。

 

 

GIMP 2.10

root@illumos:~# pkg list | grep gimp
image/editor/gimp                                 2.10.20-2020.0.1.0         i--

# pkg install gimp

 

 

VLCとrhythmboxもお好みで。それぞれ

 

# pkg install vlc

# pkg install rhythmbox

 

で一発で入る。

 

 

 

 

その他、アプリのパッケージはお好みでどうぞ。

 

さて、次回は TeXLive と LyX のインストールとなるので、その前に GNU な環境を入れておく。

 

root@illumos:~# pkg list | grep gnu
archiver/gnu-tar                                  1.32-2020.0.1.1            i--
crypto/gnupg                                      2.2.19-2020.0.1.1          i--
developer/build/gnu-make                          4.2.1-2020.0.1.1           i--
developer/gnu-binutils                            2.34-2020.0.1.1            i--
developer/macro/gnu-m4                            1.4.18-2020.0.1.0          i--
editor/gnu-emacs                                  27.1-2020.0.1.0            i--
editor/gnu-emacs/gnu-emacs-x11                    27.1-2020.0.1.0            i--
file/gnu-coreutils                                8.31-2020.0.1.0            i--
file/gnu-findutils                                4.7.0-2020.0.1.0           i--
image/gnuplot                                     5.0.6-2020.0.1.1           i--
library/gnutls-3                                  3.5.19-2020.0.1.1          i--
print/filter/ghostscript/fonts/gnu-gs-fonts-other 6.0-2020.0.1.0             i--
print/filter/ghostscript/fonts/gnu-gs-fonts-std   6.0-2020.0.1.0             i--
system/prerequisite/gnu                           0.5.11-2020.0.1.0          i--
text/gnu-diffutils                                3.7-2020.0.1.0             i--
text/gnu-grep                                     3.4-2020.0.1.0             i--
text/gnu-patch                                    2.7.6-2020.0.1.0           i--
text/gnu-sed                                      4.8-2020.0.1.0             i--

私の場合上記のようになっているが、とりあえず

 

# pkg install gnu

 

として、/usr/gnu/bin にパスを通してください。一番前にしておいて、LyXビルドが終われば、後はお好みで処置してください。ついでに、

 

# pkg install autoconf

# pkg install automake

 

としておいてください。gcc と GNU autotool 、GNU な make や sed などは LyX ビルドの準備に必要ですから。

 

Qt-4.8 も入れておいてください。

root@illumos:~# pkg list | grep qt4
library/qt4                                       4.8.7-2020.0.1.8           i--

# pkg install qt4

 

ImageMagic も入れておきましょう。

root@illumos:~# pkg list | grep imagemagic
image/imagemagick                                 6.9.9.21-2020.0.1.3        i--

 

# pkg install imagemagic

 

次回は、いよいよ TeXLive 2020 と LyX のビルドにとりかかります。

 

 

今回は印刷設定がメインです。一応、OpenIndiana インストール済みであれば最低限のプリンタ設定用のパッケージは入っています。でも、プリンタドライバ等最小限度の構成になっていて、恐らく多くの方は追加パッケージが必要でしょう。私は、

oot@illumos:~# pkg list | grep cups
library/desktop/gtk3/gtk-backend-cups             3.24.12-2020.0.1.1         i--
library/print/cups-libs                           1.7.5-2020.0.1.3           i--
library/python/pycups-35                          1.9.74-2020.0.1.0          i--
print/cups                                        1.7.5-2020.0.1.3           i--
print/cups-filters                                1.11.2-2020.0.1.4          i--
print/cups/filter/foomatic-db                     0.20080903-2020.0.1.0      i--
print/cups/filter/foomatic-db-engine              0.20080903-2020.0.1.1      i--
print/cups/system-config-printer                  2.30.0-2020.0.1.3          i--

 

root@illumos:~# pkg list | grep foomatic
print/cups/filter/foomatic-db                     0.20080903-2020.0.1.0      i--
print/cups/filter/foomatic-db-engine              0.20080903-2020.0.1.1      i--
print/lp/filter/foomatic-ppds                     0.2008.8.18-2020.0.1.0     i--
print/lp/filter/foomatic-rip                      4.0.17-2020.0.1.2          i--

 

root@illumos:~# pkg list | grep ghost
print/filter/ghostscript                          9.26-2020.0.1.0            i--
print/filter/ghostscript/fonts/gnu-gs-fonts-other 6.0-2020.0.1.0             i--
print/filter/ghostscript/fonts/gnu-gs-fonts-std   6.0-2020.0.1.0             i--

 

重複していますが、上記のとおりパンパンにインストールしています。10年前の Epson LPS-7500 などという古いネットワークプリンタを使っていますので。Postscript Lev3 対応のプリンターならば何も困りませんけど。

 

そして、パッケージを入れられるだけ入れて

 

 

何とかドライバが出てきました。Epson は Linux 向けとして様々な ppd ファイルを用意してくれていますので一覧に無ければ、DL してプリンタマネージャーからドライバ指定もできます。ともあれ、ドライバが無ければ動きませんのでなるべくOpenIndianaの収録ドライバのあるプリンターを用意するのがベストです。中古なら安いですし。

 

さて、ドライバが見つかったと仮定して話しを進めます。プリンタマネージャーでプリンタドライバを設定し、テスト印刷まで済ませてください。

 

ここからが、本日のお題。まず、lpr コマンドがパスの通ったところにありませんので通しておきます。前回の私の設定だと

/usr/lib/cups/bin にありますので PATH に追加しています。

 

そうそう、忘れずに IPA明朝フォントを pkg で入れておいてください。

 

ともあれ、まずはテキストファイルを印刷できるようにしていきます。前提として、テキストファイルをPostscriptに変換するフィルター(日本語 UTF-8、Perl5 対応)の a2ps-j を /usr/bin に入れておきます。

 
どこにアップロードすれば良いのか難しいので、とりあえずアップローダに上げました。どなたか適切な場所で公開してもらえれば嬉しいです。元ファイルのライセンスが判らないのですが、とりあえず置いておきます。
 
 

さて、次は Ghostscript です。

/usr/share/ghostscript/9.26/Resource/Init に cidfmap を入れ替えます。(オリジナルはセーブしてください)

 

cidfmap

--

%!
% $Id: cidfmap 11349 2010-06-02 08:37:07Z ken $
% This is a sample map file for CIDFont category.

%
% The map is a set of records, which must use one of the two formats :
%
% 1. A substutution of a CIF font with another CID font :
%
%    /substituted /original ;
%
%    Where 'substituted' is a name being used in a document,
%    'original' is a name of an available resource.
%
% 2. A substutution of a CIF font with a True Type font :
%
%    /substituted << /FileType /TrueType /Path (path) /SunfontID 1 /CSI [(ordering) supplement] >> ;
%
%    Where 'substituted' is a name being used in a document,
%    'path' is a path to a True Type font file,
%    'ordering' is a value of Ordering required for CIDSystemInfo dictionary,
%    'supplement' is a value of Supplement required for CIDSystemInfo dictionary.
%
%    The Ordering, and Registry (if present) entries should be PostScript string types
%    ie enclosed in parentheses, not PostScript name type (initial character '/'). See
%    gs/doc/Use.htm#CIDFontSubstitution
%
% Examples :
%    
%   /ShinGo-Bold   /HeiseiKakuGo-W5 ;
%   /Ryumin-Medium << /FileType /TrueType /Path (H:/AuxFiles/Fonts/BATANG.TTC) /SubfontID 3 /CSI [(Japan1) 2] >> ;
%

%
% Mapping for Asian Language Fonts delivered with Openwin.
%

%    Japanese Fonts
%
/HG-MinchoL <<
    /FileType /TrueType
    /Path (/usr/share/fonts/TrueType/ipafont/ipam.otf)
    /SubfontID 0
    /CSI [(Japan1) 6] >> ;

/HG-GothicL <<
    /FileType /TrueType
    /Path (/usr/share/fonts/TrueType/ipafont/ipag.otf)
    /SubfontID 0
    /CSI [(Japan1) 6] >> ;

/Ryumin-Light        /HG-MinchoL    ;
/GothicBBB-Medium    /HG-GothicL    ;
/Adobe-Japan1        /HG-MinchoL    ;
/Adobe-Japan2        /HG-GothicL    ;

/HG-GothicB <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/ja/X11/fonts/TT/hggbsun.ttf)
    /SubfontID 0
    /CSI [(Japan1) 1] >> ;
/GothicBBB-Medium       /HG-GothicB    ;

%    CNS Fonts
%
/hei <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/hei.ttf)
    /SubfontID 0
    /CSI [(CNS1) 1] >> ;
/MHei-Medium            /hei     ;

/kei <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/kei.ttf)
    /SubfontID 0
    /CSI [(CNS1) 1] >> ;
/MKei-Medium            /kei     ;

/ming <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/ming.ttf)
    /SubfontID 0
    /CSI [(CNS1) 1] >> ;
/MMing-Medium        /ming    ;
/Adobe-CNS1        /ming    ;

%    GB Fonts
%
/zycjkfangs <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/fangsongti.ttf)
    /SubfontID 0
    /CSI [(GB1) 1] >> ;
/STFangsong-Light    /zycjkfangs    ;

/zycjkhei <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/heiti.ttf)
    /SubfontID 0
    /CSI [(GB1) 1] >> ;
/STHeiti-Regular    /zycjkhei    ;

/zycjkkai <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/kaiti.ttf)
    /SubfontID 0
    /CSI [(GB1) 1] >> ;
/STKaiti-Regular    /zycjkkai    ;

/zycjksun <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/songti.ttf)
    /SubfontID 0
    /CSI [(GB1) 1] >> ;
/STSong-Light           /zycjksun    ;
/Adobe-GB1        /zycjksun    ;

/CFangSongGB-Light <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/cfsgbl.ttf)
    /SubfontID 0
    /CSI [(GB1) 1] >> ;

/MHeiGB-Bold <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/mhgbb.ttf)
    /SubfontID 0
    /CSI [(GB1) 1] >> ;

/MSungGB-Medium <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/mhgbm.ttf)
    /SubfontID 0
    /CSI [(GB1) 1] >> ;

/MSungGB-Light <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/mhgbl.ttf)
    /SubfontID 0
    /CSI [(GB1) 1] >> ;

%    Korean Fonts
%
/Gothic <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/h2gtrm.ttf)
    /SubfontID 0
    /CSI [(Korea1) 1] >> ;
/HYGoThic-Medium    /Gothic            ;

/RoundedGothic <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/h2drrm.ttf)
    /SubfontID 0
    /CSI [(Korea1) 1] >> ;
/HYRGoThic-Medium    /RoundedGothic    ;

/Haeseo <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/h2hsrm.ttf)
    /SubfontID 0
    /CSI [(Korea1) 1] >> ;

/Myengjo <<
    /FileType /TrueType
    /Path (/usr/openwin/lib/locale/zh_TW.BIG5/X11/fonts/TT/h2mjsm.ttf)
    /SubfontID 0
    /CSI [(Korea1) 1] >> ;
/Adobe-Korea1        /Myeongjo    ;
/HYSMyeongJo-Medium    /Myeongjo    ;

--

end cidfmap

 

そして、/usr/share/ghostscript/9.26/Resource/CMap に、

GothicBBB-Medium-UniJIS-UTF8-H  Ryumin-Light-UniJIS-UTF8-H
GothicBBB-Medium-UniJIS-UTF8-V  Ryumin-Light-UniJIS-UTF8-V

の4ファイルを作成して入れてください。

 

Ryumin-Light-UniJIS-UTF8-H

---

%! Font Specification
%%Title: Ryumin-Light-UniJIS-UTF8-H
%%CreationDate: 12/08/04
%%ModificationDate: 12/08/04
%%EndComments
%%BeginResource: font Ryumin-Light-UniJIS-UTF8-H
(Ryumin-Light-UniJIS-UTF8-H)
(UniJIS-UTF8-H) /CMap findresource
[(Ryumin-Light) /CIDFont findresource]
composefont pop
%%EndResource
%%EOF

---

 

Ryumin-Light-UniJIS-UTF8-V

---

%! Font Specification
%%Title: Ryumin-Light-UniJIS-UTF8-V
%%CreationDate: 12/08/04
%%ModificationDate: 12/08/04
%%EndComments
%%BeginResource: font Ryumin-Light-UniJIS-UTF8-V
(Ryumin-Light-UniJIS-UTF8-V)
(UniJIS-UTF8-V) /CMap findresource
[(Ryumin-Light) /CIDFont findresource]
composefont pop
%%EndResource
%%EOF
---

 

GothicBBB-Medium-UniJIS-UTF8-H

---

%! Font Specification
%%Title: GothicBBB-Medium-UniJIS-UTF8-H
%%CreationDate: 12/08/04
%%ModificationDate: 12/08/04
%%EndComments
%%BeginResource: font GothicBBB-Medium-UniJIS-UTF8-H
(GothicBBB-Medium-UniJIS-UTF8-H)
(UniJIS-UTF8-H) /CMap findresource
[(GothicBBB-Medium) /CIDFont findresource]
composefont pop
%%EndResource
%%EOF

---

 

GothicBBB-Medium-UniJIS-UTF8-V

---

%! Font Specification
%%Title: GothicBBB-Medium-UniJIS-UTF8-V
%%CreationDate: 12/08/04
%%ModificationDate: 12/08/04
%%EndComments
%%BeginResource: font GothicBBB-Medium-UniJIS-UTF8-V
(GothicBBB-Medium-UniJIS-UTF8-V)
(UniJIS-UTF8-V) /CMap findresource
[(GothicBBB-Medium) /CIDFont findresource]
composefont pop
%%EndResource
%%EOF

---

 

ここまでで、テキストファイルの印刷準備ができました。さて、実際に Emacs で使う場合ですが、.emacs.el に次のように設定してください。

---

(setq print-command-format "a2ps-j  -h -nn -f9.8 -p -a4 | ps2pdf - - | /usr/lib/cups/bin/lpr")
        (defun print-region (begin end)
          (interactive "r")
          (shell-command-on-region begin end print-command-format))
        (defun print-buffer ()
          (interactive)
          (print-region (point-min) (point-max)))
(setq print-function (function print-buffer))
---

 

これで、Emacs から print buffer で日本語も印刷できます。勿論、a2ps-j でテキストファイルを ps ファイルに出力し、ps2pdf で ps ファイルを pdf に直し、lpr で PDF を印刷することもできます。お好みでどうぞ。

 

例:a2ps-j hoge.txt > hoge.ps <> ps2pdf hoge.ps <> lpr hoge.pdf

 

次回は、Office,GIMP や GNU な環境設定、automake などのツールを入れて行きます。

 

 

前回、デスクトップ用途で使えるようになってきたと書いたので、何回かに分けて私の設定を書いていこうと思う。

 

OpenIndiana のインストールは、Native 仮想にかかわらず済んでいるものとする。仮想の場合、Virtual Box 環境下であることを前提とする。

 

OpenIndiana のレポジトリ設定は、

https://www.openindiana.org/packages/

 

http://pkg.openindiana.org/hipster 

http://pkg.openindiana.org/hipster-encumbered 

を設定しておいてください。

 

まず、基本的なところで環境設定ファイルから。いずれ、TeXLive + LyX をビルド・インストールもするので暫定的なものとして見て欲しい。GNU 環境を模した .bashrc .profile から。qt-4 は

 

root@illumos:~# pkg search -r qt4

pkg.fmri   set     openindiana.org/library/qt4 pkg:/library/qt4@4.8.7-2020.0.1.8

などとして後ほど入れて行きます。

 

~/.bashrc

typeset +x PS1="\u@\h:\w\\$ "
export CUPS_SERVER=localhost

alias ls='gls -AF --color=auto'
alias grep='ggrep'
alias p2f='ps2pdf14'

CXXFLAGS="-m32"
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/qt/4.8/lib
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig

GS_FONTPATH=/usr/share/fonts/TrueType/ipafont
export GS_FONTPATH PATH PKG_CONFIG LD_LIBRARY_PATH CXXFLAGS

 

~/.profile

PATH=/usr/gnu/bin:/usr/local/texlive/2020/bin/x86_64-solaris:/usr/lib/cups/bin:$PATH
export PATH

 

PATHの/usr/gnu/bin:/usr/local/texlive/2020/bin/x86_64-solaris は TeXLive + LyX のビルドまで特別必要はない。

 

ついでに、vim を多少使いやすくする。

~/.vimrc

" ファイルの上下端からn行までモードラインを探す(デフォルト5行)
"set modelines=5
" ファイルごとにエディタの設定を変更
set modeline
" バックアップを取らない
set nobackup
" 行番号を表示(コピペしにくいためオフ)
"set number
" TAB 4桁
set tabstop=4
" 80カラム(ウィンドウサイズによって変わった方が便利なのでオフ)
"set columns=80
" インクリメンタル検索
set incsearch
" 検索結果をハイライト表示
set hlsearch
" 小文字のみで検索:大文字小文字無視、大文字小文字で検索:区別して検索
set smartcase
" 対応する括弧やブレースを表示
set showmatch
" vim内部エンコード
set encoding=utf-8
" バッファの保存時に用いるエンコーディング
set fileencoding=utf-8
" バッファの改行コード
set fileformat=unix
" 改行コードの自動認識
set fileformats=unix,dos,mac
" 文字コードの自動認識
set fileencodings=ucs-bom,utf-8,iso-2022-jp,sjis,cp932,euc-jp,cp20932
" 構文ハイライト
syntax enable
" 背景色に合わせたカラー設定
set background=dark
" カラースキーマ
colorscheme koehler
" タブ、空白、改行の可視化
set list
set listchars=tab:>\ ,trail:-,eol:~,extends:>,precedes:<
" 自動改行の無効化
set tw=0
" コメント文字自動挿入の無効化~
autocmd FileType * setlocal formatoptions-=ro~
" 自動インデントの無効化
set nosmartindent
set noautoindent

で、基本的なgccインストールと確認。

 

# pkg search -r gcc

として検索し、gcc-10 を

# pkg install pkg:/developer/gcc-10@10.2.0-2020.0.1.0

などとしてインストール。早速、ちゃんとできたか確認。

 

# pkg install gnuplot

で、GNU Plot も入れておく。私は、新たな開発環境を構築したら簡単なテストプログラムで様子を見ることにしている。

 

まず、

bit.c というファイルを作成

/* bit からできるカオス *
*  n ビット列中の位置   *
*  testは1ビット        *
*  test2は8ビット       *
*  n = 5 とする         */

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>

#define TRUE 1
#define FAULSE 1

unsigned char convert(int iprod);
unsigned char substr(unsigned char bit,int n);
void PrintDot(FILE *fp,int x,int y);

int main(int argc,char *argv[]){
int fi,fj,iprod;
unsigned char test,test2;
FILE *fp;

    fp = fopen("dat","w");
    fj = fi = iprod = 0;
    for(fi = 1; fi <= 200; fi++){
        for(fj = 1;fj <= 200;fj++){
            iprod = pow(fi,2) * fj;
            test2 = convert(iprod);
            test = substr(test2,5);
            if(test){
                PrintDot(fp,fi,fj);
            }
        }
    }
    fclose(fp);
    return(TRUE);
}

unsigned char convert(int iprod){
unsigned char bits;

    bits = (unsigned char)(iprod >> 8);
    return(bits);

}

unsigned char substr(unsigned char bit,int n){
    unsigned char value;
    value = bit >> n;
    value = value & 0x01;
    return value;
}

void PrintDot(FILE *fp,int x,int y){
 fprintf(fp,"%d %d\n",x,y);
 return;
}
 

 

で、
$ gcc -o bit bit.c -lm

 

$ ./bit

これで、データ dat が出来る。

 

GNU Plot を立ち上げる。

$ gnuplot

$ gnuplot

        G N U P L O T
        Version 5.0 patchlevel 6    last modified 2017-03-18

        Copyright (C) 1986-1993, 1998, 2004, 2007-2017
        Thomas Williams, Colin Kelley and many others

        gnuplot home:     http://www.gnuplot.info
        faq, bugs, etc:   type "help FAQ"
        immediate help:   type "help"  (plot window: hit 'h')

Terminal type set to 'wxt'
gnuplot> plot "dat"

とすると、

 

 

このような絵柄が出てきたらOK。

 

長くなったので、今日はここまでで。次回は、面倒なプリンタ設定など。(cpus,ghostscript,emacs 等)

 

 

 

 

 

やっとの思いで Openindiana(illumos) が一応満足のできる環境になった。特に TeXLive2020 + LyX にはてこずった。32bit,Qt4 仕様でしか動かなかったが、稿を変えてビルド・インストール方法を書こうかなと思う。とりあえず、いくつかのデスクトップのスクショを張っておく。今日びUNIXでもデスクトップで十分使えることを確認。それにしても長かった。。。

 

 

LyX (with TeXLive2020)

 

 

VLC

 

 

Rhythmbox

 

 

Libere Office Writter

 

 

GIMP

 

まあ、今日はこのくらいで、ぼちぼち紹介していこうと思う。