summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authortrickart2020-05-06 09:31:49 +0900
committertrickart2020-05-06 09:31:49 +0900
commit7e1f030afdeda8f14cd4fe7d7f22ae796da02a3c (patch)
tree1dfc2b84a994c90e5f1fbeddb1716ac09b67dc01
parent3132f0a44d7dd40611a94b9115f43cfa0f13c380 (diff)
downloadaur-7e1f030afdeda8f14cd4fe7d7f22ae796da02a3c.tar.gz
Fix japanese era patch
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD9
-rw-r--r--add_support_new_japanese_era_for_mozc.patch40
3 files changed, 50 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5c5a6a5ae98f..272c71097529 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = fcitx-mozc-neologd-ut+ut2
pkgver = 2.23.2815.102.20200315.20171008
- pkgrel = 1
+ pkgrel = 2
url = https://osdn.net/users/utuhiro/pf/utuhiro/files/
arch = i686
arch = x86_64
@@ -25,6 +25,7 @@ pkgbase = fcitx-mozc-neologd-ut+ut2
source = japanese_usage_dictionary::git+https://github.com/hiroyuki-komatsu/japanese-usage-dictionary.git#commit=
source = fix-build-with-gcc8.patch::https://salsa.debian.org/debian/mozc/raw/master/debian/patches/Fix-build-with-gcc8.patch
source = mozc-2.23.2815.102-python-3.patch::https://github.com/google/mozc/files/4048079/mozc-2.23.2815.102-python-3.patch.txt
+ source = add_support_new_japanese_era_for_mozc.patch
source = add_support_new_japanese_era_for_ut2.patch
source = https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-2.23.2815.102.1.patch
source = https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz
@@ -34,6 +35,7 @@ pkgbase = fcitx-mozc-neologd-ut+ut2
sha1sums = SKIP
sha1sums = 4fe935b5c2d316119cf8957b6518b3b5e7bf6ecf
sha1sums = 1b281471dac2eeab6d9ad7c47e3929e1ac402344
+ sha1sums = ea8df0fc171c321457bd0692795f0c61c7ee04ce
sha1sums = fa72a89ac18649816e9717d4468a6145db802625
sha1sums = 63a2b10e7d209c6216e2d912b2629efc44c637ea
sha1sums = 883f4fc489a9ed1c07d2d2ec37ca72509f04ea5d
diff --git a/PKGBUILD b/PKGBUILD
index 7ddf940d9bf3..002acafb1e6c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,10 +10,11 @@ _bldtype=Release
_mozcver=2.23.2815.102
_fcitxver=2.23.2815.102.1
_neologddate=20200315
+_neologdrel=1
_ut2mozcver=2.20.2677.102
_ut2dicver=20171008
pkgver=${_mozcver}.${_neologddate}.${_ut2dicver}
-pkgrel=1
+pkgrel=2
pkgbase=fcitx-mozc-neologd-ut+ut2
pkgname=fcitx-mozc-neologd-ut+ut2
@@ -29,6 +30,7 @@ source=(
japanese_usage_dictionary::git+https://github.com/hiroyuki-komatsu/japanese-usage-dictionary.git#commit=${_japanese_usage_dictionary_rev}
fix-build-with-gcc8.patch::https://salsa.debian.org/debian/mozc/raw/master/debian/patches/Fix-build-with-gcc8.patch
mozc-2.23.2815.102-python-3.patch::https://github.com/google/mozc/files/4048079/mozc-2.23.2815.102-python-3.patch.txt
+ add_support_new_japanese_era_for_mozc.patch
add_support_new_japanese_era_for_ut2.patch
https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-${_fcitxver}.patch
https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz
@@ -41,6 +43,7 @@ sha1sums=(
'SKIP'
'4fe935b5c2d316119cf8957b6518b3b5e7bf6ecf'
'1b281471dac2eeab6d9ad7c47e3929e1ac402344'
+ 'ea8df0fc171c321457bd0692795f0c61c7ee04ce'
'fa72a89ac18649816e9717d4468a6145db802625'
'63a2b10e7d209c6216e2d912b2629efc44c637ea'
'883f4fc489a9ed1c07d2d2ec37ca72509f04ea5d'
@@ -51,15 +54,17 @@ sha1sums=(
prepare() {
# japanese era patch is based add-new-japanese-era.patch
# https://salsa.debian.org/debian/mozc/raw/master/debian/patches/add_support_new_japanese_era.patch
+ patch -Np0 -i ${srcdir}/add_support_new_japanese_era_for_mozc.patch
patch -Np0 -i ${srcdir}/add_support_new_japanese_era_for_ut2.patch
cp -f $srcdir/mozc-ut2-${_ut2mozcver}.${_ut2dicver}/src/data/dictionary_oss/dictionary*.txt $srcdir/mozc-${_mozcver}+dfsg/src/data/dictionary_oss/
+
cd mozc-${_mozcver}+dfsg
patch -Np1 -i ${srcdir}/fix-build-with-gcc8.patch
patch -Np1 -i ${srcdir}/mozc-2.23.2815.102-python-3.patch
patch -Np1 -i ${srcdir}/fcitx-mozc-${_fcitxver}.patch
mkdir -p src/third_party/
cp -a ${srcdir}/japanese_usage_dictionary src/third_party/
- cat ${srcdir}/mozcdic-neologd-ut-${_neologddate}.${pkgrel}/mozcdic-*-ut-*.txt >> src/data/dictionary_oss/dictionary00.txt
+ cat ${srcdir}/mozcdic-neologd-ut-${_neologddate}.${_neologdrel}/mozcdic-*-ut-*.txt >> src/data/dictionary_oss/dictionary00.txt
}
build() {
diff --git a/add_support_new_japanese_era_for_mozc.patch b/add_support_new_japanese_era_for_mozc.patch
new file mode 100644
index 000000000000..47aee9a18bfc
--- /dev/null
+++ b/add_support_new_japanese_era_for_mozc.patch
@@ -0,0 +1,40 @@
+diff -u -r mozc-2.23.2815.102+dfsg.orig/src/rewriter/date_rewriter.cc mozc-2.23.2815.102+dfsg/src/rewriter/date_rewriter.cc
+--- mozc-2.23.2815.102+dfsg.orig/src/rewriter/date_rewriter.cc 2018-04-03 08:03:55.000000000 +0900
++++ mozc-2.23.2815.102+dfsg/src/rewriter/date_rewriter.cc 2020-05-06 08:30:37.048159659 +0900
+@@ -1239,6 +1239,10 @@
+ 1989,
+ "平成",
+ "へいせい",
++ }, {
++ 2019,
++ "令和",
++ "れいわ",
+ }
+ };
+
+diff -u -r mozc-2.23.2815.102+dfsg.orig/src/rewriter/date_rewriter_test.cc mozc-2.23.2815.102+dfsg/src/rewriter/date_rewriter_test.cc
+--- mozc-2.23.2815.102+dfsg.orig/src/rewriter/date_rewriter_test.cc 2018-04-03 08:03:55.000000000 +0900
++++ mozc-2.23.2815.102+dfsg/src/rewriter/date_rewriter_test.cc 2020-05-06 08:32:07.228639494 +0900
+@@ -469,6 +469,22 @@
+ "平成10",
+ "平成十");
+
++ // AD.2019 is "平成31(年)" or "平成三十一(年)" or "令和元(年)"
++ results.clear();
++ rewriter.AdToEra(2019, &results);
++ Expect3Results(results,
++ "平成31",
++ "平成三十一",
++ "令和元");
++
++ // AD.2020 is "令和2(年)" or "令和二(年)"
++ results.clear();
++ rewriter.AdToEra(2020, &results);
++ EXPECT_EQ(results.size(), 2);
++ Expect2Results(results,
++ "令和2",
++ "令和二");
++
+ // Negative Test
+ // Too big number or negative number input are expected false return
+ results.clear();