add mozc and furnace

This commit is contained in:
~keith 2023-03-28 12:19:33 +00:00
parent 20e7222330
commit ce49af0433
Signed by: keith
GPG Key ID: 5BEBEEAB2C73D520
3 changed files with 529 additions and 0 deletions

5
app-i18n/mozc/Manifest Normal file
View File

@ -0,0 +1,5 @@
DIST abseil-cpp-215105818dfde3174fe799600bb0f3cae233d0bf.tar.gz 1883165 BLAKE2B 36a846c6fa7564c120e4a93093d83e3dae4b719a29516512191d4b21fc27b093132de8e4017c728b15d843eb962c269a7e79be2bfae74a4f7cee5d6c6caa0f05 SHA512 75d234eac76be8790cf09e3e1144e4b4cf5cacb61e46961a9e4a35b37d0fa85243afdd5de5f47a006ef96af6fc91ecc0c233297c4c32258c08d46304b3361330
DIST fcitx-mozc-2.26.4632-20220202104242.tar.gz 37072322 BLAKE2B 10280dbaeec2e56dfe63e9a129d2bec14ad03dc85eee420f7b77c74ede3ee1ef9bee28f5b077f31aa38c3efa7d06e9c7e1aedb0387f21442abe7d8c43d93c007 SHA512 ed889dd0e992e23c27c7d050d2d018183841bb7fbfc9d244bc2971878a6c34562ffeb6eb8f5dbc53ecd81a4997d65412f5861edf04e58dcbff494dd906d6a275
DIST japanese-usage-dictionary-20180701040110.tar.gz 71285 BLAKE2B dfad056a1d5061b6764f583da15b9ad60a3c4421cee0430c4665d1c2779a64f9b31473c1746a3e2b9bda5167349432e51dcf7d4d48f75fde9543e9c16ff74c0d SHA512 68b4d3f52dd6cd4f00a8012a870b4f5929519cd69815b1729f3881d1f964802308f4aa101e236824b4c0f832183a9e8097437ed620403f2a652f126e7cdc1eb3
DIST mozc-2.26.4632-20220130192938.tar.gz 36999192 BLAKE2B 5629ec575d502ed20f8653538fc55e77360298ceb7620c4c3e70867d1b2b7da65dc62e1d70969fbec88244a285e7e095909922077d34f66480bf4703e8c5f2f8 SHA512 43686e37a036b02b2691fd065ab0013532d0555417401d24f98f715c028ba8a6b99434675b5bfe2bffb7db310625968bba35d4e63a480851e2e4555914e0a053
DIST mozcdic-ut-20220206.tar.bz2 19629306 BLAKE2B 1f63bc7669d0038e92f09dbaaef4f581711112ac7bfec49da1a9cc800f88fb1c11f2a31901e0fd7e4e181a19f50e35c2499b634e9e9b9843ec2498e3736badd1 SHA512 d3f59a62ccd385dd2fb6b3cc1d2dd79e004d80088819e50ad4bc13c8be7375688f6b6d17bba4c32628e13d47fc55a2e159f25d5cbe44430fb0e821a998c9136d

View File

