Ubuntu 22.04 (WSL) に Emacs 29.1 をインストール

お知らせ

(2023年12月9日追記)この後、 Ubuntu 22.04 で Emacs 29.1 をpgtk ビルドでインストール を作成しています。pure GTK (Wayland) 版をビルド希望の場合にはそちらをご覧ください。

概要

Emacs29(Emacs 29.1)がリリースされましたので、これをビルドしてインストールしたいと思います。

私の環境は Ubuntu 22.04 (WSL) に Emacs 28.2 をインストール にて行った環境となりますので、必要なパッケージのほとんどについては既にインストールされている状態で作業を行いました。

手順

ソースコードの取得

$ git clone --depth 1 --branch emacs-29.1 git://git.savannah.gnu.org/emacs.git emacs-29.1

ビルドに必要なツールとライブラリの取得

(2023年11月12日追記、28.2ビルド時に行った手順に対して libsqlite3-dev を追加)

$ sudo apt install autoconf make texinfo gnutls-bin libgccjit-10-dev gcc
$ sudo apt install zlib1g-dev \
                   libncurses-dev \
                   libgtk-3-dev \
                   xorg-dev \
                   libjpeg-dev \
                   libgif-dev \
                   libtiff-dev \
                   libgnutls28-dev \
                   librsvg2-dev \
                   libcairo-5c-dev \
                   liblcms2-dev \
                   libgpm-dev \
                   libacl1-dev \
                   libxml2-dev \
                   libm17n-dev \
                   libotf-dev \
                   libsystemd-dev \
                   libjansson-dev \
                   libsqlite3-dev

Makefileの生成

