2020年12月
関連ソースが多いので、SlackBuildを走らせたときに wget でソースを取得して
コンパイルするよう SlackBuild を修正した。
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.4220.102.1} BUILD=${BUILD:-5} 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=202011 ABSEIL_CPP_REV=0f3bb466b868b523cf1dc9b2aaaed65c77b28862 BREAKPAD_REV=216cea7bca53fa441a3ee0d0f5fd339a3a894224 GOOGLETEST_REV=703bd9caab50b139428cea1aaff9974ebee5742e JSONCPP_REV=9059f5cad030ba11d37818847443a53918c327b1 PROTOBUF_REV=fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a GYP_REV=caa60026e223fc501e8b337fd5086ece4028b1c6 JAPANESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684 MOZC_REV=1882e33b61673b66d63277f82b4c80ae4e506c10 # 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/$pkgname/" install -m 644 LICENSE data/installer/*.html "${PKG}/usr/share/licenses/${pkgname}/" 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} |
Arch linux の情報を参考にして slackware64-current の fcitx-mozc をバージョン 2.26-4220.102.1 に
アップデートしてみた。
コンパイルが通った環境は
・slackware64-current 2020-12-07以降の環境
・gcc-10.2.0
・python3-3.9.1
・qt4 無し
・qt-5.15.2
・zinnia (別途インストール済)
0. Arch linux - fcitx-mozc-2.26.4220.102 の情報
1. fcitx-mozc.info (ソース入手先)
PRGNAM="fcitx-mozc" VERSION="2.26.4220.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-202011.zip \ https://osdn.net/projects/ponsfoot-aur/storage/mozc/x-ken-all-202011.zip \ https://github.com/fcitx/mozc/archive/1882e33b61673b66d63277f82b4c80ae4e506c10/mozc-1882e33b61673b66d63277f82b4c80ae4e506c10.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/breakpad-216cea7bca53fa441a3ee0d0f5fd339a3a894224.zip \ 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 \ 5ad08b20c092f8c5d7e65f4e8bd7b94c \ a6eb1da9ad7ceffcb9683003332abf7e \ cb4b1baed208474284161b7abd5cc17c \ 699c5af5c6d7e19835afb5292d151f91 \ 4f23c5fcb19a7ef0fb6ce0f636d480e3 \ 721ec19eb2b0bffa91e1eb94292bc7e4 \ b697e8c85b2e41304d690ebc6bf2e1ca \ 768da4173ee9df3248b8f828747982ad" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="fcitx-configtool ninja zinnia" MAINTAINER="Kuro_CODE25" EMAIL="kuro-dot-code25-at-gmail-dot.com" |
2. fcitx-mozc.SlackBuild
#!/bin/shjsoncpp # 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.4220.102.1} BUILD=${BUILD:-2} 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=202011 ABSEIL_CPP_REV=0f3bb466b868b523cf1dc9b2aaaed65c77b28862 BREAKPAD_REV=216cea7bca53fa441a3ee0d0f5fd339a3a894224 GOOGLETEST_REV=703bd9caab50b139428cea1aaff9974ebee5742e JSONCPP_REV=9059f5cad030ba11d37818847443a53918c327b1 PROTOBUF_REV=fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a GYP_REV=caa60026e223fc501e8b337fd5086ece4028b1c6 JAPANESE_USAGE_DICT_REV=e5b3425575734c323e1d947009dd74709437b684 MOZC_REV=1882e33b61673b66d63277f82b4c80ae4e506c10 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/breakpad-$BREAKPAD_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 # 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/$pkgname/" install -m 644 LICENSE data/installer/*.html "${PKG}/usr/share/licenses/${pkgname}/" 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} |
3. 0001-fix-install_fcitx-translation-files.patch
From daed110fb6f5d4309aaac4982f8e8712b809f81f Mon Sep 17 00:00:00 2001 From: Jiachen YANG <farseerfc@gmail.com> Date: Tue, 15 Dec 2020 11:42:26 +0900 Subject: [PATCH] fix install_fcitx translation files --- scripts/install_fcitx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install_fcitx b/scripts/install_fcitx index d4aa204e..493f1e1c 100755 --- a/scripts/install_fcitx +++ b/scripts/install_fcitx @@ -3,7 +3,7 @@ _bldtype="${_bldtype:-Debug}" PREFIX="${PREFIX:-/usr}" -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/} -- 2.29.2 |
4. emacs で fcitx-mozc を使う
[HOME]/.emacs.d/init.el
(require 'mozc) ; or (load-file "/path/to/mozc.el") (setq default-input-method "japanese-mozc") (setq mozc-candidate-style 'overlay) |
2020-12-07以降のslackware64-current の環境で MEGAsync-4.3.7.0 のコンパイルが通るようになったので
以下にメモとして残す。
1. ソース入手先
MEGAsync.info
PRGNAM="MEGAsync" VERSION="4.3.7.0" HOMEPAGE="https://github.com/meganz/MEGAsync/" DOWNLOAD="https://github.com/meganz/MEGAsync/archive/v4.3.7.0_Linux/MEGAsync-4.3.7.0_Linux.tar.gz \ https://github.com/meganz/sdk/archive/v3.7.4/sdk-3.7.4.tar.gz" MD5SUM="051cd9c42aad7ad283221e445bf838f7 \ 2fc61d843498ad6717c7c396238683b5" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="libuv libsodium cryptopp FreeImage c-ares libmediainfo" MAINTAINER="Felipe Bugno" EMAIL="capent-at-yahoo-dot-com" |
2. MEGAsync.SlackBuild
#!/bin/sh # Slackware build script for MEGASync input plugin # Copyright 2017,2018 Felipe Bugno <capent@yahoo.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. PRGNAM=MEGAsync VERSION=${VERSION:-4.3.7.0} SDK=${SDK:-3.7.4} 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} 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 rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION\_Linux tar xvf $CWD/$PRGNAM-$VERSION\_Linux.tar.?z cd $PRGNAM-$VERSION\_Linux/src/MEGASync/mega tar --strip-components=1 -xvf $CWD/sdk-$SDK.tar.gz cd ../ sed -i '/DEFINES += REQUIRE_HAVE_PDFIUM/d' MEGASync.pro sed -i '/CONFIG += USE_PDFIUM/d' MEGASync.pro cd ../../ patch -p1 < $CWD/megasync-qmake.diff 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 src/MEGASync/mega ./autogen.sh CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --datarootdir=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=/usr/doc/$PRGNAM-$VERSION \ --build=$ARCH-slackware-linux \ --disable-megaapi \ --with-cares \ --with-cryptopp \ --with-curl \ --with-sodium \ --with-sqlite \ --with-zlib \ --with-termcap \ --with-freeimage \ --enable-chat \ --enable-gcc-hardening cd ../../ qmake-qt5 "CONFIG += FULLREQUIREMENTS" MEGA.pro || qmake-qt4 "CONFIG += FULLREQUIREMENTS" MEGA.pro #qmake would fail when qt4 installed (due to some path missconfigurations) lrelease-qt5 MEGASync/MEGASync.pro || lrelease-qt4 MEGASync/MEGASync.pro make install -m 755 -p -D $TMP/$PRGNAM-$VERSION\_Linux/src/MEGASync/megasync $PKG/usr/bin/megasync install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Linux/src/MEGASync/platform/linux/data/megasync.desktop $PKG/usr/share/applications/megasync.desktop install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Linux/src/MEGASync/platform/linux/data/icons/hicolor/16x16/apps/mega.png $PKG/usr/share/icons/hicolor/16x16/apps/mega.png install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Linux/src/MEGASync/platform/linux/data/icons/hicolor/32x32/apps/mega.png $PKG/usr/share/icons/hicolor/32x32/apps/mega.png install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Linux/src/MEGASync/platform/linux/data/icons/hicolor/48x48/apps/mega.png $PKG/usr/share/icons/hicolor/48x48/apps/mega.png install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Linux/src/MEGASync/platform/linux/data/icons/hicolor/128x128/apps/mega.png $PKG/usr/share/icons/hicolor/128x128/apps/mega.png install -m 644 -p -D $TMP/$PRGNAM-$VERSION\_Linux/src/MEGASync/platform/linux/data/icons/hicolor/256x256/apps/mega.png $PKG/usr/share/icons/hicolor/256x256/apps/mega.png 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 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cd $TMP/$PRGNAM-$VERSION\_Linux cp -a README.md LICENCE.md CREDITS.md $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} |
3. megasync-qmake.diff
--- a/src/MEGAShellExtNautilus/MEGAShellExtNautilus.pro +++ b/src/MEGAShellExtNautilus/MEGAShellExtNautilus.pro @@ -1,6 +1,7 @@ QT -= core gui -TARGET = MEGAShellExtNautilus +TARGET = libMEGAShellExtNautilus +CONFIG += plugin no_plugin_name_prefix TEMPLATE = lib SOURCES += mega_ext_module.c \ @@ -41,5 +42,4 @@ INSTALLS += emblems32 emblems64 !contains(DEFINES, no_desktop) { update_cache.commands = gtk-update-icon-cache -f -t $${HICOLOR} || true update_cache.path = $${HICOLOR} - INSTALLS += update_cache } --- a/src/MEGASync/MEGASync.pro +++ b/src/MEGASync/MEGASync.pro @@ -48,7 +48,6 @@ TEMPLATE = app #DEFINES += LOG_TO_LOGGER #DEFINES += LOG_TO_FILE #DEFINES += LOG_TO_STDOUT -DEFINES += ENABLE_LOG_PERFORMANCE debug { CONFIG += console --- a/src/MEGASync/control/control.pri +++ b/src/MEGASync/control/control.pri @@ -2,6 +2,7 @@ DEPENDPATH += $$PWD INCLUDEPATH += $$PWD QT += network +LIBS+=-lz SOURCES += $$PWD/HTTPServer.cpp \ $$PWD/Preferences.cpp \ --- a/src/MEGASync/platform/platform.pri +++ b/src/MEGASync/platform/platform.pri @@ -34,7 +34,8 @@ unix:!macx { system(command -v lsb_release): version.commands = lsb_release -rs > $$version.target version.files = $$version.target - INSTALLS += distro version + target.path = $$PREFIX/bin + INSTALLS += target QT += dbus SOURCES += $$PWD/linux/LinuxPlatform.cpp \ @@ -62,7 +62,6 @@ unix:!macx { # desktop desktop.path = $$DESKTOP_DESTDIR/share/applications desktop.files = $$PWD/linux/data/megasync.desktop - desktop.commands = update-desktop-database &> /dev/null || true INSTALLS += desktop HICOLOR = $$DESKTOP_DESTDIR/share/icons/hicolor --- a/src/MEGA.pro +++ b/src/MEGA.pro @@ -17,9 +17,9 @@ win32 { unix:!macx { CONFIG(with_ext) { SUBDIRS += MEGAShellExtNautilus + } + CONFIG(with_thu) { SUBDIRS += MEGAShellExtThunar - SUBDIRS += MEGAShellExtDolphin - SUBDIRS += MEGAShellExtNemo } } |
これまでは fcitx-mozc-2.17.2313.102.1 を使っていたが、バージョンが少々古くなっているとともに
新元号(令和)パッチがあたっていないバージョンだった。
2020-12-07 のslackware64-current の大規模なアップデートに伴い、Qt4が削除されて完全なQt5
環境になったのを機会に fcitx-mozc を他ディストリビューション並みの バージョン 2.23.2185.102.1 に
アップグレードできないものか試してみたところ、新元号(令和)パッチをあてたソースのコンパイルに
成功した。
以下、備忘録としてメモを残す。
1. 各種ソースと入手先
fcitx-mozc.info
PRGNAM="fcitx-mozc" VERSION="2.23.2815.102.1" HOMEPAGE="https://fcitx-im.org" DOWNLOAD="http://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-2.23.2815.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-201810.zip \ https://slackware.uk/sbosrcarch/by-name/misc/fcitx-mozc/x-ken-all-201810.zip \ https://github.com/google/mozc/archive/afb03ddfe72dde4cf2409863a3bfea160f7a66d8/mozc-afb03ddfe72dde4cf2409863a3bfea160f7a66d8.zip \ https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/a4a66772e33746b91e99caceecced9a28507e92/japanese-usage-dictionary-a4a66772e33746b91e99caceecced9a28507e925.zip \ https://github.com/google/protobuf/archive/92a7e778e7394386f413cec28d67a07630f784b1/protobuf-92a7e778e7394386f413cec28d67a07630f784b1.zip \ https://github.com/adblockplus/gyp/archive/4ec6c4e3a94bd04a6da2858163d40b2429b8aad1/gyp-4ec6c4e3a94bd04a6da2858163d40b2429b8aad1.zip https://github.com/google/mozc/pull/444/commits/82d38f929882a9c62289b179c6fe41efed249987.patch" MD5SUM=" 8ec243464ddb9ecf48924708c0448284 \ 80fe2ef127b70649df22d133822ac8a7 \ d188bd7a873e851ed8f1f1466f1091a5 \ bba32a6cb14120c11f6eec6edcd0dd71 \ 8a34cdbc32b81bc9119ef0dac9068cc3 \ 8bb6e10a4a8b83a13a1623e8ec0bb326 \ 7d6ae61de6a8dba53d9a331ee3e7b4a9 \ ca4af1a5242542274a050c10edd578be \ 8e7ed81b84e1ee2e4ad676130e88c3e4" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="fcitx-configtool ninja zinnia" MAINTAINER="Kuro_CODE25" EMAIL="kuro-dot-code25-at-gmail-dot-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.23.2815.102.1} BUILD=${BUILD:-2} 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=201810 PROTOBUF_REV=92a7e778e7394386f413cec28d67a07630f784b1 GYP_REV=4ec6c4e3a94bd04a6da2858163d40b2429b8aad1 JAPNESE_USAGE_DICT_REV=a4a66772e33746b91e99caceecced9a28507e925 MOZC_REV=afb03ddfe72dde4cf2409863a3bfea160f7a66d8 #FCITIX PATCH VER FCITX_PATCH_VER=2.23.2815.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 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}/gyp-$GYP_REV.zip unzip ${CWD}/protobuf-$PROTOBUF_REV.zip # extact tar file tar -xvf ${CWD}/fcitx-mozc-icon.tar.gz cp $CWD/patches/fcitx-mozc-${FCITX_PATCH_VER}.patch . # rename directory mv mozc-$MOZC_REV mozc mv japanese-usage-dictionary-$JAPNESE_USAGE_DICT_REV japanese_usage_dictionary mv protobuf-$PROTOBUF_REV protobuf mv gyp-$GYP_REV gyp 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 mozc pull patch cd $BLDBASEDIR/mozc patch -Np1 -i $CWD/patches/82d38f929882a9c62289b179c6fe41efed249987.patch # Apply debian patches (Support for new Japanese era "REIWA") patch -p1 < $CWD/patches/add_support_new_japanese_era.patch # 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" rm -rf unix/fcitx5 find . -name \*.py -type f -exec sed -i -e "1s|python.*$|python2|" {} + find . -regex '.*\.gypi?$' -type f -exec sed -i -e "s|'python'|'python2'|g" {} + # Generate zip code seed cd $BLDBASEDIR/mozc/src/dictionary sed -i "s/from dictionary import zip_code_util/import zip_code_util/g" gen_zip_code_seed.py cd $BLDBASEDIR/mozc/src echo "Generating zip code seed ..." python 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 unix/emacs/emacs.gyp:mozc_emacs_helper" QTDIR=/usr GYP_DEFINES="document_dir=/usr/share/licenses/$pkgname use_libzinnia=1" python build_mozc.py gyp python 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/$pkgname/" install -m 644 LICENSE data/installer/*.html "${PKG}/usr/share/licenses/${pkgname}/" 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" mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION # copy patches just incase cp $CWD/patches/* $PKG/usr/doc/$PRGNAM-$VERSION/ cp $CWD/82d38f929882a9c62289b179c6fe41efed249987.patch $PKG/usr/doc/$PRGNAM-$VERSION/ cp $CWD/fcitx-mozc-${FCITX_PATCH_VER}.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:-txz} |
3. 新元号(令和)パッチ
# wget https://salsa.debian.org/debian/mozc/raw/master/debian/patches/add_support_new_japanese_era.patch |
4. 参考画像