@ -0,0 +1,457 @@
# Copyright 2010-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
PYTHON_COMPAT=( python3_{9..10} )
inherit elisp-common multiprocessing python-any-r1 toolchain-funcs
if [[ "${PV}" == "9999" ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/google/mozc"
EGIT_SUBMODULES=(src/third_party/japanese_usage_dictionary)
else
MOZC_GIT_REVISION="7329757e1ad30e327c1ae823a8302c79482d6b9c"
MOZC_DATE="${PV#*_p}"
MOZC_DATE="${MOZC_DATE%%_p*}"
FCITX_MOZC_GIT_REVISION="4d2e3bdc0a2e99197f03cf241924639fef1378f0"
FCITX_MOZC_DATE="${PV#*_p}"
FCITX_MOZC_DATE="${FCITX_MOZC_DATE#*_p}"
FCITX_MOZC_DATE="${FCITX_MOZC_DATE%%_p*}"
JAPANESE_USAGE_DICTIONARY_GIT_REVISION="a4a66772e33746b91e99caceecced9a28507e925"
JAPANESE_USAGE_DICTIONARY_DATE="20180701040110"
ABSEIL_GIT_REVISION="215105818dfde3174fe799600bb0f3cae233d0bf"
UT_DICT_VER="20220206"
fi
DESCRIPTION="Mozc - Japanese input method editor"
HOMEPAGE="https://github.com/google/mozc"
if [[ "${PV}" == "9999" ]]; then
SRC_URI=""
else
SRC_URI="https://github.com/google/mozc/archive/${MOZC_GIT_REVISION}.tar.gz -> ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz
https://github.com/abseil/abseil-cpp/archive/${ABSEIL_GIT_REVISION}.tar.gz -> abseil-cpp-${ABSEIL_GIT_REVISION}.tar.gz
https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}.tar.gz -> japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
fcitx5? ( https://github.com/fcitx/mozc/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )
ut? ( https://osdn.net/downloads/users/37/37667/mozcdic-ut-${UT_DICT_VER}.tar.bz2 -> mozcdic-ut-${UT_DICT_VER}.tar.bz2 )"
fi
# Mozc: BSD
# src/data/dictionary_oss: ipadic, public-domain
# src/data/unicode: unicode
# japanese-usage-dictionary: BSD-2
LICENSE="BSD BSD-2 ipadic public-domain unicode"
SLOT="0"
KEYWORDS="amd64 ~arm64 ~ppc64 x86"
IUSE="debug emacs fcitx4 fcitx5 ut +gui ibus renderer test"
REQUIRED_USE="|| ( emacs fcitx4 fcitx5 ibus )"
RESTRICT="!test? ( test )"
# TODO: Proper deps for FCITX5
BDEPEND="$(python_gen_any_dep 'dev-python/six[${PYTHON_USEDEP}]')
>=dev-libs/protobuf-3.0.0
dev-util/gyp
dev-util/ninja
virtual/pkgconfig
emacs? ( app-editors/emacs:* )
fcitx4? ( sys-devel/gettext )"
DEPEND="
>=dev-libs/protobuf-3.0.0:=
fcitx4? (
app-i18n/fcitx:4
virtual/libintl
)
fcitx5? (
app-i18n/fcitx5:5
)
gui? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtwidgets:5
)
ibus? (
>=app-i18n/ibus-1.4.1
dev-libs/glib:2
x11-libs/libxcb
)
renderer? (
dev-libs/glib:2
x11-libs/cairo
x11-libs/gtk+:2
x11-libs/pango
)
test? (
>=dev-cpp/gtest-1.8.0
dev-libs/jsoncpp
)"
RDEPEND="
>=dev-libs/protobuf-3.0.0:=
emacs? ( app-editors/emacs:* )
fcitx4? (
app-i18n/fcitx:4
virtual/libintl
)
fcitx5? (
app-i18n/fcitx5:5
)
gui? (
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtwidgets:5
)
ibus? (
>=app-i18n/ibus-1.4.1
dev-libs/glib:2
x11-libs/libxcb
)
renderer? (
dev-libs/glib:2
x11-libs/cairo
x11-libs/gtk+:2
x11-libs/pango
)"
S="${WORKDIR}/${P}/src"
SITEFILE="50${PN}-gentoo.el"
execute() {
einfo "$@"
"$@"
}
python_check_deps() {
has_version -b "dev-python/six[${PYTHON_USEDEP}]"
}
src_unpack() {
if [[ "${PV}" == "9999" ]]; then
git-r3_src_unpack
if use fcitx4 || use fcitx5; then
local EGIT_SUBMODULES=()
git-r3_fetch https://github.com/fcitx/mozc refs/heads/fcitx
git-r3_checkout https://github.com/fcitx/mozc "${WORKDIR}/fcitx-mozc"
fi
else
unpack ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz
mv mozc-${MOZC_GIT_REVISION} ${P} || die
unpack japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
cp -p japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}/usage_dict.txt ${P}/src/third_party/japanese_usage_dictionary || die
unpack abseil-cpp-${ABSEIL_GIT_REVISION}.tar.gz
rmdir ${P}/src/third_party/abseil-cpp
mv abseil-cpp-${ABSEIL_GIT_REVISION} ${P}/src/third_party/abseil-cpp
if use fcitx4 || use fcitx5; then
unpack fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz
mv mozc-${FCITX_MOZC_GIT_REVISION} fcitx-${PN}
fi
if use ut; then
unpack mozcdic-ut-${UT_DICT_VER}.tar.bz2
cat mozcdic-ut-${UT_DICT_VER}/mozcdic-ut-${UT_DICT_VER}.txt >> ${P}/src/data/dictionary_oss/dictionary00.txt
fi
fi
}
src_prepare() {
if use fcitx4; then
cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx" unix || die
fi
if use fcitx5; then
cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx5" unix || die
fi
pushd "${WORKDIR}/${P}" > /dev/null || die
# eapply "${FILESDIR}/${PN}-2.26.4220-system_abseil-cpp.patch"
# eapply "${FILESDIR}/${PN}-2.26.4220-system_gtest.patch"
# eapply "${FILESDIR}/${PN}-2.26.4220-system_jsoncpp.patch"
# eapply "${FILESDIR}/${PN}-2.26.4220-environmental_variables.patch"
# eapply "${FILESDIR}/${PN}-2.26.4220-server_path_check.patch"
eapply_user
popd > /dev/null || die
sed \
-e "s/def GypMain(options, unused_args):/def GypMain(options, gyp_args):/" \
-e "s/RunOrDie(gyp_command + gyp_options)/RunOrDie(gyp_command + gyp_options + gyp_args)/" \
-e "s/RunOrDie(\[ninja/&, '-j$(makeopts_jobs)', '-l$(makeopts_loadavg "${MAKEOPTS}" 0)', '-v'/" \
-i build_mozc.py || die
local ar=($(tc-getAR))
local cc=($(tc-getCC))
local cxx=($(tc-getCXX))
local ld=($(tc-getLD))
local nm=($(tc-getNM))
local readelf=($(tc-getREADELF))
# Use absolute paths. Non-absolute paths are mishandled by GYP.
ar[0]=$(type -P ${ar[0]})
cc[0]=$(type -P ${cc[0]})
cxx[0]=$(type -P ${cxx[0]})
ld[0]=$(type -P ${ld[0]})
nm[0]=$(type -P ${nm[0]})
readelf[0]=$(type -P ${readelf[0]})
sed \
-e "s:<!(which ar):${ar[@]}:" \
-e "s:<!(which clang):${cc[@]}:" \
-e "s:<!(which clang++):${cxx[@]}:" \
-e "s:<!(which ld):${ld[@]}:" \
-e "s:<!(which nm):${nm[@]}:" \
-e "s:<!(which readelf):${readelf[@]}:" \
-i gyp/common.gypi || die
# https://github.com/google/mozc/issues/489
sed \
-e "/'-lc++'/d" \
-e "/'-stdlib=libc++'/d" \
-i gyp/common.gypi || die
}
src_configure() {
if use debug; then
BUILD_TYPE="Debug"
else
BUILD_TYPE="Release"
fi
local gyp_arguments=()
if tc-is-gcc; then
gyp_arguments+=(-D compiler_host=gcc -D compiler_target=gcc)
elif tc-is-clang; then
gyp_arguments+=(-D compiler_host=clang -D compiler_target=clang)
else
gyp_arguments+=(-D compiler_host=unknown -D compiler_target=unknown)
fi
gyp_arguments+=(-D debug_extra_cflags=)
gyp_arguments+=(-D release_extra_cflags=)
gyp_arguments+=(-D use_fcitx=$(usex fcitx4 YES NO))
gyp_arguments+=(-D use_fcitx5=$(usex fcitx5 YES NO))
gyp_arguments+=(-D use_libibus=$(usex ibus 1 0))
gyp_arguments+=(-D use_libprotobuf=1)
gyp_arguments+=(-D use_system_abseil_cpp=0)
gyp_arguments+=(-D use_system_gtest=$(usex test 1 0))
gyp_arguments+=(-D use_system_jsoncpp=$(usex test 1 0))
gyp_arguments+=(-D enable_gtk_renderer=$(usex renderer 1 0))
gyp_arguments+=(-D server_dir="${EPREFIX}/usr/libexec/mozc")
gyp_arguments+=(-D document_dir="${EPREFIX}/usr/libexec/mozc/documents")
if use ibus; then
gyp_arguments+=(-D ibus_mozc_path="${EPREFIX}/usr/libexec/ibus-engine-mozc")
gyp_arguments+=(-D ibus_mozc_icon_path="${EPREFIX}/usr/share/ibus-mozc/product_icon.png")
fi
unset AR CC CXX LD NM READELF
execute "${PYTHON}" build_mozc.py gyp \
--gypdir="${EPREFIX}/usr/bin" \
--server_dir="${EPREFIX}/usr/libexec/mozc" \
--verbose \
$(usex gui "" --noqt) \
-- "${gyp_arguments[@]}" || die "Configuration failed"
}
src_compile() {
local targets=(server/server.gyp:mozc_server base/absl.gyp:absl_base)
if use emacs; then
targets+=(unix/emacs/emacs.gyp:mozc_emacs_helper)
fi
if use fcitx4; then
targets+=(unix/fcitx/fcitx.gyp:fcitx-mozc)
fi
if use fcitx5; then
# TODO: is this right?
targets+=(unix/fcitx5/fcitx5.gyp:fcitx5-mozc)
fi
if use gui; then
targets+=(gui/gui.gyp:mozc_tool)
fi
if use ibus; then
targets+=(unix/ibus/ibus.gyp:ibus_mozc)
fi
if use renderer; then
targets+=(renderer/renderer.gyp:mozc_renderer)
fi
if use test; then
targets+=(gyp/tests.gyp:unittests)
fi
execute "${PYTHON}" build_mozc.py build -c ${BUILD_TYPE} -v "${targets[@]}" || die "Building failed"
if use emacs; then
elisp-compile unix/emacs/*.el
fi
}
src_test() {
execute "${PYTHON}" build_mozc.py runtests -c ${BUILD_TYPE} --test_jobs 1 || die "Testing failed"
}
src_install() {
exeinto /usr/libexec/mozc
doexe out_linux/${BUILD_TYPE}/mozc_server
if use gui; then
doexe out_linux/${BUILD_TYPE}/mozc_tool
fi
if use renderer; then
doexe out_linux/${BUILD_TYPE}/mozc_renderer
fi
insinto /usr/libexec/mozc/documents
doins data/installer/credits_en.html
if use emacs; then
dobin out_linux/${BUILD_TYPE}/mozc_emacs_helper
elisp-install ${PN} unix/emacs/*.{el,elc}
elisp-site-file-install "${FILESDIR}/${SITEFILE}" ${PN}
fi
if use fcitx4; then
exeinto /usr/$(get_libdir)/fcitx
doexe out_linux/${BUILD_TYPE}/fcitx-mozc.so
insinto /usr/share/fcitx/addon
newins unix/fcitx/fcitx-mozc.conf mozc.conf
insinto /usr/share/fcitx/inputmethod
doins unix/fcitx/mozc.conf
insinto /usr/share/fcitx/mozc/icon
newins data/images/product_icon_32bpp-128.png mozc.png
local image
for image in ../../fcitx-${PN}/src/data/images/unix/ui-*.png; do
newins "${image}" "mozc-${image#../../fcitx-${PN}/src/data/images/unix/ui-}"
done
local locale mo_file
for mo_file in out_linux/${BUILD_TYPE}/gen/unix/fcitx/po/*.mo; do
locale="${mo_file##*/}"
locale="${locale%.mo}"
insinto /usr/share/locale/${locale}/LC_MESSAGES
newins "${mo_file}" fcitx-mozc.mo
done
fi
if use fcitx5; then
exeinto /usr/$(get_libdir)/fcitx5
doexe out_linux/${BUILD_TYPE}/fcitx5-mozc.so
insinto /usr/share/fcitx5/addon
doins unix/fcitx5/mozc-addon.conf
insinto /usr/share/fcitx5/inputmethod
doins unix/fcitx5/mozc.conf
insinto /usr/share/icons/hicolor/128x128/apps
newins data/images/product_icon_32bpp-128.png org.fcitx.Fcitx5.fcitx-mozc.png
insinto /usr/share/icons/hicolor/scalable/apps
newins data/images/full_ascii.svg org.fcitx.Fcitx5.fcitx-mozc-alpha-full.svg
newins data/images/half_ascii.svg org.fcitx.Fcitx5.fcitx-mozc-alpha-half.svg
newins data/images/direct.svg org.fcitx.Fcitx5.fcitx-mozc-direct.svg
newins data/images/hiragana.svg org.fcitx.Fcitx5.fcitx-mozc-hiragana.svg
newins data/images/full_katakana.svg org.fcitx.Fcitx5.fcitx-mozc-katakana-full.svg
newins data/images/half_katakana.svg org.fcitx.Fcitx5.fcitx-mozc-katakana-half.svg
# TODO: how to get dictionary, properties, tool?
local icnpath=/usr/share/icons/hicolor/scalable/apps
dosym org.fcitx.Fcitx5.fcitx-mozc-alpha-full.svg ${icnpath}/fcitx-mozc-alpha-full.svg
dosym org.fcitx.Fcitx5.fcitx-mozc-alpha-half.svg ${icnpath}/fcitx-mozc-alpha-half.svg
dosym org.fcitx.Fcitx5.fcitx-mozc-direct.svg ${icnpath}/fcitx-mozc-direct.svg
dosym org.fcitx.Fcitx5.fcitx-mozc-hiragana.svg ${icnpath}/fcitx-mozc-hiragana.svg
dosym org.fcitx.Fcitx5.fcitx-mozc-katakana-full.svg ${icnpath}/fcitx-mozc-katakana-full.svg
dosym org.fcitx.Fcitx5.fcitx-mozc-katakana-half.svg ${icnpath}/fcitx-mozc-katakana-half.svg
msgfmt --xml -d unix/fcitx5/po/ --template unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml.in -o unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml
insinto /usr/share/metainfo
doins unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml
local locale po_file mo_file
for po_file in unix/fcitx5/po/*.po; do
locale="${po_file##*/}"
locale="${locale%.po}"
mo_file=${po_file/.po/.mo}
msgfmt ${po_file} -o ${mo_file}
insinto /usr/share/locale/${locale}/LC_MESSAGES
newins "${mo_file}" fcitx5-mozc.mo
done
fi
if use ibus; then
exeinto /usr/libexec
newexe out_linux/${BUILD_TYPE}/ibus_mozc ibus-engine-mozc
insinto /usr/share/ibus/component
doins out_linux/${BUILD_TYPE}/gen/unix/ibus/mozc.xml
insinto /usr/share/ibus-mozc
newins data/images/unix/ime_product_icon_opensource-32.png product_icon.png
local image
for image in data/images/unix/ui-*.png; do
newins "${image}" "${image#data/images/unix/ui-}"
done
fi
}
pkg_postinst() {
elog
elog "ENVIRONMENTAL VARIABLES"
elog
elog "MOZC_SERVER_DIRECTORY"
elog " Mozc server directory"
elog " Value used by default: \"${EPREFIX}/usr/libexec/mozc\""
elog "MOZC_DOCUMENTS_DIRECTORY"
elog " Mozc documents directory"
elog " Value used by default: \"${EPREFIX}/usr/libexec/mozc/documents\""
elog "MOZC_CONFIGURATION_DIRECTORY"
elog " Mozc configuration directory"
elog " Value used by default: \"~/.mozc\""
elog
if use emacs; then
elog
elog "USAGE IN EMACS"
elog
elog "mozc-mode is minor mode to input Japanese text using Mozc server."
elog "mozc-mode can be used via LEIM (Library of Emacs Input Method)."
elog
elog "In order to use mozc-mode by default, the following settings should be added to"
elog "Emacs init file (~/.emacs.d/init.el or ~/.emacs):"
elog
elog " (require 'mozc)"
elog " (set-language-environment \"Japanese\")"
elog " (setq default-input-method \"japanese-mozc\")"
elog
elog "With the above settings, typing C-\\ (which is bound to \"toggle-input-method\""
elog "by default) will enable mozc-mode."
elog
elog "Alternatively, at run time, after loading mozc.el, mozc-mode can be activated by"
elog "calling \"set-input-method\" and entering \"japanese-mozc\"."
elog
elisp-site-regen
fi
xdg_icon_cache_update
}
pkg_postrm() {
xdg_icon_cache_update
if use emacs; then
elisp-site-regen
fi
}