# cd emacs-29.1
$ ./autogen.sh
$ CFLAGS='-I/usr/lib/gcc/x86_64-linux-gnu/10/include -L/usr/lib/gcc/x86_64-linux-gnu/10' ./configure --with-native-compilation --without-pop
Configured for 'x86_64-pc-linux-gnu'.

  Where should the build process find the source code?    .
  What compiler should emacs be built with?               gcc -I/usr/lib/gcc/x86_64-linux-gnu/10/include -L/usr/lib/gcc/x86_64-linux-gnu/10 -O
  Should Emacs use the GNU version of malloc?             no
    (The GNU allocators don't work with this system configuration.)
  Should Emacs use a relocating allocator for buffers?    no
  Should Emacs use mmap(2) for buffer allocation?         no
  What window system should Emacs use?                    x11
  What toolkit should Emacs use?                          GTK3
  Where do we find X Windows header files?                Standard dirs
  Where do we find X Windows libraries?                   Standard dirs
  Does Emacs use -lXaw3d?                                 no
  Does Emacs use -lXpm?                                   yes
  Does Emacs use -ljpeg?                                  yes
  Does Emacs use -ltiff?                                  yes
  Does Emacs use a gif library?                           yes -lgif
  Does Emacs use a png library?                           yes -lpng16 -lz
  Does Emacs use -lrsvg-2?                                yes
  Does Emacs use -lwebp?                                  no
  Does Emacs use -lsqlite3?                               no
  Does Emacs use cairo?                                   yes
  Does Emacs use -llcms2?                                 yes
  Does Emacs use imagemagick?                             no
  Does Emacs use native APIs for images?                  no
  Does Emacs support sound?                               yes
  Does Emacs use -lgpm?                                   yes
  Does Emacs use -ldbus?                                  yes
  Does Emacs use -lgconf?                                 no
  Does Emacs use GSettings?                               yes
  Does Emacs use a file notification library?             yes -lglibc (inotify)
  Does Emacs use access control lists?                    yes -lacl
  Does Emacs use -lselinux?                               yes
  Does Emacs use -lgnutls?                                yes
  Does Emacs use -lxml2?                                  yes
  Does Emacs use -lfreetype?                              yes
  Does Emacs use HarfBuzz?                                yes
  Does Emacs use -lm17n-flt?                              yes
  Does Emacs use -lotf?                                   yes
  Does Emacs use -lxft?                                   no
  Does Emacs use -lsystemd?                               yes
  Does Emacs use -ljansson?                               yes
  Does Emacs use -ltree-sitter?                           no
  Does Emacs use the GMP library?                         yes
  Does Emacs directly use zlib?                           yes
  Does Emacs have dynamic modules support?                yes
  Does Emacs use toolkit scroll bars?                     yes
  Does Emacs support Xwidgets?                            no
  Does Emacs have threading support in lisp?              yes
  Does Emacs support the portable dumper?                 yes
  Does Emacs support legacy unexec dumping?               no
  Which dumping strategy does Emacs use?                  pdumper
  Does Emacs have native lisp compiler?                   yes
  Does Emacs use version 2 of the X Input Extension?      yes
  Does Emacs generate a smaller-size Japanese dictionary? no

(2023年11月12日追記、libsqlite3-dev を追加した場合は、Does Emacs use -lsqlite3? が yes となります)

no となっているオプションのうち、気になるものを確認します。

Does Emacs support Xwidgets?                            no
Emacs25に導入されたXWidgetに関して理解を深める - ぐるっとぐりっど
この記事は、Emacs Advent Calendar 2016の3日目の記事です。 はじめに emacs25.1が2016年9月17日にリリースされました。 なかでも注目を(個人的に)浴びていたのが、もともとブランチして開発されていたものがマージされたXWidgetsです。XWidgetsは、リリースノートを見てみる...

上記を参照する限り、無くても問題なさそうです。

Does Emacs generate a smaller-size Japanese dictionary? no
Reddit - Dive into anything

こちらも、日本語を使う人はわざわざ設定する必要は無さそうです。

make

make

make は私の環境(Core i5-1235U, 32GB Memory, SSD)で約12分かかりました。

make install

sudo make install

起動後

⛔ Warning (initialization): An error occurred while loading ‘/home/wurly/.emacs.d/init.el’:

Symbol's function definition is void: set-face-underline-p

init.elの読み込み時に上記のエラーが出ましたので設定を削除しました。

⛔ Warning (comp): browse-kill-ring.el:291:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): browse-kill-ring.el:301:14: Warning: Case 'insert will match ‘quote’.  If that’s intended, write (insert quote) instead.  Otherwise, don’t quote ‘insert’.
⛔ Warning (comp): browse-kill-ring.el:301:14: Warning: Case 'append will match ‘quote’.  If that’s intended, write (append quote) instead.  Otherwise, don’t quote ‘append’.
⛔ Warning (comp): browse-kill-ring.el:301:14: Warning: Case 'prepend will match ‘quote’.  If that’s intended, write (prepend quote) instead.  Otherwise, don’t quote ‘prepend’.
⛔ Warning (comp): browse-kill-ring.el:306:14: Warning: Case 'move will match ‘quote’.  If that’s intended, write (move quote) instead.  Otherwise, don’t quote ‘move’.
⛔ Warning (comp): browse-kill-ring.el:306:14: Warning: Case 'delete will match ‘quote’.  If that’s intended, write (delete quote) instead.  Otherwise, don’t quote ‘delete’.
⛔ Warning (comp): browse-kill-ring.el:390:14: Warning: Case 'solid will match ‘quote’.  If that’s intended, write (solid quote) instead.  Otherwise, don’t quote ‘solid’.
⛔ Warning (comp): browse-kill-ring.el:267:14: Warning: the function ‘browse-kill-ring-fit-window’ is not known to be defined.
⛔ Warning (comp): org2blog.el:306:18: Warning: ‘format’ called with 1 args to fill 0 format field(s)
⛔ Warning (comp): org2blog.el:342:10: Warning: Unused lexical variable `org-export-show-temporary-export-buffer'
⛔ Warning (comp): htmlize.el:289:2: Warning: defvar `htmlize-face-overrides' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): htmlize.el:1797:10: Warning: Unused lexical variable `font-lock-maximum-size'
⛔ Warning (comp): org2blog.el:2210:33: Warning: reference to free variable ‘org2blog--error’
⛔ Warning (comp): org2blog.el:344:6: Warning: the function ‘org-ascii-export-as-ascii’ might not be defined at runtime.
⛔ Warning (comp): xml-rpc.el:188:11: Warning: defsubst ‘xml-rpc-valuep’ was used before it was defined
⛔ Warning (comp): writegood-mode.el:273:2: Warning: docstring wider than 80 characters
⛔ Warning (comp): writegood-mode.el:324:2: Warning: docstring wider than 80 characters
⛔ Warning (comp): ox-wp.el:111:2: Warning: docstring wider than 80 characters
⛔ Warning (comp): fringe-helper.el:100:2: Warning: Package cl is deprecated
⛔ Warning (comp): fringe-helper.el:138:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): fringe-helper.el:153:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): fringe-helper.el:168:19: Warning: ‘point-at-bol’ is an obsolete function (as of 29.1); use ‘line-beginning-position’ or ‘pos-bol’ instead.
⛔ Warning (comp): fringe-helper.el:174:21: Warning: ‘point-at-bol’ is an obsolete function (as of 29.1); use ‘line-beginning-position’ or ‘pos-bol’ instead.
⛔ Warning (comp): fringe-helper.el:227:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): git-gutter.el:51:2: Warning: custom-declare-variable `git-gutter:diff-option' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): git-gutter.el:56:2: Warning: custom-declare-variable `git-gutter:subversion-diff-option' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): git-gutter.el:61:2: Warning: custom-declare-variable `git-gutter:mercurial-diff-option' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): git-gutter.el:66:2: Warning: custom-declare-variable `git-gutter:bazaar-diff-option' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
⛔ Warning (comp): git-gutter.el:852:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)

上記のWarningはとりあえず無視します。

Copied title and URL