Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP] mozc: update to 2.26.4346.100. (new package for fcitx5-mozc)
@ 2021-04-25 15:55 sgn
  2021-04-27  1:26 ` [PR PATCH] [Updated] " sgn
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: sgn @ 2021-04-25 15:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1624 bytes --]

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages fcitx5-mozc
https://github.com/void-linux/void-packages/pull/30492

[WIP] mozc: update to 2.26.4346.100. (new package for fcitx5-mozc)
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/30492.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-fcitx5-mozc-30492.patch --]
[-- Type: text/x-diff, Size: 10130 bytes --]

From c0e57a08962d505e478c2b22c660e44d748b36cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Sun, 25 Apr 2021 22:53:14 +0700
Subject: [PATCH] mozc: update to 2.26.4346.100.

---
 srcpkgs/fcitx5-mozc                  |  1 +
 srcpkgs/mozc/patches/fcitx.patch     | 13 +++++
 srcpkgs/mozc/patches/fcitx5.patch    | 41 ++++++++++++++
 srcpkgs/mozc/patches/reiwa-era.patch | 13 +++++
 srcpkgs/mozc/patches/standard.patch  | 16 ++++++
 srcpkgs/mozc/template                | 82 +++++++++++++++++-----------
 6 files changed, 135 insertions(+), 31 deletions(-)
 create mode 120000 srcpkgs/fcitx5-mozc
 create mode 100644 srcpkgs/mozc/patches/fcitx.patch
 create mode 100644 srcpkgs/mozc/patches/fcitx5.patch
 create mode 100644 srcpkgs/mozc/patches/reiwa-era.patch
 create mode 100644 srcpkgs/mozc/patches/standard.patch

diff --git a/srcpkgs/fcitx5-mozc b/srcpkgs/fcitx5-mozc
new file mode 120000
index 000000000000..6874ca426b5f
--- /dev/null
+++ b/srcpkgs/fcitx5-mozc
@@ -0,0 +1 @@
+mozc
\ No newline at end of file
diff --git a/srcpkgs/mozc/patches/fcitx.patch b/srcpkgs/mozc/patches/fcitx.patch
new file mode 100644
index 000000000000..1ed6d01516f5
--- /dev/null
+++ b/srcpkgs/mozc/patches/fcitx.patch
@@ -0,0 +1,13 @@
+Index: mozc/src/unix/fcitx/fcitx.gyp
+===================================================================
+--- mozc/src/unix/fcitx/fcitx.gyp.orig
++++ mozc/src/unix/fcitx/fcitx.gyp
+@@ -96,7 +96,7 @@
+         '<@(fcitx_dep_include_dirs)',
+       ],
+       'defines': [
+-        'LOCALEDIR="<!@(fcitx4-config --prefix)/share/locale/"',
++        'LOCALEDIR="/usr/share/locale/"',
+       ],
+     },
+   ],
diff --git a/srcpkgs/mozc/patches/fcitx5.patch b/srcpkgs/mozc/patches/fcitx5.patch
new file mode 100644
index 000000000000..388a6de0ae55
--- /dev/null
+++ b/srcpkgs/mozc/patches/fcitx5.patch
@@ -0,0 +1,41 @@
+Index: mozc/src/unix/fcitx5/mozc_response_parser.cc
+===================================================================
+--- mozc/src/unix/fcitx5/mozc_response_parser.cc.orig
++++ mozc/src/unix/fcitx5/mozc_response_parser.cc
+@@ -169,9 +169,9 @@ class MozcCandidateList final : public C
+     return labels_[idx];
+   }
+ 
+-  std::shared_ptr<const CandidateWord> candidate(int idx) const override {
++  const CandidateWord& candidate(int idx) const override {
+     checkIndex(idx);
+-    return candidateWords_[idx];
++    return *candidateWords_[idx];
+   }
+   int size() const override { return candidateWords_.size(); }
+ 
+Index: mozc/src/unix/fcitx5/mozc_state.cc
+===================================================================
+--- mozc/src/unix/fcitx5/mozc_state.cc.orig
++++ mozc/src/unix/fcitx5/mozc_state.cc
+@@ -241,7 +241,7 @@ bool MozcState::ProcessKeyEvent(KeySym s
+ 
+     if (normalized_key.check(Key(FcitxKey_Escape))) {
+       displayUsage_ = false;
+-      ProcessKeyEvent(FcitxKey_VoidSymbol, 0, KeyState::None, layout_is_jp,
++      ProcessKeyEvent(FcitxKey_VoidSymbol, 0, KeyState::NoState, layout_is_jp,
+                       false);
+     }
+     return true;
+Index: mozc/src/unix/fcitx5/mozc.conf
+===================================================================
+--- mozc/src/unix/fcitx5/mozc.conf.orig
++++ mozc/src/unix/fcitx5/mozc.conf
+@@ -1,6 +1,6 @@
+ [InputMethod]
+ Name=Mozc
+-Icon=PREFIX/share/fcitx5/mozc/icon/mozc.png
++Icon=/usr/share/fcitx5/mozc/icon/mozc.png
+ Label=あ
+ LangCode=ja
+ Addon=mozc
diff --git a/srcpkgs/mozc/patches/reiwa-era.patch b/srcpkgs/mozc/patches/reiwa-era.patch
new file mode 100644
index 000000000000..ad9eb4444e0c
--- /dev/null
+++ b/srcpkgs/mozc/patches/reiwa-era.patch
@@ -0,0 +1,13 @@
+Index: mozc/src/data/dictionary_oss/dictionary08.txt
+===================================================================
+--- mozc/src/data/dictionary_oss/dictionary08.txt.orig
++++ mozc/src/data/dictionary_oss/dictionary08.txt
+@@ -8591,6 +8591,8 @@
+ れいれいと	12	12	7349	れいれいと
+ れいろう	1847	1847	7276	玲瓏
+ れいわ	1847	1847	8251	例話
++れいわ	1895	1895	1690	令和
++れいわ	1898	1898	4000	令和
+ れいんこーと	1847	1847	5568	レインコート
+ れいんじゃー	1847	1847	7459	レインジャー
+ れいんず	1917	1917	3548	レインズ
diff --git a/srcpkgs/mozc/patches/standard.patch b/srcpkgs/mozc/patches/standard.patch
new file mode 100644
index 000000000000..ca002e8b9854
--- /dev/null
+++ b/srcpkgs/mozc/patches/standard.patch
@@ -0,0 +1,16 @@
+Index: mozc/src/unix/fcitx5/fcitx5.gyp
+===================================================================
+--- mozc/src/unix/fcitx5/fcitx5.gyp.orig
++++ mozc/src/unix/fcitx5/fcitx5.gyp
+@@ -112,10 +112,10 @@
+         'fcitx5_build_environment',
+       ],
+       'cflags_cc': [
+-        '-std=c++14',
++        '-std=c++17',
+       ],
+       'cflags_cc!': [
+         '-std=gnu++0x'
+       ],
+       'cflags!': [
+         '-fno-exceptions',
diff --git a/srcpkgs/mozc/template b/srcpkgs/mozc/template
index 71d32eb5b9cd..565310f60bdd 100644
--- a/srcpkgs/mozc/template
+++ b/srcpkgs/mozc/template
@@ -1,32 +1,30 @@
 # Template file for 'mozc'
 pkgname=mozc
-version=2.23.2815.102
-revision=10
+version=2.26.4346.100
+revision=1
 create_wrksrc=yes
 build_wrksrc=mozc/src
-hostmakedepends="gettext ninja pkg-config protobuf protobuf-devel python which"
+hostmakedepends="gettext ninja pkg-config protobuf protobuf-devel python which
+ qt5-qmake qt5-host-tools"
 makedepends="gtk+-devel ibus-devel libzinnia-devel protobuf-devel qt5-devel
- fcitx-devel"
+ fcitx-devel libfcitx5-devel"
 depends="tegaki-zinnia-japanese>=0.3"
 short_desc="Japanese IME (Open Source version of Google Japanese Input)"
 maintainer="Matthias von Faber <mvf@gmx.eu>"
 license="BSD-3-Clause"
 homepage="https://github.com/google/mozc"
 distfiles="
- https://gitlab.com/fcitx/mozc/repository/dad94584ea5012110ad1d204e433964243a1639d/archive.tar.bz2>${pkgname}-${version}.tar.bz2
- https://github.com/bnoordhuis/gyp/archive/c6f471687407bf28ddfc63f1a8f47aeb7bf54edc.tar.gz
+ https://github.com/fcitx/mozc/archive/dad94584ea5012110ad1d204e433964243a1639d.tar.gz
+ ${DEBIAN_SITE}/main/g/gyp/gyp_0.1+20200513gitcaa6002.orig.tar.gz
  https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/e5b3425575734c323e1d947009dd74709437b684.tar.gz
 "
-checksum="
- e38457e63a7fa8d62d87b4f8b3e89fe5f6939d92e3c4fd287a93358375693892
- 882f074cbb3a4f2bba550fb615e63949c0fbf39eeb1718a0330b4a545ab97616
- 0b6efee0eebac2c1a8eeea333278aa40fcef7846bba9a379962c6e567e7e3dc1
-"
+checksum="09835994e4fa0f4e4e2ea4e171900c5e37c35680c4db86eb5a89be7bd82c420f
+ 8d531bc7d3302461d76a32367453cec60ed08b455f27a53d8f313d81761713a8
+ 0b6efee0eebac2c1a8eeea333278aa40fcef7846bba9a379962c6e567e7e3dc1"
 
 CXXFLAGS="-D_GNU_SOURCE"
 
 if [ "$CROSS_BUILD" ]; then
-	hostmakedepends+=" qt5-devel"
 	subpackages="ibus-mozc fcitx-mozc"
 fi
 
@@ -36,7 +34,6 @@ fi
 
 post_extract() {
 	ln -s mozc-* mozc
-	rm -rf mozc/src/unix/fcitx5
 
 	# symlink "submodules" into place
 	for _src_dest in gyp japanese-usage-dictionary:japanese_usage_dictionary; do
@@ -45,17 +42,15 @@ post_extract() {
 		rmdir $_dst
 		ln -sr $_src-* $_dst
 	done
+}
 
-	if [ "$CROSS_BUILD" ]; then
-		# find fcitx4-config
-		sed -i -e "s;fcitx4-config;${XBPS_CROSS_BASE}/usr/bin/fcitx4-config;" mozc/src/unix/fcitx/fcitx.gyp
+post_patch() {
+	if [ "$XBPS_TARGET_LIBC" = musl ]; then
+		vsed -i -e 's|PTHREAD_MUTEX_RECURSIVE_NP|PTHREAD_MUTEX_RECURSIVE|g' base/mutex.cc
 	fi
 }
 
 do_configure() {
-	case "$XBPS_TARGET_MACHINE" in
-		*-musl) sed -i -e 's|PTHREAD_MUTEX_RECURSIVE_NP|PTHREAD_MUTEX_RECURSIVE|g' base/mutex.cc ;;
-	esac
 	GYP_DEFINES="
 	 document_dir=/usr/share/licenses/${pkgname}
 	 use_libprotobuf=1
@@ -64,16 +59,14 @@ do_configure() {
 }
 
 do_build() {
-	local targets
-	targets="
-	 server/server.gyp:mozc_server
-	 gui/gui.gyp:mozc_tool
-	 unix/emacs/emacs.gyp:mozc_emacs_helper
-	 unix/ibus/ibus.gyp:ibus_mozc
-	 renderer/renderer.gyp:mozc_renderer
-	 unix/fcitx/fcitx.gyp:fcitx-mozc
-	"
-	python2 build_mozc.py build -c Release $targets
+	python2 build_mozc.py build -c Release \
+		server/server.gyp:mozc_server \
+		gui/gui.gyp:mozc_tool \
+		unix/emacs/emacs.gyp:mozc_emacs_helper \
+		unix/ibus/ibus.gyp:ibus_mozc \
+		renderer/renderer.gyp:mozc_renderer \
+		unix/fcitx/fcitx.gyp:fcitx-mozc \
+		unix/fcitx5/fcitx5.gyp:fcitx5-mozc
 
 	sed -i 's|/usr/libexec/|/usr/lib/ibus-mozc/|g' out_linux/Release/gen/unix/ibus/mozc.xml
 }
@@ -82,7 +75,7 @@ do_install() {
 	vinstall out_linux/Release/mozc_server 755 usr/lib/mozc
 	vinstall out_linux/Release/mozc_tool 755 usr/lib/mozc
 
-	head -n 29 server/mozc_server.cc > LICENSE
+	head -n 29 unix/fcitx5/fcitx_key_translator.cc >LICENSE
 	for i in LICENSE data/installer/*.html; do
 		vlicense "$i"
 	done
@@ -115,10 +108,37 @@ fcitx-mozc_package() {
 	short_desc="Mozc engine for fcitx - Client of the Mozc input method"
 	depends="${sourcepkg}-${version}_${revision} fcitx>=4.2.9"
 	homepage="https://fcitx-im.org/"
-	license="GPL-2.0-or-later"
 	pkg_install() {
+		local _file _lang
+		head -n 29 unix/fcitx/fcitx_key_translator.cc \
+			>unix/fcitx/LICENSE
+		vlicense unix/fcitx/LICENSE
 		vinstall out_linux/Release/fcitx-mozc.so 644 usr/lib/fcitx
 		vinstall unix/fcitx/fcitx-mozc.conf 644 usr/share/fcitx/addon
 		vinstall unix/fcitx/mozc.conf 644 usr/share/fcitx/inputmethod
+		for _file in out_linux/Release/gen/unix/fcitx/po/*.mo
+		do
+			_lang=${_file##*/}
+			_lang=${_lang%.mo}
+			vinstall "$_file" 644 usr/share/locale/$_lang fcitx-mozc.mo
+		done
+	}
+}
+
+fcitx5-mozc_package() {
+	short_desc="Mozc engine for fcitx v5"
+	depends="${sourcepkg}-${version}_${revision} fcitx5"
+	homepage="https://fcitx-im.org/"
+	pkg_install() {
+		local _file _lang
+		vinstall out_linux/Release/fcitx5-mozc.so 644 usr/lib/fcitx5
+		vinstall unix/fcitx5/mozc-addon.conf 644 usr/share/fcitx/addon
+		vinstall unix/fcitx/mozc.conf 644 usr/share/fcitx/inputmethod
+		for _file in out_linux/Release/gen/unix/fcitx5/po/*.mo
+		do
+			_lang=${_file##*/}
+			_lang=${_lang%.mo}
+			vinstall "$_file" 644 usr/share/locale/$_lang fcitx5-mozc.mo
+		done
 	}
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-05-01 13:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 15:55 [PR PATCH] [WIP] mozc: update to 2.26.4346.100. (new package for fcitx5-mozc) sgn
2021-04-27  1:26 ` [PR PATCH] [Updated] " sgn
2021-04-30  7:56 ` sgn
2021-04-30  7:57 ` mozc: update to 2.26.4353.100. " sgn
2021-04-30  7:57 ` sgn
2021-04-30  8:04 ` sgn
2021-04-30 13:51 ` noarchwastaken
2021-05-01  1:53 ` [PR PATCH] [Updated] " sgn
2021-05-01  2:00 ` sgn
2021-05-01  2:01 ` [PR PATCH] [Merged]: " sgn
2021-05-01 10:27 ` mvf
2021-05-01 12:18 ` ericonr
2021-05-01 12:33 ` mvf
2021-05-01 13:30 ` mvf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).