From 5d6f5801863fc51cfc1a4847abad02893ab381b8 Mon Sep 17 00:00:00 2001 From: Kuro_CODE25 Date: Sat, 23 Apr 2022 00:54:11 +0700 Subject: misc/fcitx-mozc: Updated for version 2.26.4220.102.1. Signed-off-by: Willy Sudiarto Raharjo --- misc/fcitx-mozc/fcitx-mozc.SlackBuild | 181 +++++++++++++++------------------- misc/fcitx-mozc/fcitx-mozc.info | 36 ++++--- 2 files changed, 98 insertions(+), 119 deletions(-) (limited to 'misc/fcitx-mozc') diff --git a/misc/fcitx-mozc/fcitx-mozc.SlackBuild b/misc/fcitx-mozc/fcitx-mozc.SlackBuild index 8c266f0eea..5e636549e5 100644 --- a/misc/fcitx-mozc/fcitx-mozc.SlackBuild +++ b/misc/fcitx-mozc/fcitx-mozc.SlackBuild @@ -1,31 +1,17 @@ #!/bin/bash + # Slackware build script for fcitx-mozc -# Issued under The MIT License (MIT) -# -# Copyright 2016 Kuro_CODE25 -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. + +# Copyright 2015-2022 Kuro_CODE25 JAPAN +# All rights reserved. # -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# Licensed under the MIT License. +# See https://opensource.org/licenses/MIT for details. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=fcitx-mozc -VERSION=${VERSION:-2.17.2313.102.1} +VERSION=${VERSION:-2.26.4220.102.1} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -38,9 +24,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -49,7 +32,6 @@ 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" @@ -67,42 +49,40 @@ fi set -e -BLDTYPE=Release - -# source rev. and version. -ZIPCODE_REL=201511 -PROTOBUF_REV=172019c40bf548908ab09bfd276074c929d48415 -GYP_REV=e2e928bacd07fead99a18cb08d64cb24e131d3e5 -JAPNESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684 -MOZC_REV=3306d3314499a54a4064b8b80bbc1bce3f6cfac4 -FCITX_PATCH_VER=2.17.2313.102.1 - 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 +ZIPCODE_REL=202011 +PROTOBUF_REV=fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a +GYP_REV=caa60026e223fc501e8b337fd5086ece4028b1c6 +JAPANESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684 +ABSEIL_CPP_REV=0f3bb466b868b523cf1dc9b2aaaed65c77b28862 +BREAKPAD_REV=216cea7bca53fa441a3ee0d0f5fd339a3a894224 +GOOGLETEST_REV=703bd9caab50b139428cea1aaff9974ebee5742e +JSONCPP_REV=9059f5cad030ba11d37818847443a53918c327b1 +MOZC_REV=1882e33b61673b66d63277f82b4c80ae4e506c10 unzip ${CWD}/x-ken-all-${ZIPCODE_REL}.zip unzip ${CWD}/jigyosyo-${ZIPCODE_REL}.zip unzip ${CWD}/mozc-$MOZC_REV.zip -unzip ${CWD}/japanese-usage-dictionary-$JAPNESE_USAGE_DICT_REV.zip +unzip ${CWD}/japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV.zip unzip ${CWD}/gyp-$GYP_REV.zip unzip ${CWD}/protobuf-$PROTOBUF_REV.zip - -# extact tar file -tar -xvf ${CWD}/fcitx-mozc-icon.tar.gz - -cp $CWD/fcitx-mozc-${FCITX_PATCH_VER}.patch . - -# rename directory +unzip ${CWD}/googletest-$GOOGLETEST_REV.zip +unzip ${CWD}/jsoncpp-$JSONCPP_REV.zip +unzip ${CWD}/breakpad-$BREAKPAD_REV.zip +unzip ${CWD}/abseil-cpp-$ABSEIL_CPP_REV.zip mv mozc-$MOZC_REV mozc -mv japanese-usage-dictionary-$JAPNESE_USAGE_DICT_REV japanese_usage_dictionary +mv japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV japanese_usage_dictionary mv protobuf-$PROTOBUF_REV protobuf mv gyp-$GYP_REV gyp +mv googletest-$GOOGLETEST_REV googletest +mv jsoncpp-$JSONCPP_REV jsoncpp +mv breakpad-$BREAKPAD_REV breakpad +mv abseil-cpp-$ABSEIL_CPP_REV abseil-cpp chown -R root:root . find -L . \ @@ -111,76 +91,71 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -# Apply fcitx patch -cd $BLDBASEDIR/mozc/src -echo "Apply fcitx patch ..." -rm unix/fcitx -rf -patch -Np2 -i "$BLDBASEDIR/fcitx-mozc-${FCITX_PATCH_VER}.patch" - -# Generate zip code seed -echo "Generating zip code seed ..." -python2 dictionary/gen_zip_code_seed.py --zip_code="$BLDBASEDIR/x-ken-all.csv" --jigyosyo="$BLDBASEDIR/JIGYOSYO.CSV" >> data/dictionary_oss/dictionary09.txt -echo "Done." - -# Copy third party deps -echo "Copy third party deps ..." -cd $BLDBASEDIR -for dep in gyp protobuf japanese_usage_dictionary -do - cp -a $dep mozc/src/third_party/ -done - -# build package -echo "build package..." CFLAGS="${CFLAGS} -fvisibility=hidden" CXXFLAGS="${CXXFLAGS} -fvisibility=hidden" -cd $BLDBASEDIR/mozc/src - -_targets="server/server.gyp:mozc_server gui/gui.gyp:mozc_tool unix/fcitx/fcitx.gyp:fcitx-mozc" +cd $TMP/$PRGNAM-$VERSION/mozc/src +rm unix/fcitx5/fcitx5.gyp +PYTHONPATH="$PWD:$PYTHONPATH" python3 dictionary/gen_zip_code_seed.py \ + --zip_code="$TMP/$PRGNAM-$VERSION/x-ken-all.csv" \ + --jigyosyo="$TMP/$PRGNAM-$VERSION/JIGYOSYO.CSV" >> data/dictionary_oss/dictionary09.txt -GYP_DEFINES="document_dir=/usr/share/licenses/$pkgname use_libzinnia=1" python2 build_mozc.py gyp --noqt -sed -i 's|command = $cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc $cflags_pch_cc -c $in -o $out|command = $cxx -MMD -MF $out.d $defines $includes -D__STRICT_ANSI__ $cflags $cflags_cc $cflags_pch_cc -c $in -o $out|' out_linux/Release/build.ninja -python2 build_mozc.py build -c $BLDTYPE $_targets - -# Extract license part of mozc -head -n 29 server/mozc_server.cc > LICENSE +cd $TMP/$PRGNAM-$VERSION +for dep in gyp protobuf japanese_usage_dictionary googletest jsoncpp breakpad abseil-cpp +do + cp -a $dep mozc/src/third_party/ +done -BLDTYPE=Release +cd $TMP/$PRGNAM-$VERSION/mozc/src +QTDIR=/usr GYP_DEFINES="document_dir=/usr/share/licenses/$PRGNAM use_libzinnia=1" python3 build_mozc.py gyp +sed -i 's|python|python3|' ../scripts/build +TARGETS="server/server.gyp:mozc_server gui/gui.gyp:mozc_tool unix/fcitx/fcitx.gyp:fcitx-mozc" \ + _bldtype=Release ../scripts/build -# install mozc to /usr/lib even if 64 bit -install -D -m 755 out_linux/${BLDTYPE}/mozc_server "${PKG}/usr/lib/mozc/mozc_server" -install -m 755 out_linux/${BLDTYPE}/mozc_tool "${PKG}/usr/lib/mozc/mozc_tool" +PREFIX=${PKG}/usr +_bldtype=Release -install -d "${PKG}/usr/share/licenses/$pkgname/" -install -m 644 LICENSE data/installer/*.html "${PKG}/usr/share/licenses/${pkgname}/" +install -D -m 755 "out_linux/${_bldtype}/mozc_server" "${PREFIX}/lib${LIBDIRSUFFIX}/mozc/mozc_server" +install -D -m 755 "out_linux/${_bldtype}/mozc_tool" "${PREFIX}/lib${LIBDIRSUFFIX}/mozc/mozc_tool" +install -d "${PREFIX}/share/doc/mozc/" +install -m 644 data/installer/*.html "${PREFIX}/share/doc/mozc/" -for mofile in out_linux/${BLDTYPE}/gen/unix/fcitx/po/*.mo +for mofile in out_linux/${_bldtype}/gen/unix/fcitx/po/*.mo do - filename=`basename $mofile` - lang=${filename/.mo/} - install -D -m 644 "$mofile" "${PKG}/usr/share/locale/$lang/LC_MESSAGES/fcitx-mozc.mo" + filename=`basename $mofile` + lang=${filename/.mo/} + install -D -m 644 "$mofile" "${PREFIX}/share/locale/$lang/LC_MESSAGES/fcitx-mozc.mo" done -install -D -m 755 out_linux/${BLDTYPE}/fcitx-mozc.so "${PKG}/usr/lib${LIBDIRSUFFIX}/fcitx/fcitx-mozc.so" -install -D -m 644 unix/fcitx/fcitx-mozc.conf "${PKG}/usr/share/fcitx/addon/fcitx-mozc.conf" -install -D -m 644 unix/fcitx/mozc.conf "${PKG}/usr/share/fcitx/inputmethod/mozc.conf" - -install -d "${PKG}/usr/share/fcitx/mozc/icon" -install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc.png" -install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-alpha_full.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-alpha_full.png" -install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-alpha_half.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-alpha_half.png" -install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-direct.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-direct.png" -install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-hiragana.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-hiragana.png" -install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-katakana_full.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-katakana_full.png" -install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-katakana_half.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-katakana_half.png" -install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-dictionary.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-dictionary.png" -install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-properties.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-properties.png" -install -m 644 "$BLDBASEDIR/fcitx-mozc-icons/mozc-tool.png" "${PKG}/usr/share/fcitx/mozc/icon/mozc-tool.png" +install -D -m 755 "out_linux/${_bldtype}/fcitx-mozc.so" "${PREFIX}/lib${LIBDIRSUFFIX}/fcitx/fcitx-mozc.so" +install -D -m 644 unix/fcitx/fcitx-mozc.conf "${PREFIX}/share/fcitx/addon/fcitx-mozc.conf" +install -D -m 644 unix/fcitx/mozc.conf "${PREFIX}/share/fcitx/inputmethod/mozc.conf" + +install -d "${PREFIX}/share/fcitx/mozc/icon" +install -D -m 644 data/images/product_icon_32bpp-128.png "${PREFIX}/share/fcitx/mozc/icon/mozc.png" +install -D -m 644 ../scripts/icons/ui-alpha_full.png "${PREFIX}/share/fcitx/mozc/icon/mozc-alpha_full.png" +install -D -m 644 ../scripts/icons/ui-alpha_half.png "${PREFIX}/share/fcitx/mozc/icon/mozc-alpha_half.png" +install -D -m 644 ../scripts/icons/ui-direct.png "${PREFIX}/share/fcitx/mozc/icon/mozc-direct.png" +install -D -m 644 ../scripts/icons/ui-hiragana.png "${PREFIX}/share/fcitx/mozc/icon/mozc-hiragana.png" +install -D -m 644 ../scripts/icons/ui-katakana_full.png "${PREFIX}/share/fcitx/mozc/icon/mozc-katakana_full.png" +install -D -m 644 ../scripts/icons/ui-katakana_half.png "${PREFIX}/share/fcitx/mozc/icon/mozc-katakana_half.png" +install -D -m 644 ../scripts/icons/ui-dictionary.png "${PREFIX}/share/fcitx/mozc/icon/mozc-dictionary.png" +install -D -m 644 ../scripts/icons/ui-properties.png "${PREFIX}/share/fcitx/mozc/icon/mozc-properties.png" +install -D -m 644 ../scripts/icons/ui-tool.png "${PREFIX}/share/fcitx/mozc/icon/mozc-tool.png" + +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +cd $TMP/$PRGNAM-$VERSION/mozc +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + AUTHORS CONTRIBUTORS LICENSE README.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $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 diff --git a/misc/fcitx-mozc/fcitx-mozc.info b/misc/fcitx-mozc/fcitx-mozc.info index d3b06e4644..8b4ac04c25 100644 --- a/misc/fcitx-mozc/fcitx-mozc.info +++ b/misc/fcitx-mozc/fcitx-mozc.info @@ -1,24 +1,28 @@ PRGNAM="fcitx-mozc" -VERSION="2.17.2313.102.1" +VERSION="2.26.4220.102.1" HOMEPAGE="https://fcitx-im.org" -DOWNLOAD="http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-2.17.2313.102.1.patch \ - http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz \ - https://slackware.uk/sbosrcarch/by-name/misc/fcitx-mozc/jigyosyo-201511.zip \ - https://slackware.uk/sbosrcarch/by-name/misc/fcitx-mozc/x-ken-all-201511.zip \ - https://github.com/google/mozc/archive/3306d3314499a54a4064b8b80bbc1bce3f6cfac4/mozc-3306d3314499a54a4064b8b80bbc1bce3f6cfac4.zip \ +DOWNLOAD="https://github.com/abseil/abseil-cpp/archive/0f3bb466b868b523cf1dc9b2aaaed65c77b28862/abseil-cpp-0f3bb466b868b523cf1dc9b2aaaed65c77b28862.zip \ + https://github.com/google/breakpad/archive/216cea7bca53fa441a3ee0d0f5fd339a3a894224/breakpad-216cea7bca53fa441a3ee0d0f5fd339a3a894224.zip \ + https://github.com/google/googletest/archive/703bd9caab50b139428cea1aaff9974ebee5742e/googletest-703bd9caab50b139428cea1aaff9974ebee5742e.zip \ + https://github.com/chromium/gyp/archive/caa60026e223fc501e8b337fd5086ece4028b1c6/gyp-caa60026e223fc501e8b337fd5086ece4028b1c6.zip \ https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/e5b3425575734c323e1d947009dd74709437b684/japanese-usage-dictionary-e5b3425575734c323e1d947009dd74709437b684.zip \ - https://github.com/google/protobuf/archive/172019c40bf548908ab09bfd276074c929d48415/protobuf-172019c40bf548908ab09bfd276074c929d48415.zip \ - https://github.com/adblockplus/gyp/archive/e2e928bacd07fead99a18cb08d64cb24e131d3e5/gyp-e2e928bacd07fead99a18cb08d64cb24e131d3e5.zip" -MD5SUM="45fc59b37e21fc9d19875a9a45683688 \ - 80fe2ef127b70649df22d133822ac8a7 \ - 6a077e9aef4d8510cb4863e15ad2aed2 \ - 613677880579f1dc03f0637d42abaf0c \ - 1b6d8aa97cb9801d214de0f47fee0242 \ + https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-202011.zip \ + https://github.com/open-source-parsers/jsoncpp/archive/9059f5cad030ba11d37818847443a53918c327b1/jsoncpp-9059f5cad030ba11d37818847443a53918c327b1.zip \ + https://github.com/fcitx/mozc/archive/1882e33b61673b66d63277f82b4c80ae4e506c10/mozc-1882e33b61673b66d63277f82b4c80ae4e506c10.zip \ + https://github.com/protocolbuffers/protobuf/archive/fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a/protobuf-fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a.zip \ + https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-202011.zip" +MD5SUM="4f23c5fcb19a7ef0fb6ce0f636d480e3 \ + d87baf3e820df3f32e278633f8cf2904 \ + 768da4173ee9df3248b8f828747982ad \ + 699c5af5c6d7e19835afb5292d151f91 \ a6eb1da9ad7ceffcb9683003332abf7e \ - 828b7ffb92b4a01cce10312cdef4f532 \ - fe502a9242ba799406b1141b5085a24d" + c5f9c8f0149f5350cfd9dfcfa876aed4 \ + b697e8c85b2e41304d690ebc6bf2e1ca \ + 5ad08b20c092f8c5d7e65f4e8bd7b94c \ + cb4b1baed208474284161b7abd5cc17c \ + 669ae868ea978ca06909a2d4562eaf0a" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="zinnia" +REQUIRES="" MAINTAINER="Kuro_CODE25" EMAIL="kuro.code25@gmail.com" -- cgit v1.2.3