Skip to content
閲覧中:
build

Emacs の**安定版 (release ブランチ)** を **git から取得して ~/.local にインストール**する手順です。 既存パッケージに影響しないので安全に試せます 👍


前提

Text Only
clone先        : ~/.local/src
install先      : ~/.local

1. 依存パッケージをインストール

Bash
sudo apt update

sudo apt install -y \
git build-essential autoconf texinfo \
libgtk-3-dev libgnutls28-dev libjansson-dev \
libgccjit-13-dev libncurses-dev libxml2-dev \
libtree-sitter-dev libtiff-dev libjpeg-dev \
libpng-dev libgif-dev libxpm-dev \
libwebkit2gtk-4.1-dev

※ ネイティブコンパイル有効 (高速化)


2. clone

Bash
mkdir -p ~/.local/src
cd ~/.local/src

git clone https://github.com/emacs-mirror/emacs.git
cd emacs

3. 安定版ブランチに切替

現在の安定系列(例 30系):

Bash
git checkout emacs-30

安定タグを使う場合:

Bash
git tag | grep emacs-30

4. configure

インストール先を ~/.local に指定

Bash
./autogen.sh

./configure \
--prefix=$HOME/.local \
--with-native-compilation \
--with-tree-sitter \
--with-json \
--with-modules \
--with-x-toolkit=gtk3

5. build

CPUコア数を自動使用:

Bash
make -j$(nproc)

6. install

Bash
make install

7. PATH を追加

Bash
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

8. 動作確認

Bash
emacs --version

例:

Text Only
GNU Emacs 30.x

更新方法

Bash
cd ~/.local/src/emacs
git pull
make -j$(nproc)
make install

アンインストール

Bash
rm -rf ~/.local/src/emacs
rm ~/.local/bin/emacs*
rm -rf ~/.local/share/emacs

希望があれば:

  • 最小構成で高速にビルドする configure
  • pgtk版 (Wayland最適)
  • tree-sitter を強化した構成
  • systemd ユーザーサービス化

も整理します。