View File

@ -0,0 +1,67 @@
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake git-r3
DESCRIPTION="A multi-system chiptune tracker compatible with DefleMask modules"
HOMEPAGE="https://github.com/tildearrow/furnace"
EGIT_REPO_URI="https://github.com/tildearrow/furnace.git"
EGIT_COMMIT="v0.6pre1.5"
EGIT_SUBMODULES=( '*' '-extern/SDL' '-extern/fmt' '-extern/libsndfile' )
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
DEPEND="
midi? ( media-libs/rtmidi )
>=media-libs/libsdl2-2.0.18
>=sci-libs/fftw-3.3
>=dev-libs/libfmt-7.1.0
media-libs/libsndfile
sys-libs/zlib
media-libs/alsa-lib
pulseaudio? ( media-libs/libpulse )
x11-libs/libX11
virtual/opengl
jack? ( virtual/jack )
"
RDEPEND="${DEPEND}"
BDEPEND=""
IUSE="jack midi pulseaudio +demos +instruments"
src_configure() {
local mycmakeargs=(
-DSYSTEM_FFTW=ON
-DSYSTEM_FMT=ON
-DSYSTEM_LIBSNDFILE=ON
-DSYSTEM_RTMIDI=ON
-DSYSTEM_ZLIB=ON
-DSYSTEM_SDL2=ON
)
BUILD_DIR="${WORKDIR}/build"
if use midi; then
mycmakeargs+=( -DUSE_RTMIDI=ON )
else
mycmakeargs+=( -DUSE_RTMIDI=OFF )
fi
if use jack; then
mycmakeargs+=( -DWITH_JACK=ON )
else
mycmakeargs+=( -DWITH_JACK=OFF )
fi
if use demos; then
mycmakeargs+=( -DWITH_DEMOS=ON )
else
mycmakeargs+=( -DWITH_DEMOS=OFF )
fi
if use instruments; then
mycmakeargs+=( -DWITH_INSTRUMENTS=ON )
else
mycmakeargs+=( -DWITH_INSTRUMENTS=OFF )
fi
cmake_src_configure
}