いまさら感はあるが、東雲フォントを入れてみたので、メモ。
fedora のバイナリrpmからファイル群を抽出して slacware用に配置し直した
手抜きパッケージです。
作業ディレクトリを作成してそこに移動して作業する。
Step-1) fedoraパッケージを入手する
# wget http://vega.pgw.jp/~kabe/vsd/shinonome-plus/shinonome-plus-fonts-0.9.12-5.el6.noarch.rpm |
Step-2) shinonome-plus-fonts.SlackBuild
#!/bin/sh # Slackware build script for shinonome-plus-0.9.12 # Copyright 2020 JW <fake_jw.slackware@gmail.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. PRGNAM=shinonome-plus-fonts VERSION=${VERSION:-0.9.12} BUILD=${BUILD:-2} 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/jw} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} 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 rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $PKG rpm2cpio $CWD/$PRGNAM-${VERSION}-5.el6.noarch.rpm | cpio -dim rm -rf $PKG/etc mv $PKG/usr/share/X11/fonts $PKG/usr/share/fonts mv $PKG/usr/share/doc $PKG/usr/doc rm -rf $PKG/usr/share/X11 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 {} \; cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild cat $CWD/README.slackware > $PKG/usr/doc/$PRGNAM-$VERSION/README.slackware mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cp $CWD/doinst.sh $PKG/install/ cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-noarch-$BUILD$TAG.${PKGTYPE:-txz} |
Step-3) slack-desc 内容
# 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------------------------------------------------------| shinonome-plus-fonts: shinonome-plus-fonts (Shinonome Font Family) shinonome-plus-fonts: shinonome-plus-fonts: "Shinonome Font Family" is a set of BDF bitmap fonts. shinonome-plus-fonts: The original author Yasuyuki Furukawa was pleased to hand over its shinonome-plus-fonts: maintenance to the /efont/. shinonome-plus-fonts: These fonts are in Public Domain. shinonome-plus-fonts: shinonome-plus-fonts: URL: http://openlab.ring.gr.jp/efont/shinonome/index.html.en shinonome-plus-fonts: URL2: http://vega.pgw.jp/~kabe/vsd/shinonome-plus-fonts/unicode.html shinonome-plus-fonts: shinonome-plus-fonts: |
Step-4) doinst.sh
# Update the X font indexes: if [ -x /usr/bin/mkfontdir ]; then ( cd /usr/share/fonts/shinonome mkfontscale . mkfontdir . ) fi if [ -x /usr/bin/fc-cache ]; then /usr/bin/fc-cache -f fi |
Step-5) フォントインストール後の設定など(参考)
(A) /etc/fonts/conf.d
# cd /etc/fonts/conf.d
# ln -s /etc/fonts/conf.avail/70-yes-bitmaps.conf 70-yes-bitmaps.conf
(効果のほどは分かっていない。)
# cd /etc/fonts/conf.d
# ln -s /etc/fonts/conf.avail/70-yes-bitmaps.conf 70-yes-bitmaps.conf
(効果のほどは分かっていない。)
(B) (HOME)/.bashrc
.bashrc の xterm のalias を以下のように書き換え、shinonome フォント
を指定する。
example)
.bashrc の xterm のalias を以下のように書き換え、shinonome フォント
を指定する。
example)
---------------------------------------------------------------------------
alias xterm="xterm -sb -rightbar -fn shnm14u -selbg "rgb:ff/ff/55" -geometry 100x31+100+260"
---------------------------------------------------------------------------
注記) -geometry は自身の環境に合わせる。
注記) -geometry は自身の環境に合わせる。
(C) (HOME)/.xinitrc
.xinitrc に以下を追記する。
---------------------------------------------
xset +fp /usr/share/fonts/shinonome/
---------------------------------------------
.xinitrc に以下を追記する。
---------------------------------------------
xset +fp /usr/share/fonts/shinonome/
---------------------------------------------
(D) Xfce メニューから xterm を呼び出すときの設定
(HOME)/.local/share/applications/xterm.desktop の Exec行を以下のように修正する。
----------------------------------------------
Exec=xterm -sb -rightbar -fn shnm14u -selbg "rgb:ff/ff/55" -geometry 100x31+100+260
----------------------------------------------
(HOME)/.local/share/applications/xterm.desktop の Exec行を以下のように修正する。
----------------------------------------------
Exec=xterm -sb -rightbar -fn shnm14u -selbg "rgb:ff/ff/55" -geometry 100x31+100+260
----------------------------------------------
*上述設定で xterm を起動した参考画像
最新記事
アーカイブ