LoginSignup
7
9

More than 5 years have passed since last update.

Windows 8.1 に Emacs をインストールする

Last updated at Posted at 2015-02-18

 Windows では,Sublime Text を使おうと思っていたのですが,無理だったので Emacs に変更しました.取り敢えず 64bit Emacs をビルドしてみる.

MSYS2

インストール

 ここから,「msys2-x86_64.20150202.exe」をダウンロードする.
ダウンロードした「msys2-x86_64.20150202.exe」を実行してインストールする.
 ここでは,インストール先を D:\msys64 に変更していが,全角文字や空白が無ければ問題ないと思われる.また,「msys2-x86_64.20150202.exe
」の日付は,インストーラをダウンロードした日によって変わると思います。

アップデート

 「MSYS2 Shell(msys2_shell.bat)」を起動する.プロキシ環境の場合は %HOME%(%HOME% が設定してなければ,C:\Users\xxxx になると思います) に下記のような内容で .bashrc_profile を作成する.

.bashrc_profile
export http_proxy=http://url:port/
export https_proxy=http://url:port/
export ALL_PROXY=http://url:port/

下記のコマンドを実行して MSYS2 のアップデートを行う.

$ source .bash_profile
$ pacman -Syu

(2016/05/10追記)
pacman 5.0.1.6403 から update-core コマンドが廃止されたので,次のようにアップデートする.

$ pacman -Syuu

MacType を使用しているとGPGME error: Invalid crypto engine のようなエラーが表示されて更新されないので,MacType の設定ファイルに下記内容を追加する.

[UnloadDll]
gpg.exe
pacman.exe

MacType に起因するトラブルが多いのでそろそろ使うのをやめるべきかもしれないです.

(2015/9/9追記)
アップデートの方法の訂正
update-core のコマンドがある場合

$ update-core
MSYS2 Shell を再起動
$ pacman -Su

update-core のコマンドがない場合

$ pacman -Sy
$ pacman --needed -S bash pacman pacman-mirrors msys2-runtime
MSYS2 Shell を再起動
$ pacman -Su

Emacs のビルドに必要なパッケージのインストール

pcaman -S xxx」 を使ってインストールする(xxx はインストールするパッケージ).

下記のパッケージをインストールした.

autoconf
automake
autogen
make
tar
patch
pkg-config
texinfo
mingw-w64-x86_64-gcc
mingw-w64-x86_64-pango
mingw-w64-x86_64-dbus
mingw-w64-x86_64-gdk-pixbuf2
mingw-w64-x86_64-xpm-nox
mingw-w64-x86_64-libxml2
mingw-w64-x86_64-pixman
mingw-w64-x86_64-giflib
mingw-w64-x86_64-gnutls
mingw-w64-x86_64-libcroco
mingw-w64-x86_64-libffi
mingw-w64-x86_64-librsvg

Emacs

インストールするのに,chuntaro/NTEmacs64emacs-w64を参考にしました.これらのサイトの方が詳しいです.>_<

ソースファイルとパッチファイル

「MinGW-w64 Win64 Shell(mingw64_shell.bat)」を起動する.ソースとパッチを適当なフォルダにダウンロードする.

$ cd ~/Downloads/src
$ curl -O http://ftp.gnu,org/gnu/emacs/emacs-24.4.tar.xz
$ curl -O https://gist.githubusercontent.com/rzl24ozi/a282260d2dd136daab14/raw/d544078827f90a10c53e0840a9faefed53187f25/emacs-24.4-w32-ime.diff
$ tar Jxvf emacs-24.4.tar.xz
$ cd emacs-24.4
$ patch -p0 < ../emacs-24.4-w32-ime.diff

ビルド

インストール先は,「prefix」で変更します.

$ export MSYSTEM=MINGW32
$ autoconf
$ CFLAGS='-Ofast -march=corei7 -mtune=corei7' ./configure --without-pop
$ make bootstrap
$ make install prefix=/d/Programs/emacs

DLL のコピー

 このままでは,コンソールからしか起動できないので,「runemacs.exe」が実行できるように必要な DLL をD:\msys64\mingw64\bin から D:\Programs\emacs\bin にコピーする.コピー元,コピー先はインストール先によって異ります.

DLL
libbz2-1.dll
libcairo-2.dll
libcairo-gobject-2.dll
libcairo-script-interpreter-2.dll
libcroco-0.6-3.dll
libdbus-1-3.dll
libexpat-1.dll
libffi-6.dll
libfontconfig-1.dll
libfreetype-6.dll
libgcc_s_seh-1.dll
libgdk_pixbuf-2.0-0.dll
libgif-7.dll
libgio-2.0-0.dll
libglib-2.0-0.dll
libgmodule-2.0-0.dll
libgmp-10.dll
libgnutls-28.dll
libgnutls-openssl-27.dll
libgnutlsxx-28.dll
libgobject-2.0-0.dll
libgomp-1.dll
libharfbuzz-0.dll
libharfbuzz-gobject-0.dll
libharfbuzz-icu-0.dll
libhogweed-2-5.dll
libiconv-2.dll
libintl-8.dll
libjbig-0.dll
libjpeg-8.dll
liblzma-5.dll
libnettle-4-7.dll
libp11-kit-0.dll
libpango-1.0-0.dll
libpangocairo-1.0-0.dll
libpangoft2-1.0-0.dll
libpangowin32-1.0-0.dll
libpixman-1-0.dll
libpng16-16.dll
librsvg-2-2.dll
libtasn1-6.dll
libtiff-5.dll
libtiffxx-5.dll
libwinpthread-1.dll
libxml2-2.dll
libXpm-noX4.dll
zlib1.dll

D:\Programs\emacs\bin\runemacs.exeを実行して,Emacs が起動するのを確認する.

不具合

 他の方も言われていますが,Windows 8.1では,日本語変換に不具合があるようです.取り敢えず Emacs のメニューを開くと日本語変換ができるようになるので,このまま使用することにする.Windows を 再起動しない限り Emacs を閉じることは無いのでこのまま使うことにする.

7
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
9