「インストール - Fcitx5」の版間の差分

ナビゲーションに移動 検索に移動
329行目: 329行目:
<br>
<br>


==== Bazelの設定ファイルの作成と変更 ====
===== WORKSPACEの編集 =====
src/WORKSPACE.bazelファイルを編集する。<br>
vi src/WORKSPACE.bazel
<br>
* パッケージ管理システムからFcitx5をインストールしている場合
# src/src/WORKSPACE.bazelファイル
# 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",
)
# Fcitx 5
pkg_config_repository(
  name = "fcitx5",
  packages = ["Fcitx5Module", "Fcitx5Core"],
)
<br>
* ソースコードからFcitx5をインストールしている場合
# src/src/WORKSPACE.bazelファイル
# 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",
)
new_local_repository(
  name = "fcitx5",
  path = "/<Fcitx5のインストールディレクトリ>",
  build_file = "BUILD.fcitx5.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>
<u>また、ソースコードからFcitx5をインストールしている場合は、src/BUILD.fcitx5.bazelファイルを作成する。</u><br>
vi src/BUILD.fcitx5.bazel
<br>
# src/BUILD.fcitx5.bazelファイル
package(
    default_visibility = ["//visibility:public"],
)
cc_library(
    name = "fcitx5",
    srcs = glob(["lib64/libFcitx5Core.so*",
                "lib64/libFcitx5Utils.so*",
                "lib64/libFcitx5Config.so*",
                ]),
    hdrs = glob([
        "include/Fcitx5/**",
        "include/Fcitx5/Module/**",
        "include/Fcitx5/Core/**",
        "include/Fcitx5/Config/**",
        "include/Fcitx5/Utils/**",
    ]),
    copts = ["-pthread"],
    includes = [
        "include/Fcitx5/Module",
        "include/Fcitx5/Core",
        "include/Fcitx5/Config",
        "include/Fcitx5/Utils",
    ],
    linkopts = [
        "-lFcitx5Core",
        "-lFcitx5Config",
        "-lFcitx5Utils",
    ],
)
<br>
===== Python 3.6を使用している場合 =====
vi src/base/gen_config_file_stream_data.py
<br>
<syntaxhighlight lang="python">
# src/base/gen_config_file_stream_data.pyファイル
# 68行目あたり
## 編集前
output.write('constexpr FileData kFileData[] = {\n')
for path in path_list:
    output.write('  {"%s", "' % os.path.basename(path))
    with open(path, 'rb') as stream:
      while (byte := stream.read(1)):
          output.write(r'\x' + byte.hex())
    output.write('"},\n')
output.write('};\n')
## 編集後
output.write('constexpr FileData kFileData[] = {\n')
for path in path_list:
    output.write('  {"%s", "' % os.path.basename(path))
    with open(path, 'rb') as stream:
      byte = stream.read(1)
      while (byte):
          output.write(r'\x' + byte.hex())
          byte = stream.read(1)
    output.write('"},\n')
output.write('};\n')
</syntaxhighlight>
<br>
==== Mozcのビルド ====
==== Mozcのビルド ====
Fcitx5-Mozc、Mozcサーバ、Mozcツールをビルドおよびインストールする。<br>
Fcitx5-Mozc、Mozcサーバ、Mozcツールをビルドおよびインストールする。<br>
373行目: 507行目:
<u>必要であれば、src/scripts/install_fcitx5_bazelファイルおよびsrc/scripts/install_server_bazelファイルの内容を参照する。</u><br>
<u>必要であれば、src/scripts/install_fcitx5_bazelファイルおよびsrc/scripts/install_server_bazelファイルの内容を参照する。</u><br>
<br>
<br>
===== Mozcの設定ファイルの作成 =====
==== Mozcの設定ファイルの作成 ====
Mozcのアドオン設定ファイル、および、インプットメソッド設定ファイルを作成する。<br>
Mozcのアドオン設定ファイル、および、インプットメソッド設定ファイルを作成する。<br>
  vi /<Mozcのインストールディレクトリ>/share/fcitx5/addon/mozc.conf
  vi /<Mozcのインストールディレクトリ>/share/fcitx5/addon/mozc.conf

案内メニュー