Archのfcitx-mozcが 2.26.4360 へアップデートされていたので、Slackware64-15.0_Beta1 の
fcitx-mozcも同バージョンへアップグレードした。> Thanks Arch linux
作成したパッケージ: fcitx-mozc-2.26.4360.102.1-x86_64-1jw.txz
コンパイルが通った環境は
・slackware64-current 2021-05-24以降の環境
・gcc-10.3.0
・python3-3.9.5
・qt4 無し
・qt-5.15.2
・zinnia (別途インストール済)
0. Arch linux - fcitx-mozc-2.26.4360.102 の情報
1. fcitx-mozc.info (ソース入手先)
PRGNAM="fcitx-mozc" VERSION="2.26.4360.102.1" HOMEPAGE="https://fcitx-im.org" DOWNLOAD="http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz \ https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-202104.zip \ https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-202104.zip \ https://github.com/fcitx/mozc/archive/ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce/mozc-ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce.zip \ https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/e5b3425575734c323e1d947009dd74709437b684/japanese-usage-dictionary-e5b3425575734c323e1d947009dd74709437b684.zip \ https://github.com/protocolbuffers/protobuf/archive/fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a/protobuf-fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a.zip \ https://github.com/chromium/gyp/archive/caa60026e223fc501e8b337fd5086ece4028b1c6/gyp-caa60026e223fc501e8b337fd5086ece4028b1c6.zip \ https://github.com/abseil/abseil-cpp/archive/0f3bb466b868b523cf1dc9b2aaaed65c77b28862/abseil-cpp-0f3bb466b868b523cf1dc9b2aaaed65c77b28862.zip \ https://chromium.googlesource.com/breakpad/breakpad/+archive/216cea7bca53fa441a3ee0d0f5fd339a3a894224.tar.gz \ https://github.com/open-source-parsers/jsoncpp/archive/9059f5cad030ba11d37818847443a53918c327b1/jsoncpp-9059f5cad030ba11d37818847443a53918c327b1.zip https://github.com/google/googletest/archive/703bd9caab50b139428cea1aaff9974ebee5742e/googletest-703bd9caab50b139428cea1aaff9974ebee5742e.zip" MD5SUM="8ec243464ddb9ecf48924708c0448284 \ c5f9c8f0149f5350cfd9dfcfa876aed4 \ 669ae868ea978ca06909a2d4562eaf0a \ 257fcb244249a3c65c576cceb5cbb7c8 \ a6eb1da9ad7ceffcb9683003332abf7e \ cb4b1baed208474284161b7abd5cc17c \ e168f5f40cbf823c33db28e03257d63b \ 4f23c5fcb19a7ef0fb6ce0f636d480e3 \ 721ec19eb2b0bffa91e1eb94292bc7e4 \ b697e8c85b2e41304d690ebc6bf2e1ca \ 768da4173ee9df3248b8f828747982ad" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="fcitx-configtool ninja zinnia" MAINTAINER="Kuro_CODE25" EMAIL="kuro.code25@gmail.com" |
2. fcitx-mozc.SlackBuild
#!/bin/sh # 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. # # 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. PRGNAM=fcitx-mozc VERSION=${VERSION:-2.26.4360.102.1} BUILD=${BUILD:-1} TAG=${TAG:-jw} if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac fi CWD=$(pwd) 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 # source rev. and version. ZIPCODE_REL=202104 ABSEIL_CPP_REV=0f3bb466b868b523cf1dc9b2aaaed65c77b28862 BREAKPAD_REV=216cea7bca53fa441a3ee0d0f5fd339a3a894224 MOZC_REV=ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce GOOGLETEST_REV=703bd9caab50b139428cea1aaff9974ebee5742e JSONCPP_REV=9059f5cad030ba11d37818847443a53918c327b1 PROTOBUF_REV=fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a GYP_REV=caa60026e223fc501e8b337fd5086ece4028b1c6 JAPANESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684 # Download sources wget https://github.com/chromium/gyp/archive/${GYP_REV}/gyp-${GYP_REV}.zip wget https://github.com/fcitx/mozc/archive/${MOZC_REV}/mozc-${MOZC_REV}.zip wget https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICT_REV}/japanese-usage-dictionary-${JAPANESE_USAGE_DICT_REV}.zip wget https://github.com/protocolbuffers/protobuf/archive/${PROTOBUF_REV}/protobuf-${PROTOBUF_REV}.zip wget https://github.com/abseil/abseil-cpp/archive/${ABSEIL_CPP_REV}/abseil-cpp-${ABSEIL_CPP_REV}.zip wget https://chromium.googlesource.com/breakpad/breakpad/+archive/${BREAKPAD_REV}.tar.gz wget https://github.com/google/googletest/archive/${GOOGLETEST_REV}/googletest-${GOOGLETEST_REV}.zip wget https://github.com/open-source-parsers/jsoncpp/archive/${JSONCPP_REV}/jsoncpp-${JSONCPP_REV}.zip wget https://osdn.net/projects/ponsfoot-aur/storage/mozc/jigyosyo-${ZIPCODE_REL}.zip wget https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-${ZIPCODE_REL}.zip wget https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-icon.tar.gz 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/x-ken-all-$ZIPCODE_REL.zip unzip $CWD/jigyosyo-$ZIPCODE_REL.zip unzip $CWD/abseil-cpp-$ABSEIL_CPP_REV.zip unzip $CWD/googletest-$GOOGLETEST_REV.zip unzip $CWD/jsoncpp-$JSONCPP_REV.zip unzip $CWD/mozc-$MOZC_REV.zip unzip $CWD/japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV.zip unzip $CWD/gyp-$GYP_REV.zip unzip $CWD/protobuf-$PROTOBUF_REV.zip # untar breakpad to breakpad directory mkdir breakpad tar xvf ${CWD}/${BREAKPAD_REV}.tar.gz -C breakpad # extact tar file tar -xvf ${CWD}/fcitx-mozc-icon.tar.gz # rename directory mv mozc-$MOZC_REV mozc mv gyp-$GYP_REV gyp mv japanese-usage-dictionary-$JAPANESE_USAGE_DICT_REV japanese_usage_dictionary mv abseil-cpp-$ABSEIL_CPP_REV abseil-cpp mv protobuf-$PROTOBUF_REV protobuf #mv breakpad-$BREAKPAD_REV breakpad mv googletest-$GOOGLETEST_REV googletest mv jsoncpp-$JSONCPP_REV jsoncpp 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 {} \; # Apply Arch-linux patch #cd $BLDBASEDIR/mozc #patch -Np1 -i $CWD/patches/0001-fix-install_fcitx-translation-files.patch cd $BLDBASEDIR/mozc/src # We won't need fcitx5 rm -rf unix/fcitx5 cd $BLDBASEDIR/mozc # prepare zip code dictionary unzip -d src/data/dictionary_oss $CWD/x-ken-all-$ZIPCODE_REL.zip unzip -d src/data/dictionary_oss $CWD/jigyosyo-$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." # Copy third party deps echo "Copy third party deps ..." cd $BLDBASEDIR for dep in abseil-cpp breakpad googletest jsoncpp 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 unix/emacs/emacs.gyp:mozc_emacs_helper" QTDIR=/usr GYP_DEFINES="ibus_mozc_path=/usrshare/ibus-mozc/product_icon.png ibus_mozc_icon_path=/usrshare/ibus-mozc/product_icon.png document_dir=/usr/share/licenses/$pkgname use_libzinnia=1 use_fcitx5=0" python3 build_mozc.py gyp python3 build_mozc.py gyp --server_dir=/usr/lib/mozc python3 build_mozc.py build -c Release $_targets # Extract license part of mozc head -n 29 server/mozc_server.cc > LICENSE BLDTYPE=Release # 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" install -d "${PKG}/usr/share/licenses/$PRGNAM/" install -m 644 LICENSE data/installer/*.html "${PKG}/usr/share/licenses/${PRGNAM}/" 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" 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" # emacs helper install -D -m 755 out_linux/Release/mozc_emacs_helper "${PKG}/usr/bin/mozc_emacs_helper" install -D -m 644 unix/emacs/mozc.el "${PKG}/usr/share/emacs/site-lisp/emacs-mozc/mozc.el" install -D -m 644 "${CWD}/mozc-isearch.el" "${PKG}/usr/share/emacs/site-lisp/emacs-mozc/mozc-isearch.el" mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION # copy patches just in case cp $CWD/patches/* $PKG/usr/doc/$PRGNAM-$VERSION/ cp $CWD/sources.url $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:-txz} |
※ 2.26.4220 で適用していた patch "0001-fix-install_fcitx-translation-files.patch" は不要らしい。
----ca82d39
(memo)
※ Arch PKGBUIL にある mozcの git-commit番号(戦闘のx桁)= ca82d39
から目的のcommit source を探すには
1) まず mozc git master を開く
2) 次に、xxxx commits などと表示されているリンクを開く
3) commit番号 xxxx に一致するリンクを捜す
ca92d39 の場合はコレ
4) 最終的な Download Link は以下のようになる
https://github.com/fcitx/mozc/archive/ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce/mozc-ca82d39d08df3359fdf5c653a1f56b3e95cbe2ce.zip