commit: ff6b08e448e56c638625c67ad6f6dca2066caf77 Author: Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr> AuthorDate: Thu Aug 28 21:26:41 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu Oct 9 21:47:12 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff6b08e4
app-i18n/mozc: add 2.31.5851.102, bazel build system use bazel build system instead of gyp, deprecated. bazel with prebuilt binary from upstream (amd64, arm64) all deps except ibus/glib/qt/fcitx5 are fetched by bazel from bazel_dist, unpacked/prepared in bazel_cache and then built statically. to push a new release, update versions according to MODULE.bazel or failures of the fetch's phase of bazel. patches : fix path for mozc_tool to preserve compatibility with versions in tree fix shebang, one patch for rules_python, oneother for MODULE.bazel to apply the first one. This is the only way to patch deps unpacked/prepared in bazel_cache. Closes: https://bugs.gentoo.org/943518 Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr> Part-of: https://github.com/gentoo/gentoo/pull/43597 Signed-off-by: Sam James <sam <AT> gentoo.org> app-i18n/mozc/Manifest | 34 ++ ...ozc-2.31.5851.102-bazel_patch-fix_shebang.patch | 13 + .../mozc/files/mozc-2.31.5851.102-fix_path.patch | 12 + .../mozc-2.31.5851.102-patch_rules_python.patch | 17 + app-i18n/mozc/mozc-2.31.5851.102.ebuild | 409 +++++++++++++++++++++ 5 files changed, 485 insertions(+) diff --git a/app-i18n/mozc/Manifest b/app-i18n/mozc/Manifest index 29bb052622e7..acaa12aed647 100644 --- a/app-i18n/mozc/Manifest +++ b/app-i18n/mozc/Manifest @@ -1,4 +1,38 @@ +DIST abseil-cpp-20250127.0.tar.gz 2267275 BLAKE2B 70fa05a0db91b9e7ccf9f2828a7bf4b7fe6d7177b5f2d17b2f2f6f2a5e83289674d624fa7983410713a2d62b1025a5b5d957f1ba11e01cb727fc771ce76bc914 SHA512 2a021faad807ee3e23548716ffa4785dc2409edbb4be676cc4bc01d47885760de340f0a4afdcbf0aaa835affd6d78f7bc319bbf7d337dbc30e7a559d0088e4bd +DIST apple_support.1.16.0.tar.gz 86001 BLAKE2B 808539ad8ade84d1bed93654c25a41878bf75485cc4404a21ca9286eadb842cc37360aa85632d1c16ef176b32e2853f372124b266354961ffe5060afb0101311 SHA512 93281a271103dfc860e11bb1c8f72d3d3aeb129f3d4bfed8acc6b99fc1727f820fc0c7feaa336c03e5b935c5c39296c361cbc3abd58756a420d518dc1cb4808f +DIST bazel-8.1.1-linux-arm64 60105888 BLAKE2B 5da13dafdff092d9d1846aae2c3cad0dca0dbf6b4cd1e1108beb6c1559cc87fb362b2ee04ce6af37e5dc2b1bcf49a42f164b7f57b0f614eb5654382907708825 SHA512 ec6efe3bdd59ea5ca918854c19d7b85bc6ae71c0b8291106618785213cdddf48ca6fc4056e51336e07fe221fa53c57c7cb0fdcd2c5d72240526c50447847af73 +DIST bazel-8.1.1-linux-x86_64 61797304 BLAKE2B 54c0bea5572bc7a13435e89dc30ad291bf37801d38a65110c708d9b0e0942e60d28d4b64a9df6e5253e50affeedda45ee313643c674f8c1a7f3d06db60ab01db SHA512 9133ce3d0de0cc1f1d48fbf43e9b37a38bfdd025786ce223c2cd0b7be7d8034c5cb66f482946300f657fecfe3f1b90de14233b9296f9840a34d97a4241caeeca +DIST bazel-skylib-1.7.1.tar.gz 43566 BLAKE2B 2bafd7dc9aed2852227b1ec2fed91767461d8133338794e4633041263bd3ea1a6ad3665f4723237ba32d9f18ef670efd73f14c8cb273abc1e02846a0f3428e79 SHA512 cb786ab69e288d789ab056e41c663662d6f42c619f3464869f016b01eacd912f730d49fec986dfdd61c630167a697b52c74c4eebc70e69cce4369087aea62ef9 +DIST bazel_features-v1.21.0.tar.gz 15880 BLAKE2B dfdba846d9411f0779f6170775d81b1fa34f3f71a094535745f3c132e406e96050a54248f514356e3b0ed979e789aab923c43751023771330c8f43bcce009be5 SHA512 0cd72b38335acf00f203446ee4618aad2d4bcb9df7059ea7196261a42b988b4d63a5ce6eac70fda49f0ecc3058e0f75ed277e3d40991d82b55c4556028ed95bc +DIST cpython-3.11.10+20241016-aarch64-unknown-linux-gnu-install_only.tar.gz 25925656 BLAKE2B aa9c3df9c853b80a0e74ce5c3522e7f4c380a5409de521650dbd5ead81659040cfb77271dee4c5079905f742d33410c86193e9a97283b8e1b76b11fb7533943c SHA512 2317beda197edfd671690018069cd404bcf745e1156c79cddad36973117905ec50a67a668060e2fda02615561f824646fd4df5010cf06688d6160c2ad891863c +DIST cpython-3.11.10+20241016-x86_64-unknown-linux-gnu-install_only.tar.gz 29718798 BLAKE2B cc5c8c49bc58dee4562438ca22d0cf91540942e6f6525d581077e7e447d428b6cd0d846ebf38367c0c47b9886bfd96da868a3f09845f2d0e1164932d249fa37d SHA512 0249257a1c50e58cfddd76bfc89a437e02fdae367c3949a9fb678bb9314f149d0c7e3c257a8c0db33d68008315f8ccd0da2aba47f583e19c8ce6c403771ec14a DIST fcitx-mozc-2.28.5029.102-2.28.5029.102.tar.gz 37246575 BLAKE2B 54381968e33870f2d9f769184cf49428548d04de66e767140c8f053fad7873f1b2e3b02be81ce54e51b824d2c9cd971da37bff8b60efe60c9e2c748ff298afbd SHA512 4962e9505b79d4680a260c257719ba2486a6fe127018298758728faa9535504bc2dd6b1bfb430ac2982cb377cda52c145430531afd0968f49f91d366fdd43d92 +DIST googletest-1.15.2.tar.gz 872667 BLAKE2B 2525d7a8572364cc2c2c129197201fc31e3cb4aadf4be37a995447a9b8e393205628e666dd190dca9a169b693883a5a2a5cafd6432cc3d1263a0c834ff8cf121 SHA512 9046841044a2bf7edfd96854ad9c44ffae4fcb9fb59a075b367507c0762a98eb32cb6968d46663228272e26321e96f4dd287c95baa22c6af9bad902b8b6ede4e DIST japanese-usage-dictionary-20180701040110.tar.gz 71285 BLAKE2B dfad056a1d5061b6764f583da15b9ad60a3c4421cee0430c4665d1c2779a64f9b31473c1746a3e2b9bda5167349432e51dcf7d4d48f75fde9543e9c16ff74c0d SHA512 68b4d3f52dd6cd4f00a8012a870b4f5929519cd69815b1729f3881d1f964802308f4aa101e236824b4c0f832183a9e8097437ed620403f2a652f126e7cdc1eb3 +DIST japanese-usage-dictionary-2025-01-25.zip 72776 BLAKE2B 8a0813fa8a6b179be96894e011635e905b876cd4e54917fcb00b12b81f3f7463392a2f37c6c58279fddc6681c5df95bd2f7eb266f02557537f22705002050091 SHA512 e2d71432836855192bee9ccf45781aef797d0112a0444684c782a5310cec35ff96793c2d4aba80ad2e71b789839f4fa1c70eb175be09a1c92e747639b0f6ab3e DIST mozc-2.28.5029.102-2.28.5029.102.tar.gz 37247099 BLAKE2B 4bb528991102d34a26321e6fa00a73cc83cb103e0b765f1ebb837dd6894387288b13ed75cc255003d07d6f0c4a82f963684fa4f2bd9b5043cfaddb57a5f5cef0 SHA512 b20aa45757db92f66d1c135eacf907b4cec937226a8d09e5f9f6768ae22a6b8464e3b75276773ce55413f2002ffcc3d8cae136e7fd3acfc0733e48bccf848d5b DIST mozc-2.28.5029.102-patches.tar.xz 224380 BLAKE2B 377d2cac6ec8a9c90661f10c0b105d8347ca8080ec43cee3dfd4660feadfe2d9b204d6e4b9e22bd11a5fdbbf26e7f6f298b703b88fb1621ea1847741408c1953 SHA512 5836a19ea68de271475b3ca1efce928b0ad012c96ff7ecdc4474b05daf8b8df022203eb46ec839b76e7d50be7a75b8f278d534d762fac0e612a8f09ae13c7c16 +DIST mozc-2.31.5851.102-dictionary.png 205 BLAKE2B f92fdeae34eff41473c6c9b0f6fb5a3c784b7b98fd6932b03953131f78ab97c961eb94f88e542f593acf0d2af176e28a3d638e50e912aa695de882477117b2d6 SHA512 aac820bbf51b2dfe23a9e0de57c2c9f4301e021c3ae29047ec8918ccb22b698f775ceee1dfe5ceaf21ada9228085ae1a36e65ab33fd811acf072e4d380225d9c +DIST mozc-2.31.5851.102-dictionary.svg 294 BLAKE2B 24464c7238fc58056c4c9e94f72c9ece8313a09ef1fd57f07b2178dcf78b722fff4965d42ac867c135db969a905306f99e7d6e4f5c028029646b77d6eee3de33 SHA512 648b486ec244c117ae25aadbff1f14211a311df37161b7777c442aff2f7f8dd61d41912d81891a0de29383e3430ee80ecdad7d9b1fb9e0ea7addcbf97af018c3 +DIST mozc-2.31.5851.102-jigyosyo.zip 773836 BLAKE2B 0ba255d0cce6d44a8d87409867ee61c0e4ff49546dd9b530ba83ad523220edb2b53ac23b2d30bd2ce32bbeb3c0c9f576648b7f2fb3bfd36ddf7af39f64890e13 SHA512 8bae9f210c6795af933dd2b50efc1dda614f4dfdc4fa8d645a1612c7f365e1450800855677f0f2b27b386d5cc5091cd9e7381e8cf4603a4e2fc60ecbe0825b7b +DIST mozc-2.31.5851.102-ken_all.zip 1694045 BLAKE2B 6353dd7b1888f2186b56d854ea0f8ec84e3a0979b5ff2621e8ad406b8f9f3818d696a4f9ff5c97ae52191ce248be5beedf56831ecf906413834bcb3cf10603d6 SHA512 2a2acffb345b35236e872fcc43faf77008cf8fcad01d17a2b080f3599a6d75cff4e166ee049b81161ab32ad1437501a7b130de8b86b71d15c5689f282f7e86da +DIST mozc-2.31.5851.102-properties.png 557 BLAKE2B 33a12b009e0dff7a46385a59287a8d179ec931e6cd98a5b13480ade870035259928d8655ca578954307a76eca92ea98dbe4ec4f904f2074c21c848b3a2b6f0d7 SHA512 1cbd9307f0e96c1255c1cb915d10d2254281574c8fcf54e97a518d3a49475cc7775d6f4042a04e2358f7db5808986eef9cd9b84fff571dce1b9ec23f8fb3a8fd +DIST mozc-2.31.5851.102-properties.svg 812 BLAKE2B 17f3facef4594c38b94a3be325d7a00d5538c4f098853b5e70254b572305440adbba7e597cee4645ffd1884631cab5ff50dd25a5368b7aff1972290e6ceaab91 SHA512 637b8ec750fa0a5a32afbcefb43430d122de889d32ce6295327934dede6051d1a37678a895b8c2fa26ab0c28f5a372e7b6ca0aad7acebaf64cc5a88c32ff43de +DIST mozc-2.31.5851.102-tool.png 360 BLAKE2B e699107fb3d5d8fd202ea8f65908a63b2d9b8c5aa4eaeed0db15a5bc5eb4af4735814f20b8e641736b08fbee2691836a5d5e8b94b4b653aac836f8afa982b791 SHA512 35f270784ff7b947aa3636d9531c502775315116f694f95a21a93ef9bf77d67ab7b194153b186a8371a78ce8b162ca82fb232aea92dc37ba2de86c79fe8f19b1 +DIST mozc-2.31.5851.102-tool.svg 326 BLAKE2B df5947d23720f168d40403c00dc20e547ae30dd8f92c8448d5675fe28344903a65e139c4739c83fa64db9233b012ddcd3e5ad663d96417a8dcb4b83ba020d4ad SHA512 471ae428ca8312b4ecc8ab3f7348f89b2778e853a3106e21b5027b5fa23d8ea2eb301a18d64203af52e4ca8bfe51f184966e01670c514dc019a649c5f557e08a +DIST mozc-2.31.5851.102.tar.gz 28443744 BLAKE2B a00530f469d15b897221673c96132386063f7a649f72f4ce467e17f50bb7f972051160a438f3e0aa930af9610d15a4cf2d6b68538a25a5515165d98a3d1da44b SHA512 468c5bdac8ef767b8872b794f76bcad675798ea2f423893bbb21212840cf78fd9498304ac2ee4c524c35a7f4478f0a7f5df4abdab0861c5308ff2c53fa996c15 +DIST mozc-bcr-b553f46a71d17fe8f32661f64e755cf6fac03ada.tar.gz 3374577 BLAKE2B 20722deebafffe44f39246c2a2ca11af155585871106fd182f77fba010d5bab907107f078dbba667dfb9f38c375896322fa0b5c1b51fc5b0aef18d99c48d4f7d SHA512 45dea3670a932e370f9ffcd98a5b99e988dfe16fa7140d71230a27bd83b97343dc4dcf96a14ed3bdd50cb17976e484699dbd4e1ffc5b1aba420c16f00f05a37e +DIST mozc-fcitx5-2.31.5851.102.tar.gz 28530201 BLAKE2B 4f42970b2bde2173d49cccaefafff0d65c792934b923dc5cbced83de143a5622fa0b9aca672a8e2b536cd5601100754740b09ea2953d00b662f5dc9e04f0f704 SHA512 d60b3d11110acb6e838300ecaa398b8abd652e9ad7a94bd0e2bbaf8cf7d217aaa62241916a607c4f8cf0fe6e9434a31b7fb8dae2a3cd7e20e0022fda137946f1 +DIST platforms-0.0.10.tar.gz 7680 BLAKE2B dd19db938cc7efe706c94f8149265952ecafe7e2811e84924377b1b1f0138e7104da2252d64a4dc03f66d8a3284716fa09888721294d885de852a69324fcb596 SHA512 a92e54fccebc6ac9715be6ffb09f0bb20d402de4837ad5002e9c292b54f8b84a573b049c0e8192f955bb51b19c9926a3affc880f3d4dce28f535f97241b0663f +DIST protobuf-29.3.zip 11127807 BLAKE2B 1889a4948335a5a27e6dee0549bab3f226e634eb8dbce97830b1aa84787026258c135431241afcbfebbe2433ce933d0733bebeeb990c5b5924f09d5e625edb43 SHA512 09cb3eed78d41444b336e5a7bbcc1ca3679ad7c625ecdceb6d5d3b6430baa924b7da3dd4befdf068f2124ecf9fe986f1cc4d7b3b97177a8117af0acb182e63c8 +DIST rules_android_ndk-v0.1.3.tar.gz 25611 BLAKE2B bfad0cd27fc9bc2971663a197300794aef7f330659500a69a95a89a0ccdbc547ff4e6760104a1398b3a9981a38facc6a64aeac7b1e55a27bcf44f4eafd19a63c SHA512 6fc90f12ff4736a50e058b1d675b47fe2bb63320b27c42c3be996c52b0076e17248ce246849cc264cd96418c046d54075ebf8ee2ddb3b74b8813d605e8968135 +DIST rules_apple.3.16.1.tar.gz 2387851 BLAKE2B 0ce5d0d2f0d048d6e462ef4f1e5553e9c4ab8e46d67d79cf12cbc20ed8cf741a0d9bf36a04759b2a9b59ed9021772fa70cf21c2ba4d5dd0e93560bf60c7bd19c SHA512 11523401df02c6b863c625e24ae78b54348ec958c253bec412adc4873f654c830bb7049d500d94e6ce890695899598eb7f785653cbdf264903ba7dd40496a783 +DIST rules_cc-0.0.17.tar.gz 178823 BLAKE2B 7e544f1752e335f9436fe24ee6ec77aa8c94723b2ecacb65a273f485809df9e11312d54924e0abd5f5c3e01641e055f6efbb72e6a3b407901b8a5364d4dd39f1 SHA512 6a9bb04ecfc93039ba32395e9decd6c1c0910558bb817f06ca80878ba508bc5ed199e7241ba79ae0a4bfa1e74f6dc6207fded47f3b8466cf611005b6c6084582 +DIST rules_java-8.6.1.tar.gz 104565 BLAKE2B fc90d972ae704d7c627c408d044e6ae6c331661493ed0f0614ae67415806a33a1df9965d83164d923692e60db4cf711493eceead75181adf691c1ca73826eb0e SHA512 f45114b02d9892781797686be73bbeab988d122bf3bd12f3d854810c62716d3a59a7630b1ab02ecfe464fc80c6041f2caebb465f7eb88d13106645b3fe589fba +DIST rules_kotlin-v1.9.6.tar.gz 23089629 BLAKE2B 1532ea7cc7807326c948be50cd4942a39f6c04f179690d9b51b41d354bde253581f453a2889048998e8bd381b8baad04315b81523e8cf2159ea33055704f43fb SHA512 0e2d538a4d4c200d40ad0041d7ccc3155670247144b2be322607c5db219262fd6f7de512b54df9ed3bae72213ca340b6919a0248a00260b451af93042ccd3216 +DIST rules_license-1.0.0.tar.gz 35903 BLAKE2B 851db879f93a22fed62872fed37e32c8fe54d882c2d15e0df9f17f332d99c92345c7bd89dbb70a040e455d6033e23035a984a478fd1655a6573c35bd1b84300e SHA512 17801f13c8a019de7e85a81ccfe6147ee9b996bbb72bbf4753aadb62e13c7c05040012182f3e557395a36453d8c7e9ca504b624bd2e490447656d0196c0fc6bb +DIST rules_pkg-1.0.1.tar.gz 90016 BLAKE2B 49a6faf5c17288bead1d94e071569c2f551b59d0ecb63467967c8abb3946cae7725cde71284623fc6b87a1a227969edfce8a73149853cc2596b2ae98c6c1a58d SHA512 5bbcba04093e91718f00ae48571005ace679a44a8996c5f975f6dd7e8431fd703999e10ce35d84b39a5a5e4fa92ce14d8ff8fc771001ff5c5575f4f6f5098625 +DIST rules_python-1.0.0.tar.gz 753569 BLAKE2B 036344fa385d808656b338f301fd6d76b2ea13088a7bbf69348bf54f3ccc9558573e15ad2f3befe7af404491f6febd735a456c83c64f83124a9f9bfc415d719f SHA512 47a341531548e1bdc90e9e1e2bc9d7199d9edb6b20815591f8fbc3bc2efc769adc213f3b2550e9f628548fe35be5a854a9cdcc44cc79355e6cff3ae5369e3382 +DIST rules_shell-v0.2.0.tar.gz 14070 BLAKE2B cec6995e2227bd361ccd55ed4f964947d987752eb773ed12ed1f44f5ebd16cf8c6cae5e370a55328777185dbd38a64e0de2c26b617c355a839d82847c3eea445 SHA512 7d5a6ae362ad92b1886c81ac4779c6d027435ae559e6cd0ea0c3b3aba60e614dc5a6428e720d667b1061ee94065d10e86dfaa0c17e2eb0a11bc535c3d450d69d +DIST rules_swift.2.1.1.tar.gz 271370 BLAKE2B 5815e469e6577bbc40ac2980eed1e0ceee3ba7bc0ce053ad4ff61a107e4bb788fd8ebfa31122b108ca197dd2c0338c4b389cabc4cbc01db36db62ef20ba9a844 SHA512 444939266564bf418c2dd7fc3c15353818da85fc35e970257d6b79ea62cc1225f68979ef5e5aa7e88e84f4e07b269d1973f9f578edfcc10a50f35b545700cb53 +DIST zlib-1.3.1.tar.gz 1512791 BLAKE2B 872ef9cc41ba57e9809ab5714ffa15cc9d3ef6c4a948c57107f800fc373bcfe2475136407203cb9aa33b189994336f36f2757b7a582e065ad477bfd49260184b SHA512 580677aad97093829090d4b605ac81c50327e74a6c2de0b85dd2e8525553f3ddde17556ea46f8f007f89e435493c9a20bc997d1ef1c1c2c23274528e3c46b94f diff --git a/app-i18n/mozc/files/mozc-2.31.5851.102-bazel_patch-fix_shebang.patch b/app-i18n/mozc/files/mozc-2.31.5851.102-bazel_patch-fix_shebang.patch new file mode 100644 index 000000000000..a8e759506802 --- /dev/null +++ b/app-i18n/mozc/files/mozc-2.31.5851.102-bazel_patch-fix_shebang.patch @@ -0,0 +1,13 @@ +patch rules_python package to set shebang +this patch is applied by bazel, not portage +--- python/private/py_runtime_info.bzl ++++ python/private/py_runtime_info.bzl +@@ -15,7 +15,7 @@ + + load(":util.bzl", "define_bazel_6_provider") + +-DEFAULT_STUB_SHEBANG = "#!/usr/bin/env python3" ++DEFAULT_STUB_SHEBANG = "#!@PYTHON@" + + DEFAULT_BOOTSTRAP_TEMPLATE = Label("//python/private:bootstrap_template") + diff --git a/app-i18n/mozc/files/mozc-2.31.5851.102-fix_path.patch b/app-i18n/mozc/files/mozc-2.31.5851.102-fix_path.patch new file mode 100644 index 000000000000..6b0e6a406b00 --- /dev/null +++ b/app-i18n/mozc/files/mozc-2.31.5851.102-fix_path.patch @@ -0,0 +1,12 @@ +avoid test failure due to the wrong path +--- a/unix/ibus/ibus_config_test.cc ++++ b/unix/ibus/ibus_config_test.cc +@@ -59,7 +59,7 @@ active_on_launch: False + <rank>80</rank> + <icon_prop_key>InputMode</icon_prop_key> + <symbol>あ</symbol> +- <setup>/usr/lib/mozc/mozc_tool --mode=config_dialog</setup> ++ <setup>/usr/libexec/mozc/mozc_tool --mode=config_dialog</setup> + <name>mozc-jp</name> + <longname>Mozc</longname> + <layout>default</layout> diff --git a/app-i18n/mozc/files/mozc-2.31.5851.102-patch_rules_python.patch b/app-i18n/mozc/files/mozc-2.31.5851.102-patch_rules_python.patch new file mode 100644 index 000000000000..8f96f38160e7 --- /dev/null +++ b/app-i18n/mozc/files/mozc-2.31.5851.102-patch_rules_python.patch @@ -0,0 +1,17 @@ +install the patch to fix shebang, then applied by bazel +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -55,6 +55,13 @@ bazel_dep( + name = "rules_python", + version = "1.0.0", + ) ++single_version_override( ++ module_name = "rules_python", ++ patches = [ ++ "bazel/rules_python_fix_shebang.patch", ++ ], ++ version = "1.0.0", ++) + + # Bazel macOS build (3.16.1 2024-12-13) + # https://github.com/bazelbuild/rules_apple diff --git a/app-i18n/mozc/mozc-2.31.5851.102.ebuild b/app-i18n/mozc/mozc-2.31.5851.102.ebuild new file mode 100644 index 000000000000..7754cfbf3471 --- /dev/null +++ b/app-i18n/mozc/mozc-2.31.5851.102.ebuild @@ -0,0 +1,409 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{11..14} ) +inherit desktop dot-a edo elisp-common multiprocessing python-any-r1 savedconfig toolchain-funcs xdg + +# USE_BAZEL_VERSION in .bazeliskrc +BAZEL_VER="8.1.1" +# 2025-06-03, date of release of mozc +BAZEL_BCR_HASH="b553f46a71d17fe8f32661f64e755cf6fac03ada" +# commit: Merge "Update BUILD_OSS to 5851" +MOZC_FCITX_HASH="f16444e45bd3c7f7a0af718f4af86ad181b6dd8b" + +# submodules, but archives are fetched by bazel from bazel_dist +ABS_VER="20250127.0" +GTEST_VER="1.15.2" +JUD_VER="2025-01-25" +PROTO_VER="29.3" + +# to simplify update +CPYTHON_VER="3.11.10+20241016" + +DESCRIPTION="Mozc - Japanese input method editor." +HOMEPAGE="https://github.com/google/mozc" +# for new release, update versions according to MODULE.bazel or failures of the fetch's phase of bazel +SRC_URI=" + amd64? ( + https://releases.bazel.build/${BAZEL_VER}/release/bazel-${BAZEL_VER}-linux-x86_64 + https://github.com/astral-sh/python-build-standalone/releases/download/${CPYTHON_VER#*+}/cpython-${CPYTHON_VER}-x86_64-unknown-linux-gnu-install_only.tar.gz + ) + arm64? ( + https://releases.bazel.build/${BAZEL_VER}/release/bazel-${BAZEL_VER}-linux-arm64 + https://github.com/astral-sh/python-build-standalone/releases/download/${CPYTHON_VER#*+}/cpython-${CPYTHON_VER}-aarch64-unknown-linux-gnu-install_only.tar.gz + ) + !fcitx5? ( https://github.com/google/${PN}/archive/refs/tags/${PV}.tar.gz + -> ${P}.tar.gz ) + fcitx5? ( https://github.com/fcitx/${PN}/archive/${MOZC_FCITX_HASH}.tar.gz + -> ${PN}-fcitx5-${PV}.tar.gz ) + test? ( https://github.com/google/googletest/releases/download/v${GTEST_VER}/googletest-${GTEST_VER}.tar.gz ) + https://github.com/bazelbuild/bazel-central-registry/archive/${BAZEL_BCR_HASH}.tar.gz + -> ${PN}-bcr-${BAZEL_BCR_HASH}.tar.gz + https://github.com/abseil/abseil-cpp/releases/download/${ABS_VER}/abseil-cpp-${ABS_VER}.tar.gz + https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JUD_VER}.zip + -> japanese-usage-dictionary-${JUD_VER}.zip + https://github.com/protocolbuffers/protobuf/releases/download/v${PROTO_VER}/protobuf-${PROTO_VER}.zip + https://github.com/bazelbuild/apple_support/releases/download/1.16.0/apple_support.1.16.0.tar.gz + https://github.com/bazel-contrib/bazel_features/releases/download/v1.21.0/bazel_features-v1.21.0.tar.gz + https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz + https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz + https://github.com/bazelbuild/rules_android_ndk/releases/download/v0.1.3/rules_android_ndk-v0.1.3.tar.gz + https://github.com/bazelbuild/rules_apple/releases/download/3.16.1/rules_apple.3.16.1.tar.gz + https://github.com/bazelbuild/rules_cc/releases/download/0.0.17/rules_cc-0.0.17.tar.gz + https://github.com/bazelbuild/rules_java/releases/download/8.6.1/rules_java-8.6.1.tar.gz + https://github.com/bazelbuild/rules_kotlin/releases/download/v1.9.6/rules_kotlin-v1.9.6.tar.gz + https://github.com/bazelbuild/rules_license/releases/download/1.0.0/rules_license-1.0.0.tar.gz + https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz + https://github.com/bazel-contrib/rules_python/releases/download/1.0.0/rules_python-1.0.0.tar.gz + https://github.com/bazelbuild/rules_shell/releases/download/v0.2.0/rules_shell-v0.2.0.tar.gz + https://github.com/bazelbuild/rules_swift/releases/download/2.1.1/rules_swift.2.1.1.tar.gz + https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz + https://github.com/hiroyuki-komatsu/japanpost_zipcode/raw/6ece210081fb73d0ea4a5ea8e13ac9584d03fd76/ken_all.zip + -> ${P}-ken_all.zip + https://github.com/hiroyuki-komatsu/japanpost_zipcode/raw/6ece210081fb73d0ea4a5ea8e13ac9584d03fd76/jigyosyo.zip + -> ${P}-jigyosyo.zip + https://raw.githubusercontent.com/google/material-design-icons/4.0.0/png/action/chrome_reader_mode/materialiconsoutlined/48dp/1x/outline_chrome_reader_mode_black_48dp.png + -> ${P}-dictionary.png + https://raw.githubusercontent.com/google/material-design-icons/4.0.0/src/action/chrome_reader_mode/materialiconsoutlined/24px.svg + -> ${P}-dictionary.svg + https://raw.githubusercontent.com/google/material-design-icons/4.0.0/png/action/settings/materialiconsround/48dp/1x/round_settings_black_48dp.png + -> ${P}-properties.png + https://raw.githubusercontent.com/google/material-design-icons/4.0.0/src/action/settings/materialiconsround/24px.svg + -> ${P}-properties.svg + https://raw.githubusercontent.com/google/material-design-icons/4.0.0/png/action/build/materialicons/48dp/1x/baseline_build_black_48dp.png + -> ${P}-tool.png + https://raw.githubusercontent.com/google/material-design-icons/4.0.0/src/action/build/materialicons/24px.svg + -> ${P}-tool.svg +" +S="${WORKDIR}/${P}/src" + +# 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" +IUSE="debug emacs fcitx5 +gui ibus renderer test" +REQUIRED_USE="|| ( emacs fcitx5 ibus )" +RESTRICT="!test? ( test )" + +DEPEND=" + fcitx5? ( app-i18n/fcitx:5 ) + gui? ( dev-qt/qtbase:6[gui,widgets] ) + ibus? ( + app-i18n/ibus + dev-libs/glib:2 + ) + renderer? ( dev-qt/qtbase:6[gui,widgets] ) +" +RDEPEND="${DEPEND} + emacs? ( app-editors/emacs:* ) +" +BDEPEND=" + ${PYTHON_DEPS} + app-arch/unzip + virtual/pkgconfig + fcitx5? ( sys-devel/gettext ) +" + +SITEFILE="50${PN}-gentoo.el" + +PATCHES=( + "${FILESDIR}"/${PN}-2.31.5851.102-patch_rules_python.patch + "${FILESDIR}"/${PN}-2.31.5851.102-fix_path.patch +) + +pkg_setup() { + python-any-r1_pkg_setup +} + +src_unpack() { + case $(tc-arch) in + amd64) export EARCH=x86_64 ;; + arm64) export EARCH=arm64 ;; + *) die "architecture not supported: $(tc-arch)" ;; + esac + cp "${DISTDIR}"/bazel-${BAZEL_VER}-linux-${EARCH} bazel || die + chmod +x bazel || die + + unpack ${PN}-bcr-${BAZEL_BCR_HASH}.tar.gz + ln -sfT bazel-central-registry-${BAZEL_BCR_HASH} bcr || die + + # create symlinks for distdir with the name wanted by bazel + mkdir bazel_dist || die + pushd "${DISTDIR}" || die + for dep in *.{tar.gz,zip,png,svg}; do + ln -sfT "${DISTDIR}/${dep}" "${WORKDIR}/bazel_dist/${dep#${P}-}" || die + done + ln -sfT "${DISTDIR}"/japanese-usage-dictionary-${JUD_VER}.zip "${WORKDIR}"/bazel_dist/${JUD_VER}.zip || die + popd || die + + if use fcitx5; then + unpack ${PN}-fcitx5-${PV}.tar.gz + ln -sfT "${WORKDIR}"/${PN}-${MOZC_FCITX_HASH} "${WORKDIR}"/${P} || die + else + unpack ${P}.tar.gz + fi +} + +ebazel() { + debug-print-function ${FUNCNAME} "${@}" + + edo "${WORKDIR}"/bazel "$@" +} + +mozc_icons() { + if use fcitx5 || use gui || use ibus; then + return 0 + fi +} + +src_prepare() { + default + + # patch applied by bazel with MODULE.bazel patched + cp "${FILESDIR}"/${PN}-2.31.5851.102-bazel_patch-fix_shebang.patch bazel/rules_python_fix_shebang.patch || die + # fix shebang + sed -e "s:@PYTHON@:${PYTHON}:" \ + -i bazel/rules_python_fix_shebang.patch || die + + # fix paths to preserve compatibility + sed -e "/LINUX_MOZC_SERVER_DIR/s:=.*:= \"/usr/libexec/mozc\":" \ + -e "/IBUS_MOZC_PATH/s:=.*:= \"/usr/libexec/ibus-engine-mozc\":" \ + -i config.bzl || die + + # respect prefix + if [[ -n ${EPREFIX} ]]; then + sed -e "s@/usr@${EPREFIX}/usr@" -i config.bzl || die + fi + + # fix pkg-config for fcitx5 / ibus / glib / Qt + tc-export PKG_CONFIG + sed -e "s@\"pkg-config\"@\"${PKG_CONFIG}\"@" \ + -i bazel/pkg_config_repository.bzl || die + + # bug #877765 + restore_config mozcdic-ut.txt + if [[ -f /mozcdic-ut.txt && -s mozcdic-ut.txt ]]; then + einfo "mozcdic-ut.txt found. Adding to mozc dictionary..." + cat mozcdic-ut.txt >> "${S}"/data/dictionary_oss/dictionary00.txt || die + fi + + # custom the target 'package' defined in unix/BUILD.bazel + if ! mozc_icons; then + sed -e "\@:icons@d" \ + -i unix/BUILD.bazel || die + fi + + if ! use emacs; then + sed -e "\@//unix/emacs:mozc_emacs_helper@d" \ + -e "\@//unix/emacs:mozc.el@d" \ + -i unix/BUILD.bazel || die + fi + + if ! use gui; then + sed -e "\@//gui/tool:mozc_tool@d" \ + -i unix/BUILD.bazel || die + fi + + if ! use ibus; then + sed -e "\@//unix/ibus:gen_mozc_xml@d" \ + -e "\@//unix/ibus:ibus_mozc@d" \ + -i unix/BUILD.bazel || die + fi + + if ! use renderer; then + sed -e "\@//renderer/qt:mozc_renderer@d" \ + -i unix/BUILD.bazel || die + fi +} + +src_configure() { + # to investigate, but there's lot of static libs + lto-guarantee-fat + + # https://bazel.build/reference/be/make-variables + tc-export CC AR + + MYEBAZELARGS=( + --compilation_mode="$(usex debug dbg opt)" + --config="oss_linux" + --distdir="${WORKDIR}/bazel_dist" + --jobs="$(get_makeopts_jobs)" + --registry="file://${WORKDIR}/bcr" + --repository_cache="${WORKDIR}/bazel_cache" + --spawn_strategy="local" # portage is already sandboxed + --strip="$(usex debug never always)" + --subcommands # be verbose + --verbose_failures + ) + + if use fcitx5; then + MYEBAZELARGS+=( + unix/fcitx5/fcitx5-mozc.so + # just to be sure, use_server is enabled by default + --define server=1 + ) + fi + + # add all targets/testsuites by default, then filter + if use test; then + MYEBAZELARGS+=( /... ) + # not unix, no testsuite + SKIP_TESTS=( -protocol/... ) + ! use emacs && SKIP_TESTS+=( -unix/emacs/... ) + ! use gui && SKIP_TESTS+=( -gui/... ) + ! use ibus && SKIP_TESTS+=( -unix/ibus/... ) + ! use renderer && SKIP_TESTS+=( -renderer/... ) + use fcitx5 && SKIP_TESTS+=( -unix/fcitx/... ) + fi + + local cflags + for cflags in ${CFLAGS}; do + MYEBAZELARGS+=( --conlyopt="${cflags}" ) + done + + local cxxflags + for cxxflags in ${CXXFLAGS}; do + MYEBAZELARGS+=( --cxxopt="${cxxflags}" ) + done + + local ldflags + for ldflags in ${LDFLAGS}; do + MYEBAZELARGS+=( --linkopt="${ldflags}" ) + done + + # clean cache, just in case + ebazel clean --expunge + + # this build --nobuild generates bazel_cache + # this is useful to debug or make patch + ebazel build --nobuild package "${MYEBAZELARGS[@]}" -- "${SKIP_TESTS[@]}" +} + +src_compile() { + ebazel build package "${MYEBAZELARGS[@]}" -- "${SKIP_TESTS[@]}" + + # bazel-bin is a symlink, copy files to avoid problem with symlink then + cp -R bazel-bin/unix out_linux || die + + use emacs && elisp-compile unix/emacs/*.el +} + +src_test() { + ebazel test --build_tests_only "${MYEBAZELARGS[@]}" -- "${SKIP_TESTS[@]}" +} + +src_install() { + unzip -qo out_linux/mozc.zip -d "${ED}" || die + + # remove mozc.el, in a wrong path + # already compiled elsewhere and installed then + if use emacs; then + rm -r "${ED}"/usr/share/emacs/site-lisp/emacs-mozc || die + elisp-install ${PN} unix/emacs/*.{el,elc} + elisp-site-file-install "${FILESDIR}"/${SITEFILE} ${PN} + fi + + if mozc_icons; then + # remove tmp with duplicate icons zipped + rm -r "${ED}"/tmp || die + if ! use ibus; then + rm -r "${ED}"/usr/share/ibus-mozc || die + fi + if ! use gui; then + rm -r "${ED}"/usr/share/icons/mozc || die + fi + fi + + if use fcitx5; then + exeinto /usr/$(get_libdir)/fcitx5 + doexe out_linux/fcitx5/fcitx5-mozc.so + + # see scripts/install_fcitx5_data + insinto /usr/share/fcitx5/addon + newins unix/fcitx5/mozc-addon.conf mozc.conf + + insinto /usr/share/fcitx5/inputmethod + doins unix/fcitx5/mozc.conf + + export MOPREFIX="fcitx5-mozc" + local mo_file + for mo_file in unix/fcitx5/po/*.po; do + msgfmt "${mo_file}" -o "${mo_file%.po}.mo" && domo "${mo_file%.po}.mo" || die + done + + 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 || die + insinto /usr/share/metainfo + doins unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml + + # see scripts/install_fcitx5_icons + local orgfcitx5="org.fcitx.Fcitx5.fcitx-mozc" + newicon -s 128 data/images/product_icon_32bpp-128.png ${orgfcitx5}.png + newicon -s 128 data/images/product_icon_32bpp-128.png fcitx-mozc.png + newicon -s 32 data/images/unix/ime_product_icon_opensource-32.png ${orgfcitx5}.png + newicon -s 32 data/images/unix/ime_product_icon_opensource-32.png fcitx-mozc.png + for uiimg in ../scripts/icons/ui-*.png; do + dimg="${uiimg#*ui-}" + newicon -s 48 "${uiimg}" "${orgfcitx5}-${dimg/_/-}" + newicon -s 48 "${uiimg}" "fcitx-mozc-${dimg/_/-}" + done + fi + + [[ -s mozcdic-ut.txt ]] && save_config mozcdic-ut.txt + + insinto /usr/libexec/mozc/documents + doins data/installer/credits_en.html +} + +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_pkg_postinst +} + +pkg_postrm() { + if use emacs; then + elisp-site-regen + fi + xdg_pkg_postrm +}
