13,002
回編集
91行目: | 91行目: | ||
* src/WORKSPACE.bazel | * src/WORKSPACE.bazel | ||
*: ビルドの依存関係。 | *: ビルドの依存関係。 | ||
<br> | |||
==== インストールディレクトリの設定 ==== | |||
必要ならば、srcディレクトリにあるconfig.bzlファイルを編集して、インストールディレクトリを変更する。<br> | |||
vi mozc/src/config.bzl | |||
<br> | |||
# mozc/src/config.bzlファイル | |||
LINUX_MOZC_BROWSER_COMMAND = "/usr/bin/xdg-open" | |||
LINUX_MOZC_ICONS_DIR = "/<Mozcのインストールディクトリ>/share/icons/mozc" | |||
LINUX_MOZC_SERVER_DIR = "/<Mozcのインストールディクトリ>/lib/mozc" | |||
LINUX_MOZC_DOCUMENT_DIR = LINUX_MOZC_SERVER_DIR + "/documents" | |||
IBUS_COMPONENT_DIR = "/<Mozcのインストールディクトリ>/share/ibus/component" | |||
IBUS_MOZC_INSTALL_DIR = "/<Mozcのインストールディクトリ>/share/ibus-mozc" | |||
IBUS_MOZC_ICON_PATH = IBUS_MOZC_INSTALL_DIR + "/product_icon.png" | |||
IBUS_MOZC_PATH = "/<Mozcのインストールディクトリ>/lib/ibus-mozc/ibus-engine-mozc" | |||
EMACS_MOZC_CLIENT_DIR = "/<Mozcのインストールディクトリ>/share/emacs/site-lisp/emacs-mozc" | |||
EMACS_MOZC_HELPER_DIR = "/<Mozcのインストールディクトリ>/bin" | |||
<br> | |||
==== Bazelの設定ファイルの作成と変更 ==== | |||
===== WORKSPACEの編集 ===== | |||
src/WORKSPACE.bazelファイルを編集して、以下に示す設定を追記する。<br> | |||
vi src/WORKSPACE.bazel | |||
<br> | |||
* パッケージ管理システムからFcitxをインストールしている場合 | |||
# src/WORKSPACE.bazelファイル | |||
## 138行目あたり | |||
# Fcitx | |||
# pkg_config_repository does not work because pkgconfig --cflags-only-I fcitx returns nothing | |||
new_local_repository( | |||
name = "fcitx", | |||
# This path should be updated per the environment. | |||
path = "/usr", # For Debian | |||
build_file = "BUILD.fcitx.bazel", | |||
) | |||
<br> | |||
* ソースコードからFcitxをインストールしている場合 | |||
# src/WORKSPACE.bazelファイル | |||
## 138行目あたり | |||
# Fcitx | |||
new_local_repository( | |||
name = "fcitx", | |||
path = "/<Fcitxのインストールディレクトリ>", | |||
build_file = "BUILD.fcitx.bazel", | |||
) | |||
<br> | |||
src/BUILD.fcitx.bazelファイルを作成する。<br> | |||
vi src/BUILD.fcitx.bazel | |||
<br> | |||
# src/BUILD.fcitx.bazelファイル | |||
package( | |||
default_visibility = ["//visibility:public"], | |||
) | |||
cc_library( | |||
name = "fcitx", | |||
hdrs = glob([ | |||
"include/fcitx/**", | |||
"include/fcitx-config/**", | |||
"include/fcitx-utils/**", | |||
]), | |||
copts = ["-pthread"], | |||
includes = [ | |||
"include", | |||
], | |||
linkopts = [ | |||
"-lfcitx-core", | |||
"-lfcitx-config", | |||
"-lfcitx-utils", | |||
], | |||
) | |||
<br> | <br> | ||