misc/fcitx5-mozc: Added (Mozc engine for fcitx5).

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
JW(Shinichi Abe) 2022-12-02 13:02:42 +07:00 committed by Willy Sudiarto Raharjo
parent ab354595cf
commit 5360f04319
No known key found for this signature in database
GPG key ID: 3F617144D7238786
11 changed files with 600 additions and 0 deletions

View file

@ -0,0 +1,30 @@
From c3bb9b9aeaf6b19aadd76f4c5a526a9d2a38d35a Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Date: Sun, 27 Dec 2020 22:34:54 +0900
Subject: [PATCH 5/7] Enable verbose build
Description: Enable verboase build
Forwarded: Not need
Last-Update: 2022-05-05
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
---
src/build_mozc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/build_mozc.py b/src/build_mozc.py
index 305784de..fe5cf817 100755
--- a/src/build_mozc.py
+++ b/src/build_mozc.py
@@ -588,7 +588,7 @@ def BuildWithNinja(options, targets):
for target in targets:
(_, target_name) = target.split(':')
- RunOrDie([ninja, '-C', build_arg, target_name])
+ RunOrDie([ninja, '-v', '-C', build_arg, target_name])
def BuildOnWindows(targets):
--
2.36.0

View file

@ -0,0 +1,229 @@
From b9ae4c57de95a7d73640cce5776540d8d841b0c2 Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Date: Fri, 6 May 2022 16:16:30 +0900
Subject: [PATCH] renderer: Convert Gtk2 to Gtk3
Description: renderer: Convert Gtk2 to Gtk3
Forwarded: Not need
Last-Update: 2022-05-07
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
---
src/renderer/mozc_renderer_main.cc | 2 +-
src/renderer/renderer.gyp | 7 +++----
src/renderer/unix/candidate_window.cc | 4 ++--
src/renderer/unix/gtk_wrapper.cc | 4 ++--
src/renderer/unix/infolist_window.cc | 4 ++--
src/renderer/unix/pango_wrapper.cc | 15 +++------------
src/renderer/unix/pango_wrapper.h | 3 +--
src/renderer/unix/text_renderer.cc | 5 ++---
src/renderer/unix/text_renderer.h | 3 +--
src/renderer/unix/text_renderer_interface.h | 2 +-
10 files changed, 18 insertions(+), 31 deletions(-)
diff --git a/src/renderer/mozc_renderer_main.cc b/src/renderer/mozc_renderer_main.cc
index 85a0ae10..3b596d67 100644
--- a/src/renderer/mozc_renderer_main.cc
+++ b/src/renderer/mozc_renderer_main.cc
@@ -80,7 +80,7 @@ int main(int argc, char *argv[]) {
#ifdef OS_WIN
mozc::ScopedCOMInitializer com_initializer;
#elif defined(ENABLE_GTK_RENDERER)
- gtk_set_locale();
+ setlocale(LC_ALL, "");
#if !GLIB_CHECK_VERSION(2, 31, 0)
// There are not g_thread_init function in glib>=2.31.0.
// http://developer.gnome.org/glib/2.31/glib-Deprecated-Thread-APIs.html#g-thread-init
diff --git a/src/renderer/renderer.gyp b/src/renderer/renderer.gyp
index 78eb6a75..34141a4a 100644
--- a/src/renderer/renderer.gyp
+++ b/src/renderer/renderer.gyp
@@ -532,15 +532,14 @@
# Required 'cflags' and 'link_settings' will be automatically
# injected into any target which directly or indirectly depends
# on this target.
- 'target_name': 'gtk2_build_environment',
+ 'target_name': 'gtk3_build_environment',
'type': 'none',
'variables': {
'target_pkgs' : [
'glib-2.0',
'gobject-2.0',
'gthread-2.0',
- 'gtk+-2.0',
- 'gdk-2.0',
+ 'gtk+-3.0',
],
},
'all_dependent_settings': {
@@ -583,7 +582,7 @@
'../ipc/ipc.gyp:ipc',
'../protocol/protocol.gyp:genproto_config_proto#host',
'../protocol/protocol.gyp:renderer_proto',
- 'gtk2_build_environment',
+ 'gtk3_build_environment',
'renderer_server',
'renderer_style_handler',
'table_layout',
diff --git a/src/renderer/unix/candidate_window.cc b/src/renderer/unix/candidate_window.cc
index bb0a346b..287f6871 100644
--- a/src/renderer/unix/candidate_window.cc
+++ b/src/renderer/unix/candidate_window.cc
@@ -85,7 +85,7 @@ CandidateWindow::CandidateWindow(TableLayoutInterface *table_layout,
bool CandidateWindow::OnPaint(GtkWidget *widget, GdkEventExpose *event) {
draw_tool_->Reset(
- cairo_factory_->CreateCairoInstance(GetCanvasWidget()->window));
+ cairo_factory_->CreateCairoInstance(gtk_widget_get_window(GetCanvasWidget())));
DrawBackground();
DrawShortcutBackground();
@@ -263,7 +263,7 @@ void CandidateWindow::DrawFrame() {
}
void CandidateWindow::Initialize() {
- text_renderer_->Initialize(GetCanvasWidget()->window);
+ text_renderer_->Initialize(GetCanvasWidget());
}
void CandidateWindow::UpdateScrollBarSize() {
diff --git a/src/renderer/unix/gtk_wrapper.cc b/src/renderer/unix/gtk_wrapper.cc
index 83d206d7..92c5483f 100644
--- a/src/renderer/unix/gtk_wrapper.cc
+++ b/src/renderer/unix/gtk_wrapper.cc
@@ -49,7 +49,7 @@ void GtkWrapper::GSignalConnect(gpointer instance, const gchar *signal,
}
void GtkWrapper::GtkWidgetHideAll(GtkWidget *widget) {
- gtk_widget_hide_all(widget);
+ gtk_widget_hide(widget);
}
void GtkWrapper::GtkWidgetShowAll(GtkWidget *widget) {
@@ -135,7 +135,7 @@ void GtkWrapper::GtkWidgetRealize(GtkWidget *widget) {
void GtkWrapper::GdkWindowSetTypeHint(GtkWidget *widget,
GdkWindowTypeHint hint) {
- gdk_window_set_type_hint(widget->window, hint);
+ gdk_window_set_type_hint(gtk_widget_get_window(widget), hint);
}
} // namespace gtk
diff --git a/src/renderer/unix/infolist_window.cc b/src/renderer/unix/infolist_window.cc
index 253f9659..f76f4c93 100644
--- a/src/renderer/unix/infolist_window.cc
+++ b/src/renderer/unix/infolist_window.cc
@@ -100,7 +100,7 @@ Rect InfolistWindow::GetCandidateColumnInClientCord() const {
bool InfolistWindow::OnPaint(GtkWidget *widget, GdkEventExpose *event) {
draw_tool_->Reset(
- cairo_factory_->CreateCairoInstance(GetCanvasWidget()->window));
+ cairo_factory_->CreateCairoInstance(gtk_widget_get_window(GetCanvasWidget())));
Draw();
return true;
}
@@ -237,7 +237,7 @@ int InfolistWindow::DrawRow(int row, int ypos) {
}
void InfolistWindow::Initialize() {
- text_renderer_->Initialize(GetCanvasWidget()->window);
+ text_renderer_->Initialize(GetCanvasWidget());
}
void InfolistWindow::ReloadFontConfig(const std::string &font_description) {
diff --git a/src/renderer/unix/pango_wrapper.cc b/src/renderer/unix/pango_wrapper.cc
index 8f87699a..545072a3 100644
--- a/src/renderer/unix/pango_wrapper.cc
+++ b/src/renderer/unix/pango_wrapper.cc
@@ -88,21 +88,12 @@ void PangoWrapper::AttributesUnref(PangoAttrList *attribute) {
PangoContext *PangoWrapper::GetContext() { return context_; }
-PangoWrapper::PangoWrapper(GdkDrawable *drawable) : gc_(gdk_gc_new(drawable)) {
- GdkScreen *screen = gdk_drawable_get_screen(drawable);
- renderer_ = gdk_pango_renderer_new(screen);
- gdk_pango_renderer_set_drawable(GDK_PANGO_RENDERER(renderer_), drawable);
- gdk_pango_renderer_set_gc(GDK_PANGO_RENDERER(renderer_), gc_);
- context_ = gdk_pango_context_get();
+PangoWrapper::PangoWrapper(GtkWidget *window) {
+ context_ = gtk_widget_get_pango_context(window);
}
PangoWrapper::~PangoWrapper() {
- gdk_pango_renderer_set_override_color(GDK_PANGO_RENDERER(renderer_),
- PANGO_RENDER_PART_FOREGROUND, nullptr);
- gdk_pango_renderer_set_drawable(GDK_PANGO_RENDERER(renderer_), nullptr);
- gdk_pango_renderer_set_gc(GDK_PANGO_RENDERER(renderer_), nullptr);
- g_object_unref(gc_);
- g_object_unref(context_);
+ g_object_unref(G_OBJECT(context_));
}
} // namespace gtk
diff --git a/src/renderer/unix/pango_wrapper.h b/src/renderer/unix/pango_wrapper.h
index 7c41cc54..c7c7fb04 100644
--- a/src/renderer/unix/pango_wrapper.h
+++ b/src/renderer/unix/pango_wrapper.h
@@ -57,7 +57,7 @@ class PangoLayoutWrapper : public PangoLayoutWrapperInterface {
class PangoWrapper : public PangoWrapperInterface {
public:
- explicit PangoWrapper(GdkDrawable *drawable);
+ explicit PangoWrapper(GtkWidget *window);
virtual ~PangoWrapper();
virtual void RendererDrawLayout(PangoLayoutWrapperInterface *layout, int x,
int y);
@@ -68,7 +68,6 @@ class PangoWrapper : public PangoWrapperInterface {
private:
PangoRenderer *renderer_;
PangoContext *context_;
- GdkGC *gc_;
DISALLOW_COPY_AND_ASSIGN(PangoWrapper);
};
} // namespace gtk
diff --git a/src/renderer/unix/text_renderer.cc b/src/renderer/unix/text_renderer.cc
index 164f01bc..4ba96ea2 100644
--- a/src/renderer/unix/text_renderer.cc
+++ b/src/renderer/unix/text_renderer.cc
@@ -39,9 +39,8 @@ namespace gtk {
TextRenderer::TextRenderer(FontSpecInterface *font_spec)
: font_spec_(font_spec), pango_(nullptr) {}
-
-void TextRenderer::Initialize(GdkDrawable *drawable) {
- pango_.reset(new PangoWrapper(drawable));
+void TextRenderer::Initialize(GtkWidget *window) {
+ pango_.reset(new PangoWrapper(window));
}
void TextRenderer::SetUpPangoLayout(const std::string &str,
diff --git a/src/renderer/unix/text_renderer.h b/src/renderer/unix/text_renderer.h
index c4cd2430..ba36b052 100644
--- a/src/renderer/unix/text_renderer.h
+++ b/src/renderer/unix/text_renderer.h
@@ -50,8 +50,7 @@ class TextRenderer : public TextRendererInterface {
public:
explicit TextRenderer(FontSpecInterface *font_spec);
virtual ~TextRenderer() {}
-
- virtual void Initialize(GdkDrawable *drawable);
+ virtual void Initialize(GtkWidget *window);
virtual Size GetPixelSize(FontSpecInterface::FONT_TYPE font_type,
const std::string &str);
virtual Size GetMultiLinePixelSize(FontSpecInterface::FONT_TYPE font_type,
diff --git a/src/renderer/unix/text_renderer_interface.h b/src/renderer/unix/text_renderer_interface.h
index db823217..9c569f6a 100644
--- a/src/renderer/unix/text_renderer_interface.h
+++ b/src/renderer/unix/text_renderer_interface.h
@@ -44,7 +44,7 @@ class TextRendererInterface {
TextRendererInterface() {}
virtual ~TextRendererInterface() {}
- virtual void Initialize(GdkDrawable *drawable) = 0;
+ virtual void Initialize(GtkWidget *window) = 0;
// Returns boundary rectangle size of actual rendered text.
virtual Size GetPixelSize(FontSpecInterface::FONT_TYPE font_type,
const std::string &str) = 0;
--
2.36.0

View file

@ -0,0 +1,11 @@
diff --color -rupN mozc.orig/src/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc mozc/src/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc
--- mozc.orig/src/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc 2021-03-15 22:29:19.136624465 +0800
+++ mozc/src/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc 2021-03-15 22:29:50.682448271 +0800
@@ -37,6 +37,7 @@
#include <algorithm>
#include <array>
+#include <limits>
#include "absl/base/internal/hide_ptr.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/internal/spinlock.h"

View file

@ -0,0 +1,12 @@
diff --git a/src/gyp/common.gypi b/src/gyp/common.gypi
index 0635068..dd8043e 100644
--- a/src/gyp/common.gypi
+++ b/src/gyp/common.gypi
@@ -105,7 +105,6 @@
],
# Libraries for GNU/Linux environment.
'linux_ldflags': [
- '-lc++',
'-pthread',
],

View file

@ -0,0 +1,27 @@
Index: b/gyp/common.gypi
===================================================================
--- a/gyp/common.gypi
+++ b/gyp/common.gypi
@@ -128,9 +128,9 @@
'compiler_host_version_int': 304, # Clang 3.4 or higher
}],
['target_platform=="Linux"', {
- 'compiler_target': 'clang',
+ 'compiler_target': 'gcc',
'compiler_target_version_int': 304, # Clang 3.4 or higher
- 'compiler_host': 'clang',
+ 'compiler_host': 'gcc',
'compiler_host_version_int': 304, # Clang 3.4 or higher
}],
],
@@ -445,8 +445,8 @@
['target_platform=="Linux"', {
'make_global_settings': [
['AR', '<!(which ar)'],
- ['CC', '<!(which clang)'],
- ['CXX', '<!(which clang++)'],
+ ['CC', '<!(which gcc)'],
+ ['CXX', '<!(which g++)'],
['LD', '<!(which ld)'],
['NM', '<!(which nm)'],
['READELF', '<!(which readelf)'],

17
misc/fcitx5-mozc/README Normal file
View file

@ -0,0 +1,17 @@
Fcitx5-mozc is Mozc engine for fcitx5.
Mozc is a Japanese Input Method Editor (IME) designed for multi-platform
What's Mozc?
For historical reasons, the project name Mozc has two different meanings
Internal code name of Google Japanese Input that is still commonly used
inside Google.
Project name to release a subset of Google Japanese Input in the form of
source code under OSS license without any warranty nor user support.
In this repository, Mozc means the second definition unless otherwise
noted.
Detailed differences between Google Japanese Input and Mozc are
described in About Branding.
( https://github.com/fcitx/mozc/blob/fcitx/docs/about_branding.md )

View file

@ -0,0 +1,5 @@
# for emacs, create {HOME}/.emacs.d/init.el with followng lines
(require 'mozc) ; or (load-file "/path/to/mozc.el")
(setq default-input-method "japanese-mozc")
(setq mozc-candidate-style 'overlay)

View file

@ -0,0 +1,216 @@
#!/bin/bash
# Slackware build script for bazel
# Copyright 2022 Isaac Yu <isaacyu1@isaacyu1.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''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 AUTHOR 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.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=fcitx5-mozc
VERSION=${VERSION:-2.26.4360.102.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
BLDBASEDIR=$TMP/$PRGNAM-$VERSION
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
BLDTYPE=Release
_bldtype=Release
# source rev. and version.
MOZC_REV=ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce
GYP_REV=caa60026e223fc501e8b337fd5086ece4028b1c6
PROTOBUF_REV=fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a
ABSEIL_CPP_REV=0f3bb466b868b523cf1dc9b2aaaed65c77b28862
BREAKPAD_REV=2022.07.12
GOOGLETEST_REV=703bd9caab50b139428cea1aaff9974ebee5742e
JSONCPP_REV=42e892d96e47b1f6e29844cc705e148ec4856448
JAPANESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684
ZIPCODE_REL=202110
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir -p $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
echo "prepare source file..."
# unzip packages
unzip $CWD/mozc-$MOZC_REV.zip
unzip $CWD/gyp-$GYP_REV.zip
unzip $CWD/protobuf-$PROTOBUF_REV.zip
unzip $CWD/abseil-cpp-$ABSEIL_CPP_REV.zip
unzip $CWD/breakpad-${BREAKPAD_REV}.zip
unzip $CWD/googletest-$GOOGLETEST_REV.zip
unzip $CWD/jsoncpp-$JSONCPP_REV.zip
unzip $CWD/japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV.zip
unzip $CWD/jigyosyo-$ZIPCODE_REL.zip
unzip $CWD/x-ken-all-$ZIPCODE_REL.zip
# extact tar file
tar -xvf ${CWD}/fcitx-mozc-icon.tar.gz
# rename directory
mv mozc-$MOZC_REV mozc
mv gyp-$GYP_REV gyp
mv protobuf-$PROTOBUF_REV protobuf
mv abseil-cpp-$ABSEIL_CPP_REV abseil-cpp
mv breakpad-$BREAKPAD_REV breakpad
mv googletest-$GOOGLETEST_REV googletest
mv jsoncpp-$JSONCPP_REV jsoncpp
mv japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV japanese_usage_dictionary
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
cd $BLDBASEDIR/mozc
# prepare zip code dictionary
unzip -d src/data/dictionary_oss $CWD/jigyosyo-$ZIPCODE_REL.zip
unzip -d src/data/dictionary_oss $CWD/x-ken-all-$ZIPCODE_REL.zip
cd src/dictionary
# Generate zip code seed
sed -i "s/from dictionary import zip_code_util/import zip_code_util/g" gen_zip_code_seed.py
cd ../data/dictionary_oss
echo "Generating zip code seed ..."
python3 ../../dictionary/gen_zip_code_seed.py --zip_code=x-ken-all.csv --jigyosyo=JIGYOSYO.CSV >> dictionary09.txt
echo "Done."
cd $BLDBASEDIR/mozc/scripts
# Use python3 instead of python in slackware
sed 's/python/python3/g' -i build
# fix libdir path of fcitx5-mozc.so for Slackware
sed 's/lib/lib64/g' -i install_fcitx5
cd ../src
# We won't need fcitx4 (disable fcitx4 target)
rm unix/fcitx/fcitx.gyp
cd ../../
# Copy third party deps
echo "Copy third party deps ..."
for dep in abseil-cpp breakpad googletest jsoncpp gyp protobuf japanese_usage_dictionary
do
cp -a $dep mozc/src/third_party/
done
cd $BLDBASEDIR/mozc/
# Enable verbose build
echo "... Apply 0005-Enable-verbose-build.patch"
patch -p1 < $CWD/0005-Enable-verbose-build.patch
# Use Gtk3 instead of Gtk2
echo "... Apply 0008-renderer-Convert-Gtk2-to-Gtk3.patch"
patch -p1 < $CWD/0008-renderer-Convert-Gtk2-to-Gtk3.patch
# Fix build with gcc-11
echo "... Apply 0010-fix-build-gcc11.patch"
patch -p1 < $CWD/0010-fix-build-gcc11.patch
# Buil with libstdc++
echo "... Apply 0011-build-with-libstdc++.patch"
patch -p1 < $CWD/0011-build-with-libstdc++.patch
cd src/
# Build with gcc instead of clang
echo "... Apply 0012-mozc-build-gcc.patch"
patch -p1 < $CWD/0012-mozc-build-gcc.patch
# Fix compatibility with google-glog 0.3.3 (symbol conflict)
CFLAGS="${CFLAGS} -fvisibility=hidden"
CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
# build package with gyp
echo "build package..."
_buildtype=Release
TARGETS="unix/emacs/emacs.gyp:mozc_emacs_helper server/server.gyp:mozc_server gui/gui.gyp:mozc_tool unix/fcitx5/fcitx5.gyp:fcitx5-mozc"
_targets="unix/emacs/emacs.gyp:mozc_emacs_helper server/server.gyp:mozc_server gui/gui.gyp:mozc_tool unix/fcitx5/fcitx5.gyp:fcitx5-mozc"
sed -i 's|python|python3|' ../scripts/build_fcitx5
QT_BASE_PATH=/usr/include/qt5 QTDIR=/usr GYP_DEFINES="document_dir=/usr/share/licenses/$PRGNAM use_libzinnia=1" python3 build_mozc.py gyp
python3 build_mozc.py build -c $_bldtype $_targets
# Extract license part of mozc
head -n 29 server/mozc_server.cc > LICENSE
export PREFIX="$PKG/usr"
export _bldtype
bash ../scripts/install_server
install -d "$PKG/usr/share/licenses/$PRGNAM/"
install -m 644 LICENSE data/installer/*.html "$PKG/usr/share/licenses/$PRGNAM/"
install -d "${PREFIX}/share/fcitx5/addon"
install -d "${PREFIX}/share/fcitx5/inputmethod"
install -d "${PREFIX}/lib64/fcitx5"
bash ../scripts/install_fcitx5
# Install emacs_helper
install -Dm644 ../LICENSE $PKG/usr/share/licenses/emacs-mozc/LICENSE
install -Dm644 data/installer/credits_en.html $PKG/usr/share/licenses/emacs-mozc/credits_en.html
install -Dm755 out_linux/Release/mozc_emacs_helper $PKG/usr/bin/mozc_emacs_helper
install -Dm644 unix/emacs/mozc.el $PKG/usr/share/emacs/site-lisp/mozc.el
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp $CWD/init.el_mozc $CWD/README.emacs $PKG/usr/doc/$PRGNAM-$VERSION/
cp $CWD/*.patch $PKG/usr/doc/$PRGNAM-$VERSION/
cp $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
# install slack-desc
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE

View file

@ -0,0 +1,30 @@
PRGNAM="fcitx5-mozc"
VERSION="2.26.4360.102.1"
HOMEPAGE="https://github.com/fcitx/mozc/"
DOWNLOAD="https://github.com/fcitx/mozc/archive/ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce/mozc-ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce.zip \
https://github.com/chromium/gyp/archive/caa60026e223fc501e8b337fd5086ece4028b1c6/gyp-caa60026e223fc501e8b337fd5086ece4028b1c6.zip \
https://github.com/protocolbuffers/protobuf/archive/fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a/protobuf-fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a.zip \
https://github.com/abseil/abseil-cpp/archive/0f3bb466b868b523cf1dc9b2aaaed65c77b28862/abseil-cpp-0f3bb466b868b523cf1dc9b2aaaed65c77b28862.zip \
https://github.com/google/breakpad/archive/v2022.07.12/breakpad-2022.07.12.zip \
https://github.com/google/googletest/archive/703bd9caab50b139428cea1aaff9974ebee5742e/googletest-703bd9caab50b139428cea1aaff9974ebee5742e.zip \
https://github.com/open-source-parsers/jsoncpp/archive/42e892d96e47b1f6e29844cc705e148ec4856448/jsoncpp-42e892d96e47b1f6e29844cc705e148ec4856448.zip \
https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/e5b3425575734c323e1d947009dd74709437b684/japanese-usage-dictionary-e5b3425575734c323e1d947009dd74709437b684.zip \
https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-202110.zip \
https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-202110.zip \
https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz"
MD5SUM="257fcb244249a3c65c576cceb5cbb7c8 \
699c5af5c6d7e19835afb5292d151f91 \
cb4b1baed208474284161b7abd5cc17c \
4f23c5fcb19a7ef0fb6ce0f636d480e3 \
981e935b3b61091ca6f968a296f44eb9 \
768da4173ee9df3248b8f828747982ad \
b56b146335d7c296ddef5a88235f1438 \
a6eb1da9ad7ceffcb9683003332abf7e \
35031b342c827861681081e4052b472b \
a4b62ae420004b55a72fe6a40bb09ee1 \
80fe2ef127b70649df22d133822ac8a7"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="fcitx5 bazel"
MAINTAINER="JW(Shinichi Abe)"
EMAIL="shin1.abe@nifty.com"

View file

@ -0,0 +1,4 @@
(set-language-environment "Japanese")
(require 'mozc) ; or (load-file "/usr/share/emacs/site-lisp/emacs-mozc/mozc.el")
(setq default-input-method "japanese-mozc")
(setq mozc-candidate-style 'overlay)

View file

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
fcitx5-mozc: fcitx5-mozc (Mozc engine for fcitx5)
fcitx5-mozc:
fcitx5-mozc: fcitx5-mozc is Mozc, Japanese input method editor, engine for fcitx5.
fcitx5-mozc:
fcitx5-mozc: Homepage: https://fcitx-im.org
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc:
fcitx5-mozc: