diff options
-rw-r--r-- | .SRCINFO | 27 | ||||
-rw-r--r-- | BUILD.bazel | 83 | ||||
-rw-r--r-- | PKGBUILD | 65 | ||||
-rw-r--r-- | bazel.patch | 27 | ||||
-rw-r--r-- | mozc.patch | 79 |
5 files changed, 229 insertions, 52 deletions
@@ -1,26 +1,27 @@ -# Generated by mksrcinfo v8 -# 木 5月 31 12:31:25 UTC 2018 pkgbase = uim-mozc pkgdesc = uim plugin module for Mozc - pkgver = 2.23.2815.102 - pkgrel = 2 - url = http://code.google.com/p/macuim/ + pkgver = 2.30.5432.102 + pkgrel = 1 + url = https://github.com/e-kato/macuim install = uim-mozc.install arch = i686 arch = x86_64 groups = mozc-im license = BSD - makedepends = pkg-config - makedepends = python2 + makedepends = bazel makedepends = git - makedepends = ninja - makedepends = clang - depends = mozc + makedepends = python + depends = mozc>=2.30.5432.102 depends = uim - source = mozc::git+https://github.com/google/mozc.git#commit=afb03ddfe72dde4cf2409863a3bfea160f7a66d8 - source = uim-mozc::git+https://github.com/e-kato/macuim.git#commit=c979f127acaeb7b35d3344e8b1e40848e1a68d54 + source = mozc::git+https://github.com/google/mozc.git#commit=548e7c3e5a0bedbf98daf634732062f7e8e47b4b + source = uim-mozc::git+https://github.com/e-kato/macuim.git#commit=7beac7ba000e0459a4dc933f3873b521664d2665 + source = bazel.patch + source = mozc.patch + source = BUILD.bazel sha1sums = SKIP sha1sums = SKIP + sha1sums = 7547e5cae4df8b516580c882bc975d8a70251db1 + sha1sums = 44fe1eac88f560b63b09f46f9bf556582c12a2ef + sha1sums = ec966e854038f3175266370d6b1fbd2a78b4f5a7 pkgname = uim-mozc - diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 000000000000..6ada5b312d29 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,83 @@ +# Copyright 2010-2021, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Visibility: please choose a more appropriate default for the package, +# and update any rules that should be different. + +load( + "//:build_defs.bzl", + "mozc_cc_binary", + "mozc_cc_library", +) + +mozc_cc_library( + name = "uim_header", + deps = ["@uim//:uim"], +) + +mozc_cc_library( + name = "uim_mozc_key_lib", + linkstatic = True, + srcs = [ + "key_translator.cc", + ], + hdrs = [ + "key_translator.h", + ], + deps = [ + ":uim_header", + "//base:port", + "//base:vlog", + "//base:util", + "//client", + "//protocol:commands_cc_proto", + ], +) + + +cc_library( + name = "uim_mozc_lib", + srcs = ["mozc.cc"], + deps = [ + ":uim_header", + ":uim_mozc_key_lib", + "//base:init_mozc", + "//base:util", + "//base:version", + "//client", + "//protocol:commands_cc_proto", + "@uim//:uim", + "@com_google_protobuf//:protobuf", + ], +) + +cc_shared_library( + name = "uim-mozc", + roots = ["uim_mozc_lib"], +) @@ -1,82 +1,69 @@ -# Maintainer: ponsfoot <cabezon dot hashimoto at gmail dot com> +# Maintainer: phenylshima <phenylshima at outlook dot com> +# Contributor: ponsfoot <cabezon dot hashimoto at gmail dot com> ## NOTE: This doens't support kill_line feature of uim. -## Mozc compile option -_bldtype=Release -#_bldtype=Debug +# renovate: aur-sync depName=mozc fcae900e2962313a3ceaf65f569c59ca4dd98e18 -_uimmozcrev=c979f127acaeb7b35d3344e8b1e40848e1a68d54 -_mozcrev=afb03ddfe72dde4cf2409863a3bfea160f7a66d8 +_uimmozcrev="7beac7ba000e0459a4dc933f3873b521664d2665" +_mozcrev="548e7c3e5a0bedbf98daf634732062f7e8e47b4b" pkgname=uim-mozc _pkgname=mozc -pkgver=2.23.2815.102 -pkgrel=2 +pkgver=2.30.5432.102 +pkgrel=1 pkgdesc="uim plugin module for Mozc" arch=('i686' 'x86_64') -url="http://code.google.com/p/macuim/" +url="https://github.com/e-kato/macuim" license=('BSD') groups=('mozc-im') -depends=('mozc' 'uim') +depends=('mozc>=2.30.5432.102' 'uim') install=${pkgname}.install -makedepends=('pkg-config' 'python2' 'git' 'ninja' 'clang') +makedepends=('bazel' 'git' 'python') source=( mozc::git+https://github.com/google/mozc.git#commit=${_mozcrev} uim-mozc::git+https://github.com/e-kato/macuim.git#commit=${_uimmozcrev} + 'bazel.patch' + 'mozc.patch' + 'BUILD.bazel' ) sha1sums=('SKIP' - 'SKIP') - - -pkgver() { - . "${srcdir}/mozc/src/data/version/mozc_version_template.bzl" - printf "%s.%s.%s.%s" $MAJOR $MINOR $BUILD $REVISION -} - + 'SKIP' + '7547e5cae4df8b516580c882bc975d8a70251db1' + '44fe1eac88f560b63b09f46f9bf556582c12a2ef' + 'ec966e854038f3175266370d6b1fbd2a78b4f5a7') prepare() { - cd "$srcdir" - ln -sf `which python2` ./python - PATH="${srcdir}:${PATH}" - cd "${srcdir}/${_pkgname}/" git submodule update --init --recursive + patch -p1 -i "${srcdir}/bazel.patch" cd "${srcdir}/${_pkgname}/src" - # uim-mozc cp -rf "${srcdir}/uim-mozc/Mozc/uim" unix/ + patch -p1 -i "${srcdir}/mozc.patch" + + cp -rf "${srcdir}/BUILD.bazel" unix/uim + # Extract license part of uim-mozc head -n 32 unix/uim/mozc.cc > unix/uim/LICENSE - - # sed -i.bak \ - # -e 's/make_pair/std::make_pair/g' \ - # unix/uim/key_translator.cc \ - # unix/uim/mozc.cc - # sed -i.bak \ - # -e 's/typedef map</typedef std::map</g' \ - # -e 's/ pair</ std::pair</g' \ - # unix/uim/key_translator.h } build() { - cd "${srcdir}/${_pkgname}/src" msg "Starting make..." - unset CC CC_host CC_target CXX CXX_host CXX_target LINK AR AR_host AR_target \ - NM NM_host NM_target READELF READELF_host READELF_target - python2 build_mozc.py gyp --target_platform=Linux - python2 build_mozc.py build -c $_bldtype unix/uim/uim.gyp:uim-mozc + unset ANDROID_NDK_HOME + export JAVA_HOME='/usr/lib/jvm/java-11-openjdk/' + bazel build unix/uim:uim-mozc unix/icons --config oss_linux --compilation_mode opt --experimental_cc_shared_library } package() { cd "${srcdir}/${_pkgname}/src" - install -D -m 755 out_linux/${_bldtype}/libuim-mozc.so "${pkgdir}/usr/lib/uim/plugin/libuim-mozc.so" + install -D -m 755 bazel-bin/unix/uim/libuim-mozc.so "${pkgdir}/usr/lib/uim/plugin/libuim-mozc.so" install -d "${pkgdir}/usr/share/uim" install -m 644 ${srcdir}/uim-mozc/Mozc/scm/*.scm "${pkgdir}/usr/share/uim/" install -D -m 644 data/images/unix/ime_product_icon_opensource-32.png "${pkgdir}/usr/share/uim/pixmaps/mozc.png" diff --git a/bazel.patch b/bazel.patch new file mode 100644 index 000000000000..4de2dc38efdb --- /dev/null +++ b/bazel.patch @@ -0,0 +1,27 @@ +diff --git a/src/WORKSPACE.bazel b/src/WORKSPACE.bazel +index 1a422b31..6b64f117 100644 +--- a/src/WORKSPACE.bazel ++++ b/src/WORKSPACE.bazel +@@ -70,6 +70,12 @@ pkg_config_repository( + packages = ["glib-2.0", "gobject-2.0", "ibus-1.0"], + ) + ++# uim ++pkg_config_repository( ++ name = "uim", ++ packages = ["uim"], ++) ++ + # Japanese Usage Dictionary + new_local_repository( + name = "ja_usage_dict", +diff --git a/src/unix/BUILD.bazel b/src/unix/BUILD.bazel +index b69ce0bb..c986e891 100644 +--- a/src/unix/BUILD.bazel ++++ b/src/unix/BUILD.bazel +@@ -113,3 +113,5 @@ mozc_py_binary( + name = "build_package", + srcs = ["build_package.py"], + ) ++ ++exports_files(["uim"]) diff --git a/mozc.patch b/mozc.patch new file mode 100644 index 000000000000..179aa188511d --- /dev/null +++ b/mozc.patch @@ -0,0 +1,79 @@ +--- src.orig/unix/uim/key_translator.h ++++ src/unix/uim/key_translator.h +@@ -38,8 +38,13 @@ + using __gnu_cxx::hash_map; + + #include "base/port.h" ++#include "base/vlog.h" + #include "protocol/commands.pb.h" + ++using std::string; ++typedef uint64_t uint64; ++typedef int32_t int32; ++ + namespace mozc { + namespace uim { + +@@ -49,6 +54,8 @@ + class KeyTranslator { + public: + KeyTranslator(); ++ KeyTranslator(const KeyTranslator&) = delete; ++ KeyTranslator& operator=(const KeyTranslator&) = delete; + virtual ~KeyTranslator(); + + // Converts ibus keycode to Mozc key code and stores them on |out_event|. +@@ -101,8 +108,6 @@ + // 'Hiragana Letter Small U' (with Shift modifier). + KanaMap kana_map_jp_; // mapping for JP keyboard. + KanaMap kana_map_us_; // mapping for US keyboard. +- +- DISALLOW_COPY_AND_ASSIGN(KeyTranslator); + }; + + } // namespace uim +--- src.orig/unix/uim/key_translator.cc ++++ src/unix/uim/key_translator.cc +@@ -344,7 +344,7 @@ + /* regards yen key as backslash */ + out_event->set_key_code('\\'); + } else { +- VLOG(1) << "Unknown keyval: " << keyval; ++ MOZC_VLOG(1) << "Unknown keyval: " << keyval; + return false; + } + +@@ -367,28 +367,28 @@ + } + + void KeyTranslator::Init() { +- for (int i = 0; i < arraysize(special_key_map); ++i) { ++ for (int i = 0; i < std::size(special_key_map); ++i) { + CHECK(special_key_map_.insert( + std::make_pair(special_key_map[i].from, + special_key_map[i].to)).second); + } +- for (int i = 0; i < arraysize(modifier_key_map); ++i) { ++ for (int i = 0; i < std::size(modifier_key_map); ++i) { + CHECK(modifier_key_map_.insert( + std::make_pair(modifier_key_map[i].from, + modifier_key_map[i].to)).second); + } +- for (int i = 0; i < arraysize(modifier_mask_map); ++i) { ++ for (int i = 0; i < std::size(modifier_mask_map); ++i) { + CHECK(modifier_mask_map_.insert( + std::make_pair(modifier_mask_map[i].from, + modifier_mask_map[i].to)).second); + } +- for (int i = 0; i < arraysize(kana_map_jp); ++i) { ++ for (int i = 0; i < std::size(kana_map_jp); ++i) { + CHECK(kana_map_jp_.insert( + std::make_pair(kana_map_jp[i].code, + std::make_pair(kana_map_jp[i].no_shift, + kana_map_jp[i].shift))).second); + } +- for (int i = 0; i < arraysize(kana_map_us); ++i) { ++ for (int i = 0; i < std::size(kana_map_us); ++i) { + CHECK(kana_map_us_.insert( + std::make_pair(kana_map_us[i].code, + std::make_pair(kana_map_us[i].no_shift, |