Sync with portage [Sun Mar 13 18:58:07 MSK 2022].

akrasnyh 2223
root 2 years ago
parent 4e781085bb
commit bf09e9cc58

Binary file not shown.

Binary file not shown.

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -12,7 +12,7 @@ S="${WORKDIR}"/${PN}
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ppc x86"
KEYWORDS="amd64 arm arm64 ppc x86"
PATCHES=(
"${FILESDIR}"/${PN}-1.1-build.patch

Binary file not shown.

@ -1,2 +1 @@
DIST codecrypt-1.7.2.tar.gz 446975 BLAKE2B 40b7f97dae84a0fd621ee19c6bfeba47b781a7f856ce9c077445d6387b75b97dce0fc02ee9481241b246b0eb7de6b44ac014a708a8ceba629828ca9d63b8e24c SHA512 4ad2ad9e665e486e353b48efff344436b276eac2dcbddcf4330796b8f1f06284eaeec9c4f4ef63f61e4477c3bce0973f60f76291dce11bee31a75658bee6a3a0
DIST codecrypt-1.8.tar.gz 471273 BLAKE2B 30547c299689547b50e2742e12dbfd32f420217a81813446b36bf5ea52929ca1f3b1968d76937de17e0f003c82186abfa683a6e30dc1fa5dc2ffe89594827ae4 SHA512 0e452f4e93498faa671a5927a3dd93b6dc66cbda7eb71cb33a509f8608573eff5ac8fed0d5e09911e03c153b88c9cb1bb54f7b2aeeb7b6c31eec918ad9685102

@ -1,30 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
DESCRIPTION="Post-quantum cryptography tool"
HOMEPAGE="http://e-x-a.org/codecrypt/"
SRC_URI="http://e-x-a.org/codecrypt/files/${P}.tar.gz"
LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+cryptopp"
DEPEND="dev-libs/gmp:=
cryptopp? ( dev-libs/crypto++:= )
sci-libs/fftw:3.0="
RDEPEND="${DEPEND}"
src_prepare() {
eapply_user
# workaround -- gentoo is missing crypto++ pkg-config file
sed -i -e 's/PKG_CHECK_MODULES(\[CRYPTOPP\],.*/LDFLAGS="$LDFLAGS -lcrypto++"/' configure.ac
./autogen.sh
}
src_configure() {
econf \
$(use_with cryptopp )
}

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@ -27,5 +27,5 @@ src_prepare() {
src_configure() {
econf \
$(use_with cryptopp )
$(use_with cryptopp)
}

@ -9,7 +9,7 @@ SRC_URI="https://github.com/cathugger/${PN}/releases/download/v${PV}/${PN}-${PV}
LICENSE="CC0-1.0"
SLOT="0"
KEYWORDS="~amd64"
KEYWORDS="amd64"
IUSE="cpu_flags_x86_sse2 pcre2"
DEPEND="

Binary file not shown.

@ -21,10 +21,11 @@ KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc x86"
DEPEND="
>=dev-libs/glib-2.64:2
>=dev-libs/libpeas-1.14.1[gtk]
>=dev-libs/gobject-introspection-1.54:=
>=x11-libs/gtk+-3.22.0:3[introspection]
>=x11-libs/gtksourceview-4.0.2:4[introspection]
>=dev-libs/libpeas-1.14.1[gtk]
>=dev-libs/libxml2-2.5.0:2
>=dev-libs/gobject-introspection-1.54:=
spell? ( >=app-text/gspell-0.2.5:0= )
python? (

Binary file not shown.

@ -1,12 +1,10 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit multilib-minimal autotools
AUTOTOOLS_AUTORECONF="1"
if [[ "${PV}" == "9999" ]]; then
EGIT_REPO_URI="https://source.winehq.org/git/vkd3d.git"
inherit git-r3

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -12,7 +12,7 @@ SRC_URI="
LICENSE="BSD-2 GPL-2 LGPL-2.1 MIT MPL-1.1"
SLOT="${PV}"
KEYWORDS="~amd64 ~x86"
KEYWORDS="~amd64 x86"
IUSE="+shared"
DEPEND="!!app-emulation/wine:0"

@ -20,7 +20,7 @@ if [[ ${PV} == "9999" ]] ; then
else
MAJOR_V=$(ver_cut 1)
SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}.0/${MY_P}.tar.xz"
KEYWORDS="-* ~amd64 ~x86"
KEYWORDS="-* ~amd64 x86"
fi
S="${WORKDIR}/${MY_P}"

Binary file not shown.

@ -1,4 +1,3 @@
DIST ruby.eselect-20170723.xz 1972 BLAKE2B 338f9fbb81ebe3c0fdcab77ab12cabd6aa334ac3bf64352cd801c8088d7c3ac4c452e647addc98497d104df24f7934d8cdd8b0008e4f52fb27306a80411f793b SHA512 9c0614bc7e2ce9811466f257035d74622a96db8d44aa0908414fbac7d4142c34350257b08ace7371901e46cc0c9a38c3f2acae3caea4fb354ccc37b8c919b48f
DIST ruby.eselect-20190121.xz 2000 BLAKE2B d04f9230e428526fb7ac7f6c274d7ac1b47af9f9bbb33cbfcec72cccdbe553db73a320e8a86190b88b4f9ee9c27fe0e5dabce1e1c5edfd4373d9a4bfcb457957 SHA512 aca2c46e39d3e0806a0ab942e8afe755992e5df98c50f4f2e012c93b8d6339e2a8400376e73187744a3d42a77725e03eed48b300f7d4d2da546a434184988f52
DIST ruby.eselect-20191222.xz 2000 BLAKE2B ec89dca67730ff3c6acba8906f9436866b45c3b7fc4c29be6614eddf7e5fbc1f9f9ff0bfe3ddfdc7309d242a5da6f8913cae738895fd6abcc39dc336f609d066 SHA512 72c3e3fe8c82474de25dbde9f1f63739e57be3e4e61a1f86e57c9dcaf92d72fd8d17263f8a326af771f64395febc82f5eb29e86b4b2a44af029b6c1fc41e43d2
DIST ruby.eselect-20201225.xz 2008 BLAKE2B 1471c174dddda5078f54b39b46d78dd0a5a2e23b19185d3c833f870b94809c4e7a642bb987d2213e9f99799c7669f0cbeca77dcefe381804f9aa91e197ed499c SHA512 e5b6ff18a7e1a7e3d902b59d27a558499fb87008abe51c3901430ebeaaacd1c1ebc6b782d6eb083d0d2abb5f0fd7cf712b42b451342cbeccceabb8d17859668c
DIST ruby.eselect-20220313.xz 2008 BLAKE2B aeeb70228ccaf163359cff4ba09e9417df7896f63748821b447b08f6fc57cfc760963ee231c82a03b33f24e01492d9305a68f29d00cd45d29d37e8ee4fb92afe SHA512 542ddb796b93e4b954f5fcfbc49e06b41218e1def73078b14c4d6505227bf08dc7fec20b11042058149af4939fd341c20bfc0c9dd13900a33d12f02ff761412f

@ -1,22 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
DESCRIPTION="Manages multiple Ruby versions"
HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
SRC_URI="https://dev.gentoo.org/~graaff/ruby-team/ruby.eselect-${PVR}.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE=""
RDEPEND=">=app-admin/eselect-1.0.2"
S=${WORKDIR}
src_install() {
insinto /usr/share/eselect/modules
newins "${WORKDIR}/ruby.eselect-${PVR}" ruby.eselect
}

@ -1,15 +1,15 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
EAPI=8
DESCRIPTION="Manages multiple Ruby versions"
HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
HOMEPAGE="https://wiki.gentoo.org/wiki/Ruby"
SRC_URI="https://dev.gentoo.org/~graaff/ruby-team/ruby.eselect-${PVR}.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm ~arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE=""
RDEPEND=">=app-admin/eselect-1.0.2"

Binary file not shown.

@ -14,7 +14,7 @@ SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${GENTOO_PATC
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86"
KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86"
IUSE="+cron"
RDEPEND="cron? ( virtual/cron )"

Binary file not shown.

@ -1,27 +0,0 @@
--- /src/net/json_util_test.cc
+++ /src/net/json_util_test.cc
@@ -784,13 +784,13 @@
for (size_t i = 0; i < arraysize(kNumS32ValueKeys); ++i) {
{
Json::Value json_value;
- json_value[kNumS32ValueKeys[i]] = -2147483649ll;
+ json_value[kNumS32ValueKeys[i]] = static_cast<Json::Value::Int64>(-2147483649ll);
TestMsg msg;
EXPECT_FALSE(JsonUtil::JsonValueToProtobufMessage(json_value, &msg));
}
{
Json::Value json_value;
- json_value[kNumS32ValueKeys[i]] = 2147483648ull;
+ json_value[kNumS32ValueKeys[i]] = static_cast<Json::Value::UInt64>(2147483648ull);
TestMsg msg;
EXPECT_FALSE(JsonUtil::JsonValueToProtobufMessage(json_value, &msg));
}
@@ -805,7 +805,7 @@
}
{
Json::Value json_value;
- json_value[kNumU32ValueKeys[i]] = 4294967296ull;
+ json_value[kNumU32ValueKeys[i]] = static_cast<Json::Value::UInt64>(4294967296ull);
TestMsg msg;
EXPECT_FALSE(JsonUtil::JsonValueToProtobufMessage(json_value, &msg));
}

@ -1,70 +0,0 @@
Disable test leaving mozc_server orphan process.
--- /src/unix/ibus/mozc_engine_test.cc
+++ /src/unix/ibus/mozc_engine_test.cc
@@ -41,65 +41,5 @@
namespace mozc {
namespace ibus {
-class LaunchToolTest : public testing::Test {
- public:
- LaunchToolTest() {
- g_type_init();
- }
-
- protected:
- virtual void SetUp() {
- mozc_engine_.reset(new MozcEngine());
-
- mock_ = new client::ClientMock();
- mock_->ClearFunctionCounter();
- mozc_engine_->client_.reset(mock_);
- }
-
- virtual void TearDown() {
- mozc_engine_.reset();
- }
-
- client::ClientMock* mock_;
- unique_ptr<MozcEngine> mozc_engine_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(LaunchToolTest);
-};
-
-TEST_F(LaunchToolTest, LaunchToolTest) {
- commands::Output output;
-
- // Launch config dialog
- mock_->ClearFunctionCounter();
- mock_->SetBoolFunctionReturn("LaunchToolWithProtoBuf", true);
- output.set_launch_tool_mode(commands::Output::CONFIG_DIALOG);
- EXPECT_TRUE(mozc_engine_->LaunchTool(output));
-
- // Launch dictionary tool
- mock_->ClearFunctionCounter();
- mock_->SetBoolFunctionReturn("LaunchToolWithProtoBuf", true);
- output.set_launch_tool_mode(commands::Output::DICTIONARY_TOOL);
- EXPECT_TRUE(mozc_engine_->LaunchTool(output));
-
- // Launch word register dialog
- mock_->ClearFunctionCounter();
- mock_->SetBoolFunctionReturn("LaunchToolWithProtoBuf", true);
- output.set_launch_tool_mode(commands::Output::WORD_REGISTER_DIALOG);
- EXPECT_TRUE(mozc_engine_->LaunchTool(output));
-
- // Launch no tool(means do nothing)
- mock_->ClearFunctionCounter();
- mock_->SetBoolFunctionReturn("LaunchToolWithProtoBuf", false);
- output.set_launch_tool_mode(commands::Output::NO_TOOL);
- EXPECT_FALSE(mozc_engine_->LaunchTool(output));
-
- // Something occurring in client::Client::LaunchTool
- mock_->ClearFunctionCounter();
- mock_->SetBoolFunctionReturn("LaunchToolWithProtoBuf", false);
- output.set_launch_tool_mode(commands::Output::CONFIG_DIALOG);
- EXPECT_FALSE(mozc_engine_->LaunchTool(output));
-}
-
} // namespace ibus
} // namespace mozc

@ -1,132 +0,0 @@
https://github.com/google/mozc/issues/470
--- /src/base/system_util.cc
+++ /src/base/system_util.cc
@@ -208,28 +208,39 @@
dir_ = "/";
return;
#else // MOZC_USE_PEPPER_FILE_IO
+ const char *configuration_directory_env;
string dir;
#ifdef OS_WIN
- DCHECK(SUCCEEDED(Singleton<LocalAppDataDirectoryCache>::get()->result()));
- dir = Singleton<LocalAppDataDirectoryCache>::get()->path();
+ configuration_directory_env = ::getenv("MOZC_CONFIGURATION_DIRECTORY");
+ if (configuration_directory_env) {
+ dir = configuration_directory_env;
+ } else {
+ DCHECK(SUCCEEDED(Singleton<LocalAppDataDirectoryCache>::get()->result()));
+ dir = Singleton<LocalAppDataDirectoryCache>::get()->path();
#ifdef GOOGLE_JAPANESE_INPUT_BUILD
- dir = FileUtil::JoinPath(dir, kCompanyNameInEnglish);
- FileUtil::CreateDirectory(dir);
+ dir = FileUtil::JoinPath(dir, kCompanyNameInEnglish);
+ FileUtil::CreateDirectory(dir);
#endif // GOOGLE_JAPANESE_INPUT_BUILD
- dir = FileUtil::JoinPath(dir, kProductNameInEnglish);
+ dir = FileUtil::JoinPath(dir, kProductNameInEnglish);
+ }
#elif defined(OS_MACOSX)
- dir = MacUtil::GetApplicationSupportDirectory();
+ configuration_directory_env = ::getenv("MOZC_CONFIGURATION_DIRECTORY");
+ if (configuration_directory_env) {
+ dir = configuration_directory_env;
+ } else {
+ dir = MacUtil::GetApplicationSupportDirectory();
#ifdef GOOGLE_JAPANESE_INPUT_BUILD
- dir = FileUtil::JoinPath(dir, "Google");
- // The permission of ~/Library/Application Support/Google seems to be 0755.
- // TODO(komatsu): nice to make a wrapper function.
- ::mkdir(dir.c_str(), 0755);
- dir = FileUtil::JoinPath(dir, "JapaneseInput");
+ dir = FileUtil::JoinPath(dir, "Google");
+ // The permission of ~/Library/Application Support/Google seems to be 0755.
+ // TODO(komatsu): nice to make a wrapper function.
+ ::mkdir(dir.c_str(), 0755);
+ dir = FileUtil::JoinPath(dir, "JapaneseInput");
#else // GOOGLE_JAPANESE_INPUT_BUILD
- dir = FileUtil::JoinPath(dir, "Mozc");
+ dir = FileUtil::JoinPath(dir, "Mozc");
#endif // GOOGLE_JAPANESE_INPUT_BUILD
+ }
#elif defined(OS_ANDROID)
// For android, we do nothing here because user profile directory,
@@ -237,14 +248,24 @@
// is injected from Java layer.
#else // !OS_WIN && !OS_MACOSX && !OS_ANDROID
- char buf[1024];
- struct passwd pw, *ppw;
- const uid_t uid = geteuid();
- CHECK_EQ(0, getpwuid_r(uid, &pw, buf, sizeof(buf), &ppw))
- << "Can't get passwd entry for uid " << uid << ".";
- CHECK_LT(0, strlen(pw.pw_dir))
- << "Home directory for uid " << uid << " is not set.";
- dir = FileUtil::JoinPath(pw.pw_dir, ".mozc");
+ configuration_directory_env = ::getenv("MOZC_CONFIGURATION_DIRECTORY");
+ if (configuration_directory_env) {
+ dir = configuration_directory_env;
+ } else {
+ const char *home_env = ::getenv("HOME");
+ if (home_env) {
+ dir = FileUtil::JoinPath(home_env, ".mozc");
+ } else {
+ char buf[1024];
+ struct passwd pw, *ppw;
+ const uid_t uid = geteuid();
+ CHECK_EQ(0, getpwuid_r(uid, &pw, buf, sizeof(buf), &ppw))
+ << "Can't get passwd entry for uid " << uid << ".";
+ CHECK_LT(0, strlen(pw.pw_dir))
+ << "Home directory for uid " << uid << " is not set.";
+ dir = FileUtil::JoinPath(pw.pw_dir, ".mozc");
+ }
+ }
#endif // !OS_WIN && !OS_MACOSX && !OS_ANDROID
FileUtil::CreateDirectory(dir);
@@ -356,6 +377,10 @@
#endif // OS_WIN
string SystemUtil::GetServerDirectory() {
+ const char *server_directory_env = ::getenv("MOZC_SERVER_DIRECTORY");
+ if (server_directory_env) {
+ return server_directory_env;
+ }
#ifdef OS_WIN
DCHECK(SUCCEEDED(Singleton<ProgramFilesX86Cache>::get()->result()));
#if defined(GOOGLE_JAPANESE_INPUT_BUILD)
@@ -409,6 +434,10 @@
}
string SystemUtil::GetDocumentDirectory() {
+ const char *documents_directory_env = ::getenv("MOZC_DOCUMENTS_DIRECTORY");
+ if (documents_directory_env) {
+ return documents_directory_env;
+ }
#if defined(OS_MACOSX)
return GetServerDirectory();
#elif defined(MOZC_DOCUMENT_DIRECTORY)
--- /src/handwriting/zinnia_handwriting.cc
+++ /src/handwriting/zinnia_handwriting.cc
@@ -31,6 +31,7 @@
#include "handwriting/zinnia_handwriting.h"
+#include <cstdlib>
#include <memory>
#include <string>
@@ -48,6 +49,10 @@
// static
string ZinniaHandwriting::GetModelFileName() {
+ const char *zinnia_model_file_env = ::getenv("MOZC_ZINNIA_MODEL_FILE");
+ if (zinnia_model_file_env) {
+ return zinnia_model_file_env;
+ }
#if defined(MOZC_BUILD)
return MOZC_ZINNIA_MODEL_FILE;
#else

@ -1,22 +0,0 @@
https://github.com/google/mozc/issues/441
--- /src/prediction/zero_query_dict.h
+++ /src/prediction/zero_query_dict.h
@@ -147,6 +147,17 @@
return iter;
}
+ iterator &operator--() {
+ ptr_ -= kTokenByteSize;
+ return *this;
+ }
+
+ iterator operator--(int) {
+ const iterator tmp(ptr_, string_array_);
+ ptr_ -= kTokenByteSize;
+ return tmp;
+ }
+
iterator &operator-=(ptrdiff_t n) {
ptr_ -= n * kTokenByteSize;
return *this;

@ -1,13 +0,0 @@
Fix building with Protocol Buffers >=3.18.
--- /src/dictionary/user_dictionary_storage.cc
+++ /src/dictionary/user_dictionary_storage.cc
@@ -108,7 +108,7 @@
// wants to use more than 512MB.
mozc::protobuf::io::IstreamInputStream zero_copy_input(&ifs);
mozc::protobuf::io::CodedInputStream decoder(&zero_copy_input);
- decoder.SetTotalBytesLimit(kDefaultTotalBytesLimit, -1);
+ decoder.SetTotalBytesLimit(kDefaultTotalBytesLimit);
if (!user_dictionary_storage_base.ParseFromCodedStream(&decoder)) {
LOG(ERROR) << "Failed to parse";
if (!decoder.ConsumedEntireMessage() || !ifs.eof()) {

@ -1,621 +0,0 @@
https://github.com/google/mozc/issues/462
--- /src/base/gen_character_set.py
+++ /src/base/gen_character_set.py
@@ -33,7 +33,6 @@
import itertools
import optparse
import re
-import string
import sys
@@ -89,7 +88,8 @@
@staticmethod
def _LoadTable(filename, column_index, pattern, validater):
result = set()
- for line in open(filename):
+ fh = open(filename)
+ for line in fh:
if line.startswith('#'):
# Skip a comment line.
continue
@@ -100,6 +100,7 @@
ucs = int(match.group(1), 16)
if validater(ucs):
result.add(ucs)
+ fh.close()
return result
@@ -250,7 +251,7 @@
# (at most) four code points.
bit_list = []
for _, group in itertools.groupby(enumerate(category_list),
- lambda (codepoint, _): codepoint / 4):
+ lambda x: x[0] // 4):
# Fill bits from LSB to MSB for each group.
bits = 0
for index, (_, category) in enumerate(group):
@@ -263,7 +264,7 @@
# Output the content. Each line would have (at most) 16 bytes.
for _, group in itertools.groupby(enumerate(bit_list),
- lambda (index, _): index / 16):
+ lambda x: x[0] // 16):
line = [' \"']
for _, bits in group:
line.append('\\x%02X' % bits)
@@ -386,7 +387,7 @@
# Bitmap lookup.
# TODO(hidehiko): the bitmap has two huge 0-bits ranges. Reduce them.
category_map = [
- (bits, category) for category, bits in CATEGORY_BITMAP.iteritems()]
+ (bits, category) for category, bits in CATEGORY_BITMAP.items()]
category_map.sort()
lines.extend([
@@ -451,7 +452,7 @@
options.jisx0213file)
category_list = [
categorizer.GetCategory(codepoint)
- for codepoint in xrange(categorizer.MaxCodePoint() + 1)]
+ for codepoint in range(categorizer.MaxCodePoint() + 1)]
generated_character_set_header = GenerateCharacterSetHeader(category_list)
# Write the result.
--- /src/base/gen_config_file_stream_data.py
+++ /src/base/gen_config_file_stream_data.py
@@ -58,7 +58,7 @@
result = []
result.append(' { "%s", "' % os.path.basename(path))
with open(path, 'rb') as stream:
- result.extend(r'\x%02X' % ord(byte) for byte in stream.read())
+ result.extend(r'\x%02X' % byte for byte in stream.read())
result.append('", %d }' % os.path.getsize(path))
return ''.join(result)
@@ -93,8 +93,8 @@
def main():
(options, args) = ParseOptions()
if not options.output:
- print >>sys.stderr, (
- 'usage: gen_config_file_stream_data.py --output=filepath input ...')
+ print('usage: gen_config_file_stream_data.py --output=filepath input ...',
+ file=sys.stderr)
sys.exit(2)
with open(options.output, 'w') as output:
--- /src/build_mozc.py
+++ /src/build_mozc.py
@@ -943,7 +943,7 @@
logging.info('running %s...', binary)
try:
test_function(binary, gtest_report_dir, options)
- except RunOrDieError, e:
+ except RunOrDieError as e:
logging.error(e)
failed_tests.append(binary)
else:
@@ -1082,7 +1082,7 @@
# and '-c' and 'Release' are build options.
targets = []
build_options = []
- for i in xrange(len(args)):
+ for i in range(len(args)):
if args[i].startswith('-'):
# starting with build options
build_options = args[i:]
@@ -1190,14 +1190,14 @@
def ShowHelpAndExit():
"""Shows the help message."""
- print 'Usage: build_mozc.py COMMAND [ARGS]'
- print 'Commands: '
- print ' gyp Generate project files.'
- print ' build Build the specified target.'
- print ' runtests Build all tests and run them.'
- print ' clean Clean all the build files and directories.'
- print ''
- print 'See also the comment in the script for typical usage.'
+ print('Usage: build_mozc.py COMMAND [ARGS]')
+ print('Commands: ')
+ print(' gyp Generate project files.')
+ print(' build Build the specified target.')
+ print(' runtests Build all tests and run them.')
+ print(' clean Clean all the build files and directories.')
+ print('')
+ print('See also the comment in the script for typical usage.')
sys.exit(1)
--- /src/build_tools/android_util.py
+++ /src/build_tools/android_util.py
@@ -548,7 +548,7 @@
(devices_result, _) = process.communicate()
used_ports = set(int(port) for port
in re.findall(r'emulator-(\d+)', devices_result))
- return [port for port in xrange(5554, 5586, 2) if port not in used_ports]
+ return [port for port in range(5554, 5586, 2) if port not in used_ports]
def SetUpTestingSdkHomeDirectory(dest_android_sdk_home,
@@ -575,7 +575,7 @@
'create', 'avd',
'--force',
'--sdcard', '512M',]
- for key, value in options.iteritems():
+ for key, value in options.items():
args.extend([key, value])
env = {'ANDROID_SDK_HOME': os.path.abspath(dest_android_sdk_home)}
logging.info('Creating AVD: %s', args)
@@ -615,7 +615,7 @@
def main():
for arg in sys.argv[1:]:
for item in sorted(GetApkProperties(arg).items()):
- print '%s: %s' % item
+ print('%s: %s' % item)
if __name__ == '__main__':
--- /src/build_tools/binary_size_checker.py
+++ /src/build_tools/binary_size_checker.py
@@ -70,12 +70,12 @@
actual_size = os.stat(filename).st_size
expected_size = EXPECTED_MAXIMUM_SIZES[basename]
if actual_size < expected_size * 1024 * 1024:
- print 'Pass: %s (size: %d) is smaller than expected (%d MB)' % (
- filename, actual_size, expected_size)
+ print('Pass: %s (size: %d) is smaller than expected (%d MB)' % (
+ filename, actual_size, expected_size))
return True
else:
- print 'WARNING: %s (size: %d) is larger than expected (%d MB)' % (
- filename, actual_size, expected_size)
+ print('WARNING: %s (size: %d) is larger than expected (%d MB)' % (
+ filename, actual_size, expected_size))
return False
--- /src/build_tools/build_and_sign_pkg_mac.py
+++ /src/build_tools/build_and_sign_pkg_mac.py
@@ -44,8 +44,8 @@
import shutil
import sys
-from util import PrintErrorAndExit
-from util import RunOrDie
+from .util import PrintErrorAndExit
+from .util import RunOrDie
def ParseOption():
--- /src/build_tools/build_breakpad.py
+++ /src/build_tools/build_breakpad.py
@@ -54,9 +54,9 @@
try:
subprocess.check_output(command)
except subprocess.CalledProcessError as e:
- print e.output
+ print(e.output)
sys.exit(e.returncode)
- print 'Done: %s' % ' '.join(command)
+ print('Done: %s' % ' '.join(command))
def Xcodebuild(projdir, target, arch, sdk, outdir):
--- /src/build_tools/build_diskimage_mac.py
+++ /src/build_tools/build_diskimage_mac.py
@@ -90,7 +90,7 @@
# setup volume directory
temp_dir = tempfile.mkdtemp()
CopyFile(path.join(build_dir, ".keystone_install"), temp_dir)
- os.chmod(path.join(temp_dir, ".keystone_install"), 0755) # rwxr-xr-x
+ os.chmod(path.join(temp_dir, ".keystone_install"), 0o755) # rwxr-xr-x
for a in args:
CopyFile(path.join(build_dir, a), temp_dir)
--- /src/build_tools/change_reference_mac.py
+++ /src/build_tools/change_reference_mac.py
@@ -41,8 +41,8 @@
import optparse
import os
-from util import PrintErrorAndExit
-from util import RunOrDie
+from .util import PrintErrorAndExit
+from .util import RunOrDie
def ParseOption():
--- /src/build_tools/code_generator_util.py
+++ /src/build_tools/code_generator_util.py
@@ -33,27 +33,26 @@
__author__ = "hidehiko"
import struct
-import types
def ToCppStringLiteral(s):
"""Returns C-style string literal, or NULL if given s is None."""
if s is None:
- return 'NULL'
+ return b'NULL'
- if all(0x20 <= ord(c) <= 0x7E for c in s):
+ if all(0x20 <= c <= 0x7E for c in s):
# All characters are in ascii code.
- return '"%s"' % s.replace('\\', r'\\').replace('"', r'\"')
+ return b'"%b"' % s.replace(b'\\', br'\\').replace(b'"', br'\"')
else:
# One or more characters are non-ascii.
- return '"%s"' % ''.join(r'\x%02X' % ord(c) for c in s)
+ return b'"%b"' % b''.join(br'\x%02X' % c for c in s)
def FormatWithCppEscape(format_text, *args):
"""Returns a string filling format with args."""
literal_list = []
for arg in args:
- if isinstance(arg, (types.StringType, types.NoneType)):
+ if isinstance(arg, (bytes, type(None))):
arg = ToCppStringLiteral(arg)
literal_list.append(arg)
@@ -95,7 +94,7 @@
if target_compiler and target_compiler.startswith('msvs'):
stream.write('const uint64 k%s_data_wordtype[] = {\n' % variable_name)
- for word_index in xrange(0, len(data), 8):
+ for word_index in range(0, len(data), 8):
word_chunk = data[word_index:word_index + 8].ljust(8, '\x00')
stream.write('0x%016X, ' % struct.unpack('<Q', word_chunk))
if (word_index / 8) % 4 == 3:
@@ -111,7 +110,7 @@
stream.write('const char k%s_data[] =\n' % variable_name)
# Output 16bytes per line.
chunk_size = 16
- for index in xrange(0, len(data), chunk_size):
+ for index in range(0, len(data), chunk_size):
chunk = data[index:index + chunk_size]
stream.write('"')
stream.writelines(r'\x%02X' % ord(c) for c in chunk)
@@ -126,36 +125,50 @@
if type(codepoint_list) is int:
codepoint_list = (codepoint_list,)
if codepoint_list is None or len(codepoint_list) == 0:
- return 'null'
- result = r'"'
+ return b'null'
+ result = b'"'
for codepoint in codepoint_list:
- utf16_string = unichr(codepoint).encode('utf-16be')
+ utf16_string = chr(codepoint).encode('utf-16be')
if len(utf16_string) == 2:
(u0, l0) = utf16_string
- result += r'\u%02X%02X' % (ord(u0), ord(l0))
+ result += br'\u%02X%02X' % (u0, l0)
else:
(u0, l0, u1, l1) = utf16_string
- result += r'\u%02X%02X\u%02X%02X' % (ord(u0), ord(l0), ord(u1), ord(l1))
- result += r'"'
+ result += br'\u%02X%02X\u%02X%02X' % (u0, l0, u1, l1)
+ result += b'"'
return result
def SkipLineComment(stream, comment_prefix='#'):
"""Skips line comments from stream."""
for line in stream:
+ if isinstance(line, bytes):
+ if isinstance(comment_prefix, str):
+ comment_prefix = comment_prefix.encode('utf-8')
+ line_ending = b'\n'
+ else:
+ line_ending = '\n'
stripped_line = line.strip()
if stripped_line and not stripped_line.startswith(comment_prefix):
- yield line.rstrip('\n')
+ yield line.rstrip(line_ending)
def ParseColumnStream(stream, num_column=None, delimiter=None):
"""Returns parsed columns read from stream."""
if num_column is None:
for line in stream:
- yield line.rstrip('\n').split(delimiter)
+ if isinstance(line, bytes):
+ line_ending = b'\n'
+ else:
+ line_ending = '\n'
+ yield line.rstrip(line_ending).split(delimiter)
else:
for line in stream:
- yield line.rstrip('\n').split(delimiter)[:num_column]
+ if isinstance(line, bytes):
+ line_ending = b'\n'
+ else:
+ line_ending = '\n'
+ yield line.rstrip(line_ending).split(delimiter)[:num_column]
def SelectColumn(stream, column_index):
@@ -172,5 +185,5 @@
grouper extends the last chunk to make it an n-element chunk by adding
appropriate value, but this returns truncated chunk.
"""
- for index in xrange(0, len(iterable), n):
+ for index in range(0, len(iterable), n):
yield iterable[index:index + n]
--- /src/build_tools/codesign_mac.py
+++ /src/build_tools/codesign_mac.py
@@ -46,17 +46,17 @@
def RunOrDie(command):
"""Run the command, or die if it failed."""
- print "Running: " + command
+ print("Running: " + command)
try:
output = subprocess.check_output(command, shell=True)
- print >> sys.stderr, "=========="
- print >> sys.stderr, "COMMAND: " + command
- print >> sys.stderr, output
+ print("==========", file=sys.stderr)
+ print("COMMAND: " + command, file=sys.stderr)
+ print(output, file=sys.stderr)
except subprocess.CalledProcessError as e:
- print >> sys.stderr, "=========="
- print >> sys.stderr, "ERROR: " + command
- print >> sys.stderr, e.output
- print >> sys.stderr, "=========="
+ print("==========", file=sys.stderr)
+ print("ERROR: " + command, file=sys.stderr)
+ print(e.output, file=sys.stderr)
+ print("==========", file=sys.stderr)
sys.exit(1)
@@ -119,18 +119,18 @@
(options, unused_args) = parser.parse_args()
if not options.target:
- print "Error: --target should be specified."
- print parser.print_help()
+ print("Error: --target should be specified.")
+ print(parser.print_help())
sys.exit(1)
return options
def DumpEnviron():
- print "=== os.environ ==="
+ print("=== os.environ ===")
for key in sorted(os.environ):
- print "%s = %s" % (key, os.getenv(key))
- print "=================="
+ print("%s = %s" % (key, os.getenv(key)))
+ print("==================")
def main():
--- /src/build_tools/copy_dll_and_symbol.py
+++ /src/build_tools/copy_dll_and_symbol.py
@@ -38,7 +38,7 @@
import os
import shutil
-from util import PrintErrorAndExit
+from .util import PrintErrorAndExit
def ParseOption():
"""Parse command line options."""
@@ -98,7 +98,7 @@
if _GetLastModifiedTime(src) <= target_file_mtime:
# Older file found. Ignore.
continue
- print 'Copying %s to %s' % (src, target_file_abspath)
+ print('Copying %s to %s' % (src, target_file_abspath))
shutil.copy2(src, target_file_abspath)
break
--- /src/build_tools/copy_file.py
+++ /src/build_tools/copy_file.py
@@ -52,7 +52,7 @@
Args:
message: The error message to be printed to stderr.
"""
- print >>sys.stderr, message
+ print(message, file=sys.stderr)
sys.exit(1)
--- /src/build_tools/copy_qt_frameworks_mac.py
+++ /src/build_tools/copy_qt_frameworks_mac.py
@@ -41,9 +41,9 @@
import optparse
import os
-from copy_file import CopyFiles
-from util import PrintErrorAndExit
-from util import RunOrDie
+from .copy_file import CopyFiles
+from .util import PrintErrorAndExit
+from .util import RunOrDie
def ParseOption():
--- /src/build_tools/embed_file.py
+++ /src/build_tools/embed_file.py
@@ -46,10 +46,10 @@
def _FormatAsUint64LittleEndian(s):
"""Formats a string as uint64 value in little endian order."""
- for _ in xrange(len(s), 8):
- s += '\0'
+ for _ in range(len(s), 8):
+ s += b'\0'
s = s[::-1] # Reverse the string
- return '0x%s' % binascii.b2a_hex(s)
+ return b'0x%b' % binascii.b2a_hex(s)
def main():
@@ -57,30 +57,30 @@
with open(opts.input, 'rb') as infile:
with open(opts.output, 'wb') as outfile:
outfile.write(
- '#ifdef MOZC_EMBEDDED_FILE_%(name)s\n'
- '#error "%(name)s was already included or defined elsewhere"\n'
- '#else\n'
- '#define MOZC_EMBEDDED_FILE_%(name)s\n'
- 'const uint64 %(name)s_data[] = {\n'
- % {'name': opts.name})
+ b'#ifdef MOZC_EMBEDDED_FILE_%(name)b\n'
+ b'#error "%(name)b was already included or defined elsewhere"\n'
+ b'#else\n'
+ b'#define MOZC_EMBEDDED_FILE_%(name)b\n'
+ b'const uint64 %(name)b_data[] = {\n'
+ % {b'name': opts.name.encode('utf-8')})
while True:
chunk = infile.read(8)
if not chunk:
break
- outfile.write(' ')
+ outfile.write(b' ')
outfile.write(_FormatAsUint64LittleEndian(chunk))
- outfile.write(',\n')
+ outfile.write(b',\n')
outfile.write(
- '};\n'
- 'const EmbeddedFile %(name)s = {\n'
- ' %(name)s_data,\n'
- ' %(size)d,\n'
- '};\n'
- '#endif // MOZC_EMBEDDED_FILE_%(name)s\n'
- % {'name': opts.name,
- 'size': os.stat(opts.input).st_size})
+ b'};\n'
+ b'const EmbeddedFile %(name)b = {\n'
+ b' %(name)b_data,\n'
+ b' %(size)d,\n'
+ b'};\n'
+ b'#endif // MOZC_EMBEDDED_FILE_%(name)b\n'
+ % {b'name': opts.name.encode('utf-8'),
+ b'size': os.stat(opts.input).st_size})
if __name__ == '__main__':
--- /src/build_tools/embed_pathname.py
+++ /src/build_tools/embed_pathname.py
@@ -28,7 +28,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""A script to embed the given (relative) path name to C/C++ characters array.
+r"""A script to embed the given (relative) path name to C/C++ characters array.
Example:
./embed_pathname.py --path_to_be_embedded=d:\data\mozc
@@ -53,7 +53,7 @@
(options, unused_args) = parser.parse_args()
if not all(vars(options).values()):
- print parser.print_help()
+ print(parser.print_help())
sys.exit(1)
return options
@@ -63,7 +63,7 @@
opt = ParseOption()
path = os.path.abspath(opt.path_to_be_embedded)
# TODO(yukawa): Consider the case of non-ASCII characters.
- escaped_path = path.encode('string-escape')
+ escaped_path = path.replace('\\', '\\\\')
with open(opt.output, 'w') as output_file:
output_file.write(
'const char %s[] = "%s";\n' % (opt.constant_name, escaped_path))
--- /src/build_tools/ensure_gyp_module_path.py
+++ /src/build_tools/ensure_gyp_module_path.py
@@ -48,7 +48,7 @@
(options, _) = parser.parse_args()
if not options.expected:
- print parser.print_help()
+ print(parser.print_help())
sys.exit(1)
return options
@@ -59,20 +59,20 @@
opt = ParseOption()
expected_path = os.path.abspath(opt.expected)
if not os.path.exists(expected_path):
- print '%s does not exist.' % expected_path
+ print('%s does not exist.' % expected_path)
sys.exit(1)
try:
import gyp # NOLINT
except ImportError as e:
- print 'import gyp failed: %s' % e
+ print('import gyp failed: %s' % e)
sys.exit(1)
actual_path = os.path.abspath(gyp.__path__[0])
if expected_path != actual_path:
- print 'Unexpected gyp module is loaded on this environment.'
- print ' expected: %s' % expected_path
- print ' actual : %s' % actual_path
+ print('Unexpected gyp module is loaded on this environment.')
+ print(' expected: %s' % expected_path)
+ print(' actual : %s' % actual_path)
sys.exit(1)
if __name__ == '__main__':
--- /src/build_tools/gen_win32_resource_header.py
+++ /src/build_tools/gen_win32_resource_header.py
@@ -39,7 +39,7 @@
__author__ = "yukawa"
import logging
-import mozc_version
+from . import mozc_version
import optparse
import os
import sys
--- /src/build_tools/mozc_version.py
+++ /src/build_tools/mozc_version.py
@@ -94,7 +94,7 @@
last_digit = TARGET_PLATFORM_TO_DIGIT.get(target_platform, None)
if last_digit is None:
logging.critical('target_platform %s is invalid. Accetable ones are %s',
- target_platform, TARGET_PLATFORM_TO_DIGIT.keys())
+ target_platform, list(TARGET_PLATFORM_TO_DIGIT.keys()))
sys.exit(1)
if not revision:
@@ -314,13 +314,14 @@
self._properties = {}
if not os.path.isfile(path):
return
- for line in open(path):
- matchobj = re.match(r'(\w+)=(.*)', line.strip())
- if matchobj:
- var = matchobj.group(1)
- val = matchobj.group(2)
- if var not in self._properties:
- self._properties[var] = val
+ with open(path) as file:
+ for line in file:
+ matchobj = re.match(r'(\w+)=(.*)', line.strip())
+ if matchobj:
+ var = matchobj.group(1)
+ val = matchobj.group(2)
+ if var not in self._properties:
+ self._properties[var] = val
# Check mandatory properties.
for key in VERSION_PROPERTIES:

@ -1,600 +0,0 @@
https://github.com/google/mozc/issues/462
--- /src/build_tools/redirect.py
+++ /src/build_tools/redirect.py
@@ -58,14 +58,15 @@
process = subprocess.Popen(sys.argv, stdout=subprocess.PIPE,
universal_newlines=True)
except:
- print '=========='
- print ' ERROR: %s' % ' '.join(sys.argv)
- print '=========='
+ print('==========')
+ print(' ERROR: %s' % ' '.join(sys.argv))
+ print('==========')
raise
(stdout_content, _) = process.communicate()
# Write the stdout content to the output file.
output_file = open(output_file_name, 'w')
output_file.write(stdout_content)
+ output_file.close()
return process.wait()
if __name__ == '__main__':
--- /src/build_tools/run_after_chdir.py
+++ /src/build_tools/run_after_chdir.py
@@ -57,7 +57,7 @@
sys.argv.insert(0, sys.executable) # Inject the python interpreter path.
# We don't capture stdout and stderr from Popen. The output will just
# be emitted to a terminal or console.
- print sys.argv
+ print(sys.argv)
sys.exit(subprocess.call(sys.argv))
if __name__ == '__main__':
--- /src/build_tools/serialized_string_array_builder.py
+++ /src/build_tools/serialized_string_array_builder.py
@@ -58,11 +58,11 @@
f.write(struct.pack('<I', array_size))
# Offset and length array of (4 + 4) * array_size bytes.
- for i in xrange(array_size):
+ for i in range(array_size):
f.write(struct.pack('<I', offsets[i]))
f.write(struct.pack('<I', lengths[i]))
# Strings chunk.
- for i in xrange(array_size):
+ for i in range(array_size):
f.write(strings[i])
- f.write('\0')
+ f.write(b'\0')
--- /src/build_tools/test_tools/gtest_report.py
+++ /src/build_tools/test_tools/gtest_report.py
@@ -36,9 +36,9 @@
__author__ = "nona"
-import cStringIO as StringIO
+import io
import logging
-from xml.etree import cElementTree as ElementTree
+from xml.etree import ElementTree
class Failure(object):
@@ -87,13 +87,13 @@
"""Returns summarized error report text."""
if self.fail_num == 0:
return ''
- output = StringIO.StringIO()
+ output = io.StringIO()
for testcase in self.testcases:
if not testcase.failures:
continue
- print >>output, '%s.%s:' % (self.name, testcase.name)
+ print('%s.%s:' % (self.name, testcase.name), file=output)
for failure in testcase.failures:
- print >>output, failure.contents.encode('utf-8')
+ print(failure.contents.encode('utf-8'), file=output)
return output.getvalue()
@classmethod
--- /src/build_tools/test_tools/test_launcher.py
+++ /src/build_tools/test_tools/test_launcher.py
@@ -101,11 +101,11 @@
time.sleep(1)
try:
shutil.rmtree(self._path)
- except OSError, e:
+ except OSError as e:
logging.error('Failed to remove %s. error: %s', self._path, e)
-def _ExecuteTest((command, gtest_report_dir)):
+def _ExecuteTest(args):
"""Executes tests with specified Test command.
Args:
@@ -122,6 +122,7 @@
module, which is used in multiprocessing module.
(http://docs.python.org/library/pickle.html)
"""
+ (command, gtest_report_dir) = args
binary = command[0]
binary_filename = os.path.basename(binary)
tmp_dir = tempfile.mkdtemp()
--- /src/build_tools/tweak_data.py
+++ /src/build_tools/tweak_data.py
@@ -55,7 +55,7 @@
The value for the variable if the variable is defined in the
environment. Otherwise original string is returned.
"""
- if environment.has_key(matchobj.group(1)):
+ if matchobj.group(1) in environment:
return environment[matchobj.group(1)]
return matchobj.group(0)
--- /src/build_tools/tweak_info_plist.py
+++ /src/build_tools/tweak_info_plist.py
@@ -42,8 +42,8 @@
import logging
import optparse
import sys
-import mozc_version
-import tweak_data
+from . import mozc_version
+from . import tweak_data
_COPYRIGHT_YEAR = datetime.date.today().year
@@ -81,7 +81,7 @@
version = mozc_version.MozcVersion(options.version_file)
- copyright_message = (u'© %d Google Inc.' % _COPYRIGHT_YEAR).encode('utf-8')
+ copyright_message = ('© %d Google Inc.' % _COPYRIGHT_YEAR).encode('utf-8')
long_version = version.GetVersionString()
short_version = version.GetVersionInFormat('@MAJOR@.@MINOR@.@BUILD@')
--- /src/build_tools/tweak_info_plist_strings.py
+++ /src/build_tools/tweak_info_plist_strings.py
@@ -40,7 +40,7 @@
import logging
import optparse
import sys
-import tweak_data
+from . import tweak_data
_COPYRIGHT_YEAR = datetime.date.today().year
@@ -77,7 +77,7 @@
if options.branding == 'GoogleJapaneseInput':
variables = {
'CF_BUNDLE_NAME_EN': 'Google Japanese Input',
- 'CF_BUNDLE_NAME_JA': u'Google 日本語入力'.encode('utf-8'),
+ 'CF_BUNDLE_NAME_JA': 'Google 日本語入力'.encode('utf-8'),
'NS_HUMAN_READABLE_COPYRIGHT': copyright_message,
'INPUT_MODE_ANNOTATION': 'Google',
}
--- /src/build_tools/tweak_macinstaller_script.py
+++ /src/build_tools/tweak_macinstaller_script.py
@@ -39,7 +39,7 @@
import logging
import optparse
-import mozc_version
+from . import mozc_version
def _ReplaceVariables(data, environment):
--- /src/build_tools/tweak_pkgproj.py
+++ /src/build_tools/tweak_pkgproj.py
@@ -45,7 +45,7 @@
import os
import plistlib
import re
-import mozc_version
+from . import mozc_version
from os import path
@@ -71,7 +71,7 @@
The value for the variable if the variable is defined in the
environment. Otherwise original string is returned.
"""
- if environment.has_key(matchobj.group(1)):
+ if matchobj.group(1) in environment:
return environment[matchobj.group(1)]
return matchobj.group(0)
--- /src/build_tools/util.py
+++ /src/build_tools/util.py
@@ -73,11 +73,11 @@
return 1
-class RunOrDieError(StandardError):
+class RunOrDieError(Exception):
"""The exception class for RunOrDie."""
def __init__(self, message):
- StandardError.__init__(self, message)
+ Exception.__init__(self, message)
def RunOrDie(argv):
@@ -105,7 +105,7 @@
return # Do nothing if not exist.
if IsWindows():
# Read-only files cannot be deleted on Windows.
- os.chmod(file_name, 0700)
+ os.chmod(file_name, 0o700)
logging.debug('Removing file: %s', file_name)
os.unlink(file_name)
--- /src/build_tools/zlib_util.py
+++ /src/build_tools/zlib_util.py
@@ -58,7 +58,7 @@
def main():
if len(sys.argv) != 4:
- print >>sys.stderr, 'Invalid arguments'
+ print('Invalid arguments', file=sys.stderr)
return
if sys.argv[1] == 'compress':
Compress(sys.argv[2], sys.argv[3])
@@ -66,7 +66,7 @@
if sys.argv[1] == 'decompress':
Decompress(sys.argv[2], sys.argv[3])
return
- print >>sys.stderr, 'Unknown command:', sys.argv[1]
+ print('Unknown command:', sys.argv[1], file=sys.stderr)
if __name__ == '__main__':
--- /src/composer/internal/gen_typing_model.py
+++ /src/composer/internal/gen_typing_model.py
@@ -54,14 +54,13 @@
__author__ = "noriyukit"
import bisect
-import codecs
import collections
import optparse
import struct
UNDEFINED_COST = -1
-MAX_UINT16 = struct.unpack('H', '\xFF\xFF')[0]
-MAX_UINT8 = struct.unpack('B', '\xFF')[0]
+MAX_UINT16 = struct.unpack('H', b'\xFF\xFF')[0]
+MAX_UINT8 = struct.unpack('B', b'\xFF')[0]
def ParseArgs():
@@ -113,7 +112,7 @@
sorted_values = list(sorted(set(values)))
mapping_table = sorted_values[0]
mapping_table_size_without_special_value = mapping_table_size - 1
- span = len(sorted_values) / (mapping_table_size_without_special_value - 1)
+ span = len(sorted_values) // (mapping_table_size_without_special_value - 1)
mapping_table = [sorted_values[i * span]
for i
in range(0, mapping_table_size_without_special_value - 1)]
@@ -150,7 +149,7 @@
def GetValueTable(unique_characters, mapping_table, dictionary):
result = []
- for key, value in dictionary.iteritems():
+ for key, value in dictionary.items():
index = GetIndexFromKey(unique_characters, key)
while len(result) <= index:
result.append(len(mapping_table) - 1)
@@ -167,13 +166,13 @@
romaji_transition_cost)
with open(output_path, 'wb') as f:
f.write(struct.pack('<I', len(unique_characters)))
- f.write(''.join(unique_characters))
+ f.write(''.join(unique_characters).encode('utf-8'))
offset = 4 + len(unique_characters)
# Add padding to place value list size at 4-byte boundary.
if offset % 4:
padding_size = 4 - offset % 4
- f.write('\x00' * padding_size)
+ f.write(b'\x00' * padding_size)
offset += padding_size
f.write(struct.pack('<I', len(value_list)))
@@ -184,7 +183,7 @@
# Add padding to place mapping_table at 4-byte boundary.
if offset % 4:
padding_size = 4 - offset % 4
- f.write('\x00' * padding_size)
+ f.write(b'\x00' * padding_size)
offset += padding_size
for v in mapping_table:
@@ -198,7 +197,8 @@
# - trigram['vw']['x'] = -500 * log(P(x | 'vw'))
unigram = {}
trigram = collections.defaultdict(dict)
- for line in codecs.open(options.input_path, 'r', encoding='utf-8'):
+ input_file = open(options.input_path, 'r', encoding='utf-8')
+ for line in input_file:
line = line.rstrip()
ngram, cost = line.split('\t')
cost = int(cost)
@@ -206,6 +206,7 @@
unigram[ngram] = cost
else:
trigram[ngram[:-1]][ngram[-1]] = cost
+ input_file.close()
# Calculate ngram-related cost for each 'vw' and 'x':
# -500 * log( P('x' | 'vw') / P('x') )
--- /src/converter/gen_boundary_data.py
+++ /src/converter/gen_boundary_data.py
@@ -70,7 +70,8 @@
def LoadPatterns(file):
prefix = []
suffix = []
- for line in open(file, 'r'):
+ fh = open(file, 'r')
+ for line in fh:
if len(line) <= 1 or line[0] == '#':
continue
fields = line.split()
@@ -84,8 +85,9 @@
elif label == 'SUFFIX':
suffix.append([re.compile(PatternToRegexp(feature)), cost])
else:
- print 'format error %s' % (line)
+ print('format error %s' % (line))
sys.exit(0)
+ fh.close()
return (prefix, suffix)
@@ -100,19 +102,23 @@
def LoadFeatures(filename):
features = []
- for line in open(filename, 'r'):
+ fh = open(filename, 'r')
+ for line in fh:
fields = line.split()
features.append(fields[1])
+ fh.close()
return features
def CountSpecialPos(filename):
count = 0
- for line in open(filename, 'r'):
+ fh = open(filename, 'r')
+ for line in fh:
line = line.rstrip()
if not line or line[0] == '#':
continue
count += 1
+ fh.close()
return count
@@ -141,7 +147,7 @@
f.write(struct.pack('<H', GetCost(prefix, feature)))
f.write(struct.pack('<H', GetCost(suffix, feature)))
- for _ in xrange(num_special_pos):
+ for _ in range(num_special_pos):
f.write(struct.pack('<H', 0))
f.write(struct.pack('<H', 0))
--- /src/converter/gen_quality_regression_test_data.py
+++ /src/converter/gen_quality_regression_test_data.py
@@ -84,7 +84,7 @@
else _ENABLED)
id = issue.attributes['id'].value
target = GetText(issue.getElementsByTagName('target'))
- for detail in issue.getElementsByTagName(u'detail'):
+ for detail in issue.getElementsByTagName('detail'):
fields = []
fields.append('mozcsu_%s' % id)
for key in ('reading', 'output', 'actionStatus', 'rank', 'accuracy'):
@@ -104,19 +104,19 @@
def GenerateHeader(files):
try:
- print 'namespace mozc{'
- print 'struct TestCase {'
- print ' const bool enabled;'
- print ' const char *tsv;'
- print '} kTestData[] = {'
+ print('namespace mozc{')
+ print('struct TestCase {')
+ print(' const bool enabled;')
+ print(' const char *tsv;')
+ print('} kTestData[] = {')
for file in files:
for enabled, line in ParseFile(file):
- print ' {%s, "%s"},' % (enabled, EscapeString(line))
- print ' {false, nullptr},'
- print '};'
- print '} // namespace mozc'
+ print(' {%s, "%s"},' % (enabled, EscapeString(line)))
+ print(' {false, nullptr},')
+ print('};')
+ print('} // namespace mozc')
except:
- print 'cannot open %s' % (file)
+ print('cannot open %s' % (file))
sys.exit(1)
--- /src/converter/gen_segmenter_code.py
+++ /src/converter/gen_segmenter_code.py
@@ -54,18 +54,22 @@
pos = {}
max_id = 0
- for line in open(id_file, "r"):
+ fh = open(id_file, "r")
+ for line in fh:
fields = line.split()
pos[fields[1]] = fields[0]
max_id = max(int(fields[0]), max_id)
+ fh.close()
max_id = max_id + 1
- for line in open(special_pos_file, "r"):
+ fh = open(special_pos_file, "r")
+ for line in fh:
if len(line) <= 1 or line[0] == '#':
continue
fields = line.split()
pos[fields[0]] = ("%d" % max_id)
max_id = max_id + 1
+ fh.close()
return pos
@@ -79,8 +83,7 @@
pat = re.compile(PatternToRegexp(pattern))
min = -1;
max = -1;
- keys = pos.keys()
- keys.sort()
+ keys = sorted(pos.keys())
range = []
@@ -107,7 +110,7 @@
tmp.append("(%s >= %s && %s <= %s)" % (name, r[0], name, r[1]))
if len(tmp) == 0:
- print "FATAL: No rule fiind %s" % (pattern)
+ print("FATAL: No rule fiind %s" % (pattern))
sys.exit(-1)
return " || ".join(tmp)
@@ -115,19 +118,21 @@
def main():
pos = ReadPOSID(sys.argv[1], sys.argv[2])
- print HEADER % (len(pos.keys()), len(pos.keys()))
+ print(HEADER % (len(pos.keys()), len(pos.keys())))
- for line in open(sys.argv[3], "r"):
+ fh = open(sys.argv[3], "r")
+ for line in fh:
if len(line) <= 1 or line[0] == '#':
continue
(l, r, result) = line.split()
result = result.lower()
lcond = GetRange(pos, l, "rid") or "true";
rcond = GetRange(pos, r, "lid") or "true";
- print " // %s %s %s" % (l, r, result)
- print " if ((%s) && (%s)) { return %s; }" % (lcond, rcond, result)
+ print(" // %s %s %s" % (l, r, result))
+ print(" if ((%s) && (%s)) { return %s; }" % (lcond, rcond, result))
+ fh.close()
- print FOOTER
+ print(FOOTER)
if __name__ == "__main__":
main()
--- /src/data_manager/gen_connection_data.py
+++ /src/data_manager/gen_connection_data.py
@@ -32,8 +32,7 @@
__author__ = "hidehiko"
-import cStringIO as StringIO
-import itertools
+import io
import logging
import optparse
import os
@@ -45,7 +44,7 @@
INVALID_COST = 30000
INVALID_1BYTE_COST = 255
RESOLUTION_FOR_1BYTE = 64
-FILE_MAGIC = '\xAB\xCD'
+FILE_MAGIC = b'\xAB\xCD'
FALSE_VALUES = ['f', 'false', '0']
TRUE_VALUES = ['t', 'true', '1']
@@ -79,28 +78,28 @@
# The result is a square matrix.
mat_size = pos_size + special_pos_size
- matrix = [[0] * mat_size for _ in xrange(mat_size)]
+ matrix = [[0] * mat_size for _ in range(mat_size)]
with open(text_connection_file) as stream:
stream = code_generator_util.SkipLineComment(stream)
# The first line contains the matrix column/row size.
- size = stream.next().rstrip()
+ size = next(stream).rstrip()
assert (int(size) == pos_size), '%s != %d' % (size, pos_size)
for array_index, cost in enumerate(stream):
cost = int(cost.rstrip())
- rid = array_index / pos_size
+ rid = array_index // pos_size
lid = array_index % pos_size
if rid == 0 and lid == 0:
cost = 0
matrix[rid][lid] = cost
# Fill INVALID_COST in matrix elements for special POS.
- for rid in xrange(pos_size, mat_size):
- for lid in xrange(1, mat_size): # Skip EOS
+ for rid in range(pos_size, mat_size):
+ for lid in range(1, mat_size): # Skip EOS
matrix[rid][lid] = INVALID_COST
- for lid in xrange(pos_size, mat_size):
- for rid in xrange(1, mat_size): # Skip BOS
+ for lid in range(pos_size, mat_size):
+ for rid in range(1, mat_size): # Skip BOS
matrix[rid][lid] = INVALID_COST
return matrix
@@ -116,7 +115,7 @@
# Heuristically, we do not compress INVALID_COST.
continue
m[cost] = m.get(cost, 0) + 1
- mode_value = max(m.iteritems(), key=lambda (_, count): count)[0]
+ mode_value = max(m.items(), key=lambda x: x[1])[0]
result.append(mode_value)
return result
@@ -126,8 +125,8 @@
# list, and fill None into the matrix if it equals to the corresponding
# mode value.
assert len(matrix) == len(mode_value_list)
- for row, mode_value in itertools.izip(matrix, mode_value_list):
- for index in xrange(len(row)):
+ for row, mode_value in zip(matrix, mode_value_list):
+ for index in range(len(row)):
if row[index] == mode_value:
row[index] = None
@@ -179,7 +178,7 @@
resolution = RESOLUTION_FOR_1BYTE
else:
resolution = 1
- stream = StringIO.StringIO()
+ stream = io.BytesIO()
# Output header.
stream.write(FILE_MAGIC)
@@ -194,7 +193,7 @@
# 4 bytes alignment.
if len(mode_value_list) % 2:
- stream.write('\x00\x00')
+ stream.write(b'\x00\x00')
# Process each row:
for row in matrix:
@@ -218,7 +217,7 @@
if cost == INVALID_COST:
cost = INVALID_1BYTE_COST
else:
- cost /= resolution
+ cost //= resolution
assert cost != INVALID_1BYTE_COST
values.append(cost)
@@ -237,7 +236,7 @@
values_size = len(values) * 2
# Output the bits for a row.
- stream.write(struct.pack('<HH', len(compact_bits) / 8, values_size))
+ stream.write(struct.pack('<HH', len(compact_bits) // 8, values_size))
OutputBitList(chunk_bits, stream)
OutputBitList(compact_bits, stream)
if use_1byte_cost:

@ -1,583 +0,0 @@
https://github.com/google/mozc/issues/462
--- /src/dictionary/gen_pos_map.py
+++ /src/dictionary/gen_pos_map.py
@@ -39,7 +39,7 @@
from build_tools import code_generator_util
-HEADER = """// Copyright 2009 Google Inc. All Rights Reserved.
+HEADER = b"""// Copyright 2009 Google Inc. All Rights Reserved.
// Author: keni
#ifndef MOZC_DICTIONARY_POS_MAP_H_
@@ -48,13 +48,13 @@
// POS conversion rules
const POSMap kPOSMap[] = {
"""
-FOOTER = """};
+FOOTER = b"""};
#endif // MOZC_DICTIONARY_POS_MAP_H_
"""
def ParseUserPos(user_pos_file):
- with open(user_pos_file, 'r') as stream:
+ with open(user_pos_file, 'rb') as stream:
stream = code_generator_util.SkipLineComment(stream)
stream = code_generator_util.ParseColumnStream(stream, num_column=2)
return dict((key, enum_value) for key, enum_value in stream)
@@ -64,7 +64,7 @@
user_pos_map = ParseUserPos(user_pos_file)
result = {}
- with open(third_party_pos_map_file, 'r') as stream:
+ with open(third_party_pos_map_file, 'rb') as stream:
stream = code_generator_util.SkipLineComment(stream)
for columns in code_generator_util.ParseColumnStream(stream, num_column=2):
third_party_pos_name, mozc_pos = (columns + [None])[:2]
@@ -78,7 +78,7 @@
result[third_party_pos_name] = mozc_pos
# Create mozc_pos to mozc_pos map.
- for key, value in user_pos_map.iteritems():
+ for key, value in user_pos_map.items():
if key in result:
assert (result[key] == value)
continue
@@ -94,10 +94,10 @@
if value is None:
# Invalid PosType.
value = (
- 'static_cast< ::mozc::user_dictionary::UserDictionary::PosType>(-1)')
+ b'static_cast< ::mozc::user_dictionary::UserDictionary::PosType>(-1)')
else:
- value = '::mozc::user_dictionary::UserDictionary::' + value
- output.write(' { %s, %s },\n' % (key, value))
+ value = b'::mozc::user_dictionary::UserDictionary::' + value
+ output.write(b' { %s, %s },\n' % (key, value))
output.write(FOOTER)
@@ -121,7 +121,7 @@
pos_map = GeneratePosMap(options.third_party_pos_map_file,
options.user_pos_file)
- with open(options.output, 'w') as stream:
+ with open(options.output, 'wb') as stream:
OutputPosMap(pos_map, stream)
--- /src/dictionary/gen_pos_rewrite_rule.py
+++ /src/dictionary/gen_pos_rewrite_rule.py
@@ -46,29 +46,34 @@
def LoadRewriteMapRule(filename):
- fh = open(filename)
+ fh = open(filename, 'rb')
rule = []
for line in fh:
- line = line.rstrip('\n')
- if not line or line.startswith('#'):
+ line = line.rstrip(b'\n')
+ if not line or line.startswith(b'#'):
continue
fields = line.split()
rule.append([fields[0], fields[1]])
+ fh.close()
return rule
def ReadPOSID(id_file, special_pos_file):
pos_list = []
- for line in open(id_file, 'r'):
+ fh = open(id_file, 'rb')
+ for line in fh:
fields = line.split()
pos_list.append(fields[1])
+ fh.close()
- for line in open(special_pos_file, 'r'):
- if len(line) <= 1 or line[0] == '#':
+ fh = open(special_pos_file, 'rb')
+ for line in fh:
+ if len(line) <= 1 or line[0:1] == b'#':
continue
fields = line.split()
pos_list.append(fields[0])
+ fh.close()
return pos_list
@@ -112,7 +117,7 @@
ids.append(id)
with open(opts.output, 'wb') as f:
- f.write(''.join(chr(id) for id in ids))
+ f.write(''.join(chr(id) for id in ids).encode('utf-8'))
if __name__ == '__main__':
--- /src/dictionary/gen_suffix_data.py
+++ /src/dictionary/gen_suffix_data.py
@@ -52,10 +52,10 @@
opts = _ParseOptions()
result = []
- with open(opts.input, 'r') as stream:
+ with open(opts.input, 'rb') as stream:
for line in stream:
- line = line.rstrip('\r\n')
- fields = line.split('\t')
+ line = line.rstrip(b'\r\n')
+ fields = line.split(b'\t')
key = fields[0]
lid = int(fields[1])
rid = int(fields[2])
@@ -63,7 +63,7 @@
value = fields[4]
if key == value:
- value = ''
+ value = b''
result.append((key, value, lid, rid, cost))
--- /src/dictionary/gen_user_pos_data.py
+++ /src/dictionary/gen_user_pos_data.py
@@ -64,7 +64,7 @@
f.write(struct.pack('<H', conjugation_id))
serialized_string_array_builder.SerializeToFile(
- sorted(string_index.iterkeys()), output_string_array)
+ sorted(x.encode('utf-8') for x in string_index.keys()), output_string_array)
def ParseOptions():
@@ -100,7 +100,7 @@
if options.output_pos_list:
serialized_string_array_builder.SerializeToFile(
- [pos for (pos, _) in user_pos.data], options.output_pos_list)
+ [pos.encode('utf-8') for (pos, _) in user_pos.data], options.output_pos_list)
if __name__ == '__main__':
--- /src/dictionary/gen_zip_code_seed.py
+++ /src/dictionary/gen_zip_code_seed.py
@@ -83,7 +83,7 @@
address = unicodedata.normalize('NFKC', self.address)
line = '\t'.join([zip_code, '0', '0', str(ZIP_CODE_COST),
address, ZIP_CODE_LABEL])
- print line.encode('utf-8')
+ print(line.encode('utf-8'))
def ProcessZipCodeCSV(file_name):
@@ -105,26 +105,26 @@
def ReadZipCodeEntries(zip_code, level1, level2, level3):
"""Read zip code entries."""
- return [ZipEntry(zip_code, u''.join([level1, level2, town]))
+ return [ZipEntry(zip_code, ''.join([level1, level2, town]))
for town in ParseTownName(level3)]
def ReadJigyosyoEntry(zip_code, level1, level2, level3, name):
"""Read jigyosyo entry."""
return ZipEntry(zip_code,
- u''.join([level1, level2, level3, u' ', name]))
+ ''.join([level1, level2, level3, ' ', name]))
def ParseTownName(level3):
"""Parse town name."""
- if level3.find(u'以下に掲載がない場合') != -1:
+ if level3.find('以下に掲載がない場合') != -1:
return ['']
assert CanParseAddress(level3), ('failed to be merged %s'
% level3.encode('utf-8'))
# We ignore additional information here.
- level3 = re.sub(u'.*', u'', level3, re.U)
+ level3 = re.sub('.*', '', level3, re.U)
# For 地割, we have these cases.
# XX1地割
@@ -134,7 +134,7 @@
# XX第1地割、XX第2地割、
# XX第1地割〜XX第2地割、
# We simply use XX for them.
- chiwari_match = re.match(u'(\D*?)第?\d+地割.*', level3, re.U)
+ chiwari_match = re.match('(\D*?)第?\d+地割.*', level3, re.U)
if chiwari_match:
town = chiwari_match.group(1)
return [town]
@@ -144,21 +144,21 @@
# -> XX町YY and (XX町)ZZ
# YY、ZZ
# -> YY and ZZ
- chou_match = re.match(u'(.*町)?(.*)', level3, re.U)
+ chou_match = re.match('(.*町)?(.*)', level3, re.U)
if chou_match:
- chou = u''
+ chou = ''
if chou_match.group(1):
chou = chou_match.group(1)
rests = chou_match.group(2)
- return [chou + rest for rest in rests.split(u'、')]
+ return [chou + rest for rest in rests.split('、')]
return [level3]
def CanParseAddress(address):
"""Return true for valid address."""
- return (address.find(u'') == -1 or
- address.find(u'') != -1)
+ return (address.find('') == -1 or
+ address.find('') != -1)
def ParseOptions():
--- /src/dictionary/zip_code_util.py
+++ /src/dictionary/zip_code_util.py
@@ -86,11 +86,11 @@
_SPECIAL_CASES = [
- SpecialMergeZip(u'5900111', u'大阪府', u'堺市中区', [u'三原台']),
- SpecialMergeZip(u'8710046', u'大分県', u'中津市',
- [u'金谷', u'西堀端', u'東堀端', u'古金谷']),
- SpecialMergeZip(u'9218046', u'石川県', u'金沢市',
- [u'大桑町', u'三小牛町']),
+ SpecialMergeZip('5900111', '大阪府', '堺市中区', ['三原台']),
+ SpecialMergeZip('8710046', '大分県', '中津市',
+ ['金谷', '西堀端', '東堀端', '古金谷']),
+ SpecialMergeZip('9218046', '石川県', '金沢市',
+ ['大桑町', '三小牛町']),
]
--- /src/gui/character_pad/data/gen_cp932_map.py
+++ /src/gui/character_pad/data/gen_cp932_map.py
@@ -32,7 +32,6 @@
import re
import sys
-import string
kUnicodePat = re.compile(r'0x[0-9A-Fa-f]{2,4}')
def IsValidUnicode(n):
@@ -42,28 +41,29 @@
fh = open(sys.argv[1])
result = {}
for line in fh.readlines():
- if line[0] is '#':
+ if line[0] == '#':
continue
- array = string.split(line)
+ array = line.split()
sjis = array[0]
ucs2 = array[1]
if eval(sjis) < 32 or not IsValidUnicode(ucs2):
continue
result.setdefault(ucs2, sjis)
+ fh.close()
keys = sorted(result.keys())
- print "struct CP932MapData {"
- print " unsigned int ucs4;"
- print " unsigned short int sjis;"
- print "};"
- print ""
- print "static const size_t kCP932MapDataSize = %d;" % (len(keys))
- print "static const CP932MapData kCP932MapData[] = {"
+ print("struct CP932MapData {")
+ print(" unsigned int ucs4;")
+ print(" unsigned short int sjis;")
+ print("};")
+ print("")
+ print("static const size_t kCP932MapDataSize = %d;" % (len(keys)))
+ print("static const CP932MapData kCP932MapData[] = {")
for n in keys:
- print " { %s, %s }," % (n ,result[n])
- print " { 0, 0 }";
- print "};"
+ print(" { %s, %s }," % (n ,result[n]))
+ print(" { 0, 0 }");
+ print("};")
if __name__ == "__main__":
main()
--- /src/gui/character_pad/data/gen_local_character_map.py
+++ /src/gui/character_pad/data/gen_local_character_map.py
@@ -30,7 +30,6 @@
__author__ = "taku"
-import string
import re
import sys
@@ -43,9 +42,9 @@
fh = open(filename)
result = []
for line in fh.readlines():
- if line[0] is '#':
+ if line[0] == '#':
continue
- array = string.split(line)
+ array = line.split()
jis = array[0].replace('0x', '')
ucs2 = array[1].replace('0x', '')
if len(jis) == 2:
@@ -53,6 +52,7 @@
if IsValidUnicode(ucs2):
result.append([jis, ucs2])
+ fh.close()
return ["JISX0201", result]
@@ -60,13 +60,14 @@
fh = open(filename)
result = []
for line in fh.readlines():
- if line[0] is '#':
+ if line[0] == '#':
continue
array = line.split()
jis = array[1].replace('0x', '')
ucs2 = array[2].replace('0x', '')
if IsValidUnicode(ucs2):
result.append([jis, ucs2])
+ fh.close()
return ["JISX0208", result]
@@ -74,13 +75,14 @@
fh = open(filename)
result = []
for line in fh.readlines():
- if line[0] is '#':
+ if line[0] == '#':
continue
array = line.split()
jis = array[0].replace('0x', '')
ucs2 = array[1].replace('0x', '')
if IsValidUnicode(ucs2):
result.append([jis, ucs2])
+ fh.close()
return ["JISX0212", result]
@@ -88,7 +90,7 @@
fh = open(filename)
result = []
for line in fh.readlines():
- if line[0] is '#':
+ if line[0] == '#':
continue
array = line.split()
sjis = array[0].replace('0x', '')
@@ -100,19 +102,20 @@
if IsValidUnicode(ucs2):
result.append([sjis, ucs2])
+ fh.close()
return ["CP932", result]
def Output(arg):
name = arg[0]
result = arg[1]
- print "static const size_t k%sMapSize = %d;" % (name, len(result))
- print "static const mozc::gui::CharacterPalette::LocalCharacterMap k%sMap[] = {" % (name)
+ print("static const size_t k%sMapSize = %d;" % (name, len(result)))
+ print("static const mozc::gui::CharacterPalette::LocalCharacterMap k%sMap[] = {" % (name))
for n in result:
- print " { 0x%s, 0x%s }," % (n[0] ,n[1])
- print " { 0, 0 }";
- print "};"
- print ""
+ print(" { 0x%s, 0x%s }," % (n[0] ,n[1]))
+ print(" { 0, 0 }");
+ print("};")
+ print("")
if __name__ == "__main__":
Output(LoadJISX0201(sys.argv[1]))
--- /src/gui/character_pad/data/gen_unicode_blocks.py
+++ /src/gui/character_pad/data/gen_unicode_blocks.py
@@ -33,13 +33,13 @@
import sys
import re
-re = re.compile('^(.....?)\.\.(.....?); (.+)')
+re = re.compile(r'^(.....?)\.\.(.....?); (.+)')
def main():
- print "static const mozc::gui::CharacterPalette::UnicodeBlock kUnicodeBlockTable[] = {"
+ print("static const mozc::gui::CharacterPalette::UnicodeBlock kUnicodeBlockTable[] = {")
fh = open(sys.argv[1])
for line in fh.readlines():
- if line[0] is '#':
+ if line[0] == '#':
continue
m = re.match(line)
if m is not None:
@@ -47,11 +47,12 @@
end = int(m.group(2), 16)
name = m.group(3)
if start <= 0x2FFFF and end <= 0x2FFFF:
- print " { \"%s\", { %d, %d } }," % (name, start, end)
+ print(" { \"%s\", { %d, %d } }," % (name, start, end))
+ fh.close()
- print " { NULL, { 0, 0 } }"
- print "};"
- print ""
+ print(" { NULL, { 0, 0 } }")
+ print("};")
+ print("")
if __name__ == "__main__":
main()
--- /src/gui/character_pad/data/gen_unicode_data.py
+++ /src/gui/character_pad/data/gen_unicode_data.py
@@ -46,18 +46,19 @@
code = int(code, 16)
if code < 0x2FFFF:
results.append(" { %d, \"%s\" }," % (code, desc))
+ fh.close()
- print "struct UnicodeData {";
- print " char32 ucs4;";
- print " const char *description;";
- print "};";
- print ""
- print "static const size_t kUnicodeDataSize = %d;" % (len(results))
- print "static const UnicodeData kUnicodeData[] = {";
+ print("struct UnicodeData {");
+ print(" char32 ucs4;");
+ print(" const char *description;");
+ print("};");
+ print("")
+ print("static const size_t kUnicodeDataSize = %d;" % (len(results)))
+ print("static const UnicodeData kUnicodeData[] = {");
for line in results:
- print line;
- print " { 0, NULL }";
- print "};";
+ print(line);
+ print(" { 0, NULL }");
+ print("};");
if __name__ == "__main__":
main()
--- /src/gui/character_pad/data/gen_unihan_data.py
+++ /src/gui/character_pad/data/gen_unihan_data.py
@@ -31,35 +31,34 @@
__author__ = "taku"
import re
-import string
import sys
rs = {}
def Escape(n):
- if n is not "NULL":
+ if n != "NULL":
return "\"%s\"" % (n)
else:
return "NULL"
def GetCode(n):
- if n is not "NULL":
- n = string.replace(n, '0-', 'JIS X 0208: 0x')
- n = string.replace(n, '1-', 'JIS X 0212: 0x')
- n = string.replace(n, '3-', 'JIS X 0213: 0x')
- n = string.replace(n, '4-', 'JIS X 0213: 0x')
- n = string.replace(n, 'A-', 'Vendors Ideographs: 0x')
- n = string.replace(n, '3A', 'JIS X 0213 2000: 0x')
+ if n != "NULL":
+ n = n.replace('0-', 'JIS X 0208: 0x')
+ n = n.replace('1-', 'JIS X 0212: 0x')
+ n = n.replace('3-', 'JIS X 0213: 0x')
+ n = n.replace('4-', 'JIS X 0213: 0x')
+ n = n.replace('A-', 'Vendors Ideographs: 0x')
+ n = n.replace('3A', 'JIS X 0213 2000: 0x')
return "\"%s\"" % n
else:
return "NULL"
def GetRadical(n):
pat = re.compile(r'^(\d+)\.')
- if n is not "NULL":
+ if n != "NULL":
m = pat.match(n)
if m:
result = rs[m.group(1)]
- return "\"%s\"" % (result.encode('string_escape'))
+ return "\"%s\"" % result
else:
return "NULL"
else:
@@ -73,6 +72,7 @@
id = array[1]
radical = array[2]
rs[id] = radical
+ fh.close()
dic = {}
pat = re.compile(r'^U\+(\S+)\s+(kTotalStrokes|kJapaneseKun|kJapaneseOn|kRSUnicode|kIRG_JSource)\t(.+)')
@@ -86,23 +86,24 @@
n = int(m.group(1), 16)
if n <= 65536:
dic.setdefault(key, {}).setdefault(field, value)
+ fh.close()
keys = sorted(dic.keys())
- print "struct UnihanData {";
- print " unsigned int ucs4;";
+ print("struct UnihanData {");
+ print(" unsigned int ucs4;");
# Since the total strokes defined in Unihan data is Chinese-based
# number, we can't use it.
# print " unsigned char total_strokes;";
- print " const char *japanese_kun;";
- print " const char *japanese_on;";
+ print(" const char *japanese_kun;");
+ print(" const char *japanese_on;");
# Since the radical information defined in Unihan data is Chinese-based
# number, we can't use it.
# print " const char *radical;";
- print " const char *IRG_jsource;";
- print "};"
- print "static const size_t kUnihanDataSize = %d;" % (len(keys))
- print "static const UnihanData kUnihanData[] = {"
+ print(" const char *IRG_jsource;");
+ print("};")
+ print("static const size_t kUnihanDataSize = %d;" % (len(keys)))
+ print("static const UnihanData kUnihanData[] = {")
for key in keys:
total_strokes = dic[key].get("kTotalStrokes", "0")
@@ -111,9 +112,9 @@
rad = GetRadical(dic[key].get("kRSUnicode", "NULL"))
code = GetCode(dic[key].get("kIRG_JSource", "NULL"))
# print " { 0x%s, %s, %s, %s, %s, %s }," % (key, total_strokes, kun, on, rad, code)
- print " { 0x%s, %s, %s, %s }," % (key, kun, on, code)
+ print(" { 0x%s, %s, %s, %s }," % (key, kun, on, code))
- print "};"
+ print("};")
if __name__ == "__main__":
main()

@ -1,537 +0,0 @@
https://github.com/google/mozc/issues/462
--- /src/prediction/gen_zero_query_data.py
+++ /src/prediction/gen_zero_query_data.py
@@ -59,20 +59,20 @@
Returns:
A integer indicating parsed pua.
"""
- if not s or s[0] == '>':
+ if not s or s[0:1] == b'>':
return 0
return int(s, 16)
def NormalizeString(string):
return unicodedata.normalize(
- 'NFKC', string.decode('utf-8')).encode('utf-8').replace('~', '〜')
+ 'NFKC', string.decode('utf-8')).replace('~', '〜').encode('utf-8')
def RemoveTrailingNumber(string):
if not string:
- return ''
- return re.sub(r'^([^0-9]+)[0-9]+$', r'\1', string)
+ return b''
+ return re.sub(br'^([^0-9]+)[0-9]+$', r'\1', string)
def GetReadingsFromDescription(description):
@@ -84,19 +84,19 @@
# - ビル・建物
# \xE3\x83\xBB : "・"
return [RemoveTrailingNumber(token) for token
- in re.split(r'(?:\(|\)|/|\xE3\x83\xBB)+', normalized)]
+ in re.split(br'(?:\(|\)|/|\xE3\x83\xBB)+', normalized)]
def ReadEmojiTsv(stream):
"""Reads emoji data from stream and returns zero query data."""
zero_query_dict = defaultdict(list)
stream = code_generator_util.SkipLineComment(stream)
- for columns in code_generator_util.ParseColumnStream(stream, delimiter='\t'):
+ for columns in code_generator_util.ParseColumnStream(stream, delimiter=b'\t'):
if len(columns) != 13:
- logging.critical('format error: %s', '\t'.join(columns))
+ logging.critical('format error: %s', b'\t'.join(columns))
sys.exit(1)
- code_points = columns[0].split(' ')
+ code_points = columns[0].split(b' ')
# Emoji code point.
emoji = columns[1]
@@ -114,12 +114,12 @@
# - Composite emoji which has multiple code point.
# NOTE: Some Unicode 6.0 emoji don't have PUA, and it is also omitted.
# TODO(hsumita): Check the availability of such emoji and enable it.
- logging.info('Skip %s', ' '.join(code_points))
+ logging.info('Skip %s', b' '.join(code_points))
continue
reading_list = []
# \xe3\x80\x80 is a full-width space
- for reading in re.split(r'(?: |\xe3\x80\x80)+', NormalizeString(readings)):
+ for reading in re.split(br'(?: |\xe3\x80\x80)+', NormalizeString(readings)):
if not reading:
continue
reading_list.append(reading)
@@ -158,15 +158,15 @@
zero_query_dict = defaultdict(list)
for line in input_stream:
- if line.startswith('#'):
+ if line.startswith(b'#'):
continue
- line = line.rstrip('\r\n')
+ line = line.rstrip(b'\r\n')
if not line:
continue
- tokens = line.split('\t')
+ tokens = line.split(b'\t')
key = tokens[0]
- values = tokens[1].split(',')
+ values = tokens[1].split(b',')
for value in values:
zero_query_dict[key].append(
@@ -179,16 +179,16 @@
"""Reads emoticon data from stream and returns zero query data."""
zero_query_dict = defaultdict(list)
stream = code_generator_util.SkipLineComment(stream)
- for columns in code_generator_util.ParseColumnStream(stream, delimiter='\t'):
+ for columns in code_generator_util.ParseColumnStream(stream, delimiter=b'\t'):
if len(columns) != 3:
- logging.critical('format error: %s', '\t'.join(columns))
+ logging.critical('format error: %s', b'\t'.join(columns))
sys.exit(1)
emoticon = columns[0]
readings = columns[2]
# \xe3\x80\x80 is a full-width space
- for reading in re.split(r'(?: |\xe3\x80\x80)+', readings.strip()):
+ for reading in re.split(br'(?: |\xe3\x80\x80)+', readings.strip()):
if not reading:
continue
zero_query_dict[reading].append(
@@ -202,9 +202,9 @@
"""Reads emoji data from stream and returns zero query data."""
zero_query_dict = defaultdict(list)
stream = code_generator_util.SkipLineComment(stream)
- for columns in code_generator_util.ParseColumnStream(stream, delimiter='\t'):
+ for columns in code_generator_util.ParseColumnStream(stream, delimiter=b'\t'):
if len(columns) < 3:
- logging.warning('format error: %s', '\t'.join(columns))
+ logging.warning('format error: %s', b'\t'.join(columns))
continue
symbol = columns[1]
@@ -222,7 +222,7 @@
continue
# \xe3\x80\x80 is a full-width space
- for reading in re.split(r'(?: |\xe3\x80\x80)+', readings.strip()):
+ for reading in re.split(br'(?: |\xe3\x80\x80)+', readings.strip()):
if not reading:
continue
zero_query_dict[reading].append(
@@ -247,7 +247,7 @@
def IsValidKeyForZeroQuery(key):
"""Returns if the key is valid for zero query trigger."""
- is_ascii = all(ord(char) < 128 for char in key)
+ is_ascii = all(char < 128 for char in key)
return not is_ascii
@@ -301,13 +301,13 @@
def main():
options = ParseOptions()
- with open(options.input_rule, 'r') as input_stream:
+ with open(options.input_rule, 'rb') as input_stream:
zero_query_rule_dict = ReadZeroQueryRuleData(input_stream)
- with open(options.input_symbol, 'r') as input_stream:
+ with open(options.input_symbol, 'rb') as input_stream:
zero_query_symbol_dict = ReadSymbolTsv(input_stream)
- with open(options.input_emoji, 'r') as input_stream:
+ with open(options.input_emoji, 'rb') as input_stream:
zero_query_emoji_dict = ReadEmojiTsv(input_stream)
- with open(options.input_emoticon, 'r') as input_stream:
+ with open(options.input_emoticon, 'rb') as input_stream:
zero_query_emoticon_dict = ReadEmoticonTsv(input_stream)
merged_zero_query_dict = MergeZeroQueryData(
--- /src/prediction/gen_zero_query_number_data.py
+++ /src/prediction/gen_zero_query_number_data.py
@@ -41,15 +41,15 @@
zero_query_dict = defaultdict(list)
for line in input_stream:
- if line.startswith('#'):
+ if line.startswith(b'#'):
continue
- line = line.rstrip('\r\n')
+ line = line.rstrip(b'\r\n')
if not line:
continue
- tokens = line.split('\t')
+ tokens = line.split(b'\t')
key = tokens[0]
- values = tokens[1].split(',')
+ values = tokens[1].split(b',')
for value in values:
zero_query_dict[key].append(
@@ -71,7 +71,7 @@
def main():
options = ParseOption()
- with open(options.input, 'r') as input_stream:
+ with open(options.input, 'rb') as input_stream:
zero_query_dict = ReadZeroQueryNumberData(input_stream)
util.WriteZeroQueryData(zero_query_dict,
options.output_token_array,
--- /src/prediction/gen_zero_query_util.py
+++ /src/prediction/gen_zero_query_util.py
@@ -69,7 +69,7 @@
output_string_array):
# Collect all the strings and assing index in ascending order
string_index = {}
- for key, entry_list in zero_query_dict.iteritems():
+ for key, entry_list in zero_query_dict.items():
string_index[key] = 0
for entry in entry_list:
string_index[entry.value] = 0
--- /src/rewriter/gen_counter_suffix_array.py
+++ /src/rewriter/gen_counter_suffix_array.py
@@ -43,7 +43,7 @@
with codecs.open(id_file, 'r', encoding='utf-8') as stream:
stream = code_generator_util.ParseColumnStream(stream, num_column=2)
for pos_id, pos_name in stream:
- if pos_name.startswith(u'名詞,接尾,助数詞'):
+ if pos_name.startswith('名詞,接尾,助数詞'):
pos_ids.add(pos_id)
return pos_ids
--- /src/rewriter/gen_emoji_rewriter_data.py
+++ /src/rewriter/gen_emoji_rewriter_data.py
@@ -74,19 +74,19 @@
the glyph (in other words, it has alternative (primary) code point, which
doesn't lead '>' and that's why we'll ignore it).
"""
- if not s or s[0] == '>':
+ if not s or s[0:1] == b'>':
return None
return int(s, 16)
-_FULLWIDTH_RE = re.compile(ur'[-]') # U+FF01 - U+FF5E
+_FULLWIDTH_RE = re.compile(r'[-]') # U+FF01 - U+FF5E
def NormalizeString(string):
"""Normalize full width ascii characters to half width characters."""
- offset = ord(u'') - ord(u'A')
- return _FULLWIDTH_RE.sub(lambda x: unichr(ord(x.group(0)) - offset),
- unicode(string, 'utf-8')).encode('utf-8')
+ offset = ord('') - ord('A')
+ return _FULLWIDTH_RE.sub(lambda x: chr(ord(x.group(0)) - offset),
+ string.decode('utf-8')).encode('utf-8')
def ReadEmojiTsv(stream):
@@ -96,14 +96,14 @@
token_dict = defaultdict(list)
stream = code_generator_util.SkipLineComment(stream)
- for columns in code_generator_util.ParseColumnStream(stream, delimiter='\t'):
+ for columns in code_generator_util.ParseColumnStream(stream, delimiter=b'\t'):
if len(columns) != 13:
- logging.critical('format error: %s', '\t'.join(columns))
+ logging.critical('format error: %s', b'\t'.join(columns))
sys.exit(1)
- code_points = columns[0].split(' ')
+ code_points = columns[0].split(b' ')
# Emoji code point.
- emoji = columns[1] if columns[1] else ''
+ emoji = columns[1] if columns[1] else b''
android_pua = ParseCodePoint(columns[2])
docomo_pua = ParseCodePoint(columns[3])
softbank_pua = ParseCodePoint(columns[4])
@@ -112,10 +112,10 @@
readings = columns[6]
# [7]: Name defined in Unicode. It is ignored in current implementation.
- utf8_description = columns[8] if columns[8] else ''
- docomo_description = columns[9] if columns[9] else ''
- softbank_description = columns[10] if columns[10] else ''
- kddi_description = columns[11] if columns[11] else ''
+ utf8_description = columns[8] if columns[8] else b''
+ docomo_description = columns[9] if columns[9] else b''
+ softbank_description = columns[10] if columns[10] else b''
+ kddi_description = columns[11] if columns[11] else b''
if not android_pua or len(code_points) > 1:
# Skip some emoji, which is not supported on old devices.
@@ -123,7 +123,7 @@
# - Composite emoji which has multiple code point.
# NOTE: Some Unicode 6.0 emoji don't have PUA, and it is also omitted.
# TODO(hsumita): Check the availability of such emoji and enable it.
- logging.info('Skip %s', ' '.join(code_points))
+ logging.info('Skip %s', b' '.join(code_points))
continue
# Check consistency between carrier PUA codes and descriptions for Android
@@ -132,7 +132,7 @@
(bool(softbank_pua) != bool(softbank_description)) or
(bool(kddi_pua) != bool(kddi_description))):
logging.warning('carrier PUA and description conflict: %s',
- '\t'.join(columns))
+ b'\t'.join(columns))
continue
# Check if the character is usable on Android.
@@ -140,7 +140,7 @@
android_pua = 0 # Replace None with 0.
if not emoji and not android_pua:
- logging.info('Skip: %s', '\t'.join(columns))
+ logging.info('Skip: %s', b'\t'.join(columns))
continue
index = len(emoji_data_list)
@@ -149,7 +149,7 @@
kddi_description))
# \xe3\x80\x80 is a full-width space
- for reading in re.split(r'(?: |\xe3\x80\x80)+', readings.strip()):
+ for reading in re.split(br'(?: |\xe3\x80\x80)+', readings.strip()):
if reading:
token_dict[NormalizeString(reading)].append(index)
@@ -159,7 +159,7 @@
def OutputData(emoji_data_list, token_dict,
token_array_file, string_array_file):
"""Output token and string arrays to files."""
- sorted_token_dict = sorted(token_dict.iteritems())
+ sorted_token_dict = sorted(token_dict.items())
strings = {}
for reading, _ in sorted_token_dict:
@@ -171,7 +171,7 @@
strings[docomo_description] = 0
strings[softbank_description] = 0
strings[kddi_description] = 0
- sorted_strings = sorted(strings.iterkeys())
+ sorted_strings = sorted(strings.keys())
for index, s in enumerate(sorted_strings):
strings[s] = index
@@ -205,7 +205,7 @@
def main():
options = ParseOptions()
- with open(options.input, 'r') as input_stream:
+ with open(options.input, 'rb') as input_stream:
(emoji_data_list, token_dict) = ReadEmojiTsv(input_stream)
OutputData(emoji_data_list, token_dict,
--- /src/rewriter/gen_reading_correction_data.py
+++ /src/rewriter/gen_reading_correction_data.py
@@ -63,7 +63,7 @@
def WriteData(input_path, output_value_array_path, output_error_array_path,
output_correction_array_path):
outputs = []
- with open(input_path) as input_stream:
+ with open(input_path, 'rb') as input_stream:
input_stream = code_generator_util.SkipLineComment(input_stream)
input_stream = code_generator_util.ParseColumnStream(input_stream,
num_column=3)
@@ -73,7 +73,7 @@
# In order to lookup the entries via |error| with binary search,
# sort outputs here.
- outputs.sort(lambda x, y: cmp(x[1], y[1]) or cmp(x[0], y[0]))
+ outputs.sort(key=lambda x: (x[1], x[0]))
serialized_string_array_builder.SerializeToFile(
[value for (value, _, _) in outputs], output_value_array_path)
--- /src/rewriter/gen_single_kanji_rewriter_data.py
+++ /src/rewriter/gen_single_kanji_rewriter_data.py
@@ -52,7 +52,7 @@
stream = code_generator_util.ParseColumnStream(stream, num_column=2)
outputs = list(stream)
# For binary search by |key|, sort outputs here.
- outputs.sort(lambda x, y: cmp(x[0], y[0]))
+ outputs.sort(key=lambda x: x[0])
return outputs
@@ -72,7 +72,7 @@
variant_items.append([target, original, len(variant_types) - 1])
# For binary search by |target|, sort variant items here.
- variant_items.sort(lambda x, y: cmp(x[0], y[0]))
+ variant_items.sort(key=lambda x: x[0])
return (variant_types, variant_items)
@@ -151,10 +151,10 @@
def main():
options = _ParseOptions()
- with open(options.single_kanji_file, 'r') as single_kanji_stream:
+ with open(options.single_kanji_file, 'rb') as single_kanji_stream:
single_kanji = ReadSingleKanji(single_kanji_stream)
- with open(options.variant_file, 'r') as variant_stream:
+ with open(options.variant_file, 'rb') as variant_stream:
variant_info = ReadVariant(variant_stream)
WriteSingleKanji(single_kanji,
--- /src/session/gen_session_stress_test_data.py
+++ /src/session/gen_session_stress_test_data.py
@@ -50,24 +50,26 @@
"""
result = ''
for c in s:
- hexstr = hex(ord(c))
+ hexstr = hex(c)
# because hexstr contains '0x', remove the prefix and add our prefix
result += '\\x' + hexstr[2:]
return result
def GenerateHeader(file):
try:
- print "const char *kTestSentences[] = {"
- for line in open(file, "r"):
- if line.startswith('#'):
+ print("const char *kTestSentences[] = {")
+ fh = open(file, "rb")
+ for line in fh:
+ if line.startswith(b'#'):
continue
- line = line.rstrip('\r\n')
+ line = line.rstrip(b'\r\n')
if not line:
continue
- print " \"%s\"," % escape_string(line)
- print "};"
+ print(" \"%s\"," % escape_string(line))
+ fh.close()
+ print("};")
except:
- print "cannot open %s" % (file)
+ print("cannot open %s" % (file))
sys.exit(1)
def main():
--- /src/unix/ibus/gen_mozc_xml.py
+++ /src/unix/ibus/gen_mozc_xml.py
@@ -74,7 +74,7 @@
def OutputXmlElement(param_dict, element_name, value):
- print ' <%s>%s</%s>' % (element_name, (value % param_dict), element_name)
+ print(' <%s>%s</%s>' % (element_name, (value % param_dict), element_name))
def OutputXml(param_dict, component, engine_common, engines, setup_arg):
@@ -90,26 +90,26 @@
engines: A dictionary from a property name to a list of property values of
engines. For example, {'name': ['mozc-jp', 'mozc', 'mozc-dv']}.
"""
- print '<component>'
- for key in component:
+ print('<component>')
+ for key in sorted(component):
OutputXmlElement(param_dict, key, component[key])
- print '<engines>'
+ print('<engines>')
for i in range(len(engines['name'])):
- print '<engine>'
- for key in engine_common:
+ print('<engine>')
+ for key in sorted(engine_common):
OutputXmlElement(param_dict, key, engine_common[key])
if setup_arg:
OutputXmlElement(param_dict, 'setup', ' '.join(setup_arg))
- for key in engines:
+ for key in sorted(engines):
OutputXmlElement(param_dict, key, engines[key][i])
- print '</engine>'
- print '</engines>'
- print '</component>'
+ print('</engine>')
+ print('</engines>')
+ print('</component>')
def OutputCppVariable(param_dict, prefix, variable_name, value):
- print 'const char k%s%s[] = "%s";' % (prefix, variable_name.capitalize(),
- (value % param_dict))
+ print('const char k%s%s[] = "%s";' % (prefix, variable_name.capitalize(),
+ (value % param_dict)))
def OutputCpp(param_dict, component, engine_common, engines):
@@ -122,18 +122,18 @@
engines: ditto.
"""
guard_name = 'MOZC_UNIX_IBUS_MAIN_H_'
- print CPP_HEADER % (guard_name, guard_name)
- for key in component:
+ print(CPP_HEADER % (guard_name, guard_name))
+ for key in sorted(component):
OutputCppVariable(param_dict, 'Component', key, component[key])
- for key in engine_common:
+ for key in sorted(engine_common):
OutputCppVariable(param_dict, 'Engine', key, engine_common[key])
- for key in engines:
- print 'const char* kEngine%sArray[] = {' % key.capitalize()
+ for key in sorted(engines):
+ print('const char* kEngine%sArray[] = {' % key.capitalize())
for i in range(len(engines[key])):
- print '"%s",' % (engines[key][i] % param_dict)
- print '};'
- print 'const size_t kEngineArrayLen = %s;' % len(engines['name'])
- print CPP_FOOTER % guard_name
+ print('"%s",' % (engines[key][i] % param_dict))
+ print('};')
+ print('const size_t kEngineArrayLen = %s;' % len(engines['name']))
+ print(CPP_FOOTER % guard_name)
def CheckIBusVersion(options, minimum_version):
--- /src/usage_stats/gen_stats_list.py
+++ /src/usage_stats/gen_stats_list.py
@@ -37,23 +37,24 @@
def GetStatsNameList(filename):
stats = []
- for line in open(filename, 'r'):
- stat = line.strip()
- if not stat or stat[0] == '#':
- continue
- stats.append(stat)
+ with open(filename, 'r') as file:
+ for line in file:
+ stat = line.strip()
+ if not stat or stat[0] == '#':
+ continue
+ stats.append(stat)
return stats
def main():
stats_list = GetStatsNameList(sys.argv[1])
- print '// This header file is generated by gen_stats_list.py'
+ print('// This header file is generated by gen_stats_list.py')
for stats in stats_list:
- print 'const char k%s[] = "%s";' % (stats, stats)
- print 'const char *kStatsList[] = {'
+ print('const char k%s[] = "%s";' % (stats, stats))
+ print('const char *kStatsList[] = {')
for stats in stats_list:
- print ' k%s,' % (stats)
- print '};'
+ print(' k%s,' % (stats))
+ print('};')
if __name__ == '__main__':

@ -1,35 +0,0 @@
https://github.com/google/mozc/issues/461
--- /src/data/symbol/categorized.tsv
+++ /src/data/symbol/categorized.tsv
@@ -405,6 +405,7 @@
㍽ MATH たいしょう ねんごう
㍼ MATH しょうわ ねんごう
㍻ MATH へいせい ねんごう
+㋿ MATH れいわ ねんごう
㌣ MATH せんと たんい
㌦ MATH どる たんい
--- /src/data/symbol/symbol.tsv
+++ /src/data/symbol/symbol.tsv
@@ -528,6 +528,7 @@
記号 ㊦ した げ 丸下
記号 ㊧ ひだり 丸左
記号 ㊨ みぎ 丸右
+記号 ㋿ れいわ ねんごう 年号 OTHER
記号 ㍻ へいせい ねんごう 年号 OTHER
記号 ㍼ しょうわ ねんごう 年号 OTHER
記号 ㍽ たいしょう ねんごう 年号 OTHER
--- /src/rewriter/date_rewriter.cc
+++ /src/rewriter/date_rewriter.cc
@@ -1239,6 +1239,10 @@
1989,
"平成",
"へいせい",
+ }, {
+ 2019,
+ "令和",
+ "れいわ",
}
};

@ -1,95 +0,0 @@
https://github.com/google/mozc/issues/471
--- /src/ipc/ipc_path_manager.cc
+++ /src/ipc/ipc_path_manager.cc
@@ -332,9 +332,21 @@
return false;
}
+ // Expand symbolic links in the expected server path to avoid false negatives
+ // during comparisons of the expected server path and the actual server path.
+ string real_server_path = server_path;
+#ifndef OS_WIN
+ char real_server_path_[PATH_MAX];
+ if (realpath(server_path.c_str(), real_server_path_) == NULL) {
+ LOG(ERROR) << "realpath failed: " << strerror(errno);
+ return false;
+ }
+ real_server_path = real_server_path_;
+#endif
+
// compare path name
if (pid == server_pid_) {
- return (server_path == server_path_);
+ return (real_server_path == server_path_);
}
server_pid_ = 0;
@@ -344,17 +356,17 @@
{
std::wstring expected_server_ntpath;
const std::map<string, std::wstring>::const_iterator it =
- expected_server_ntpath_cache_.find(server_path);
+ expected_server_ntpath_cache_.find(real_server_path);
if (it != expected_server_ntpath_cache_.end()) {
expected_server_ntpath = it->second;
} else {
std::wstring wide_server_path;
- Util::UTF8ToWide(server_path, &wide_server_path);
+ Util::UTF8ToWide(real_server_path, &wide_server_path);
if (WinUtil::GetNtPath(wide_server_path, &expected_server_ntpath)) {
- // Caches the relationship from |server_path| to
- // |expected_server_ntpath| in case |server_path| is renamed later.
+ // Caches the relationship from |real_server_path| to
+ // |expected_server_ntpath| in case |real_server_path| is renamed later.
// (This can happen during the updating).
- expected_server_ntpath_cache_[server_path] = expected_server_ntpath;
+ expected_server_ntpath_cache_[real_server_path] = expected_server_ntpath;
}
}
@@ -371,9 +383,9 @@
return false;
}
- // Here we can safely assume that |server_path| (expected one) should be
+ // Here we can safely assume that |real_server_path| (expected one) should be
// the same to |server_path_| (actual one).
- server_path_ = server_path;
+ server_path_ = real_server_path;
server_pid_ = pid;
}
#endif // OS_WIN
@@ -399,7 +411,7 @@
#ifdef OS_LINUX
// load from /proc/<pid>/exe
char proc[128];
- char filename[512];
+ char filename[PATH_MAX];
snprintf(proc, sizeof(proc) - 1, "/proc/%u/exe", pid);
const ssize_t size = readlink(proc, filename, sizeof(filename) - 1);
if (size == -1) {
@@ -412,18 +424,18 @@
server_pid_ = pid;
#endif // OS_LINUX
- VLOG(1) << "server path: " << server_path << " " << server_path_;
- if (server_path == server_path_) {
+ VLOG(1) << "server path: " << real_server_path << " " << server_path_;
+ if (real_server_path == server_path_) {
return true;
}
#ifdef OS_LINUX
- if ((server_path + " (deleted)") == server_path_) {
- LOG(WARNING) << server_path << " on disk is modified";
+ if ((real_server_path + " (deleted)") == server_path_) {
+ LOG(WARNING) << real_server_path << " on disk is modified";
// If a user updates the server binary on disk during the server is running,
// "readlink /proc/<pid>/exe" returns a path with the " (deleted)" suffix.
// We allow the special case.
- server_path_ = server_path;
+ server_path_ = real_server_path;
return true;
}
#endif // OS_LINUX

@ -1,274 +0,0 @@
--- /src/gyp/defines.gypi
+++ /src/gyp/defines.gypi
@@ -71,6 +71,12 @@
# use_libibus represents if ibus library is used or not.
# This option is only for Linux.
'use_libibus%': '0',
+
+ # use_libgtest represents if gtest library is used or not.
+ 'use_libgtest%': '0',
+
+ # use_libjsoncpp represents if jsoncpp library is used or not.
+ 'use_libjsoncpp%': '0',
},
'target_defaults': {
'defines': [
--- /src/net/jsoncpp.gyp
+++ /src/net/jsoncpp.gyp
@@ -31,32 +31,57 @@
'targets': [
{
'target_name': 'jsoncpp',
- 'type': 'static_library',
- 'variables': {
- 'jsoncpp_root': '<(third_party_dir)/jsoncpp',
- 'jsoncpp_srcs': [
- '<(jsoncpp_root)/src/lib_json/json_reader.cpp',
- '<(jsoncpp_root)/src/lib_json/json_value.cpp',
- '<(jsoncpp_root)/src/lib_json/json_writer.cpp',
- ],
- 'jsoncpp_include_dirs': ['<(jsoncpp_root)/include'],
- 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
- },
- 'defines': [
- '<@(jsoncpp_additional_macros)',
+ 'conditions': [
+ ['use_libjsoncpp==1', {
+ 'type': 'none',
+ 'variables': {
+ 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
+ },
+ 'all_dependent_settings': {
+ 'defines': [
+ '<@(jsoncpp_additional_macros)',
+ ],
+ 'cflags': [
+ '<!@(pkg-config --cflags jsoncpp)',
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '<!@(pkg-config --libs-only-l jsoncpp)',
+ ],
+ 'ldflags': [
+ '<!@(pkg-config --libs-only-L jsoncpp)',
+ ],
+ }
+ },
+ }, {
+ 'type': 'static_library',
+ 'variables': {
+ 'jsoncpp_root': '<(third_party_dir)/jsoncpp',
+ 'jsoncpp_srcs': [
+ '<(jsoncpp_root)/src/lib_json/json_reader.cpp',
+ '<(jsoncpp_root)/src/lib_json/json_value.cpp',
+ '<(jsoncpp_root)/src/lib_json/json_writer.cpp',
+ ],
+ 'jsoncpp_include_dirs': ['<(jsoncpp_root)/include'],
+ 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
+ },
+ 'defines': [
+ '<@(jsoncpp_additional_macros)',
+ ],
+ 'sources': [
+ '<@(jsoncpp_srcs)',
+ 'jsoncpp.h',
+ ],
+ 'include_dirs': [
+ '<@(jsoncpp_include_dirs)',
+ ],
+ 'all_dependent_settings': {
+ 'defines': [
+ '<@(jsoncpp_additional_macros)',
+ ],
+ },
+ }],
],
- 'sources': [
- '<@(jsoncpp_srcs)',
- 'jsoncpp.h',
- ],
- 'include_dirs': [
- '<@(jsoncpp_include_dirs)',
- ],
- 'all_dependent_settings': {
- 'defines': [
- '<@(jsoncpp_additional_macros)',
- ],
- },
},
],
}
--- /src/net/jsoncpp.h
+++ /src/net/jsoncpp.h
@@ -35,7 +35,7 @@
// Mozc basically disables C++ exception.
#define JSON_USE_EXCEPTION 0
#endif // !JSON_USE_EXCEPTION
-#include "third_party/jsoncpp/include/json/json.h"
+#include <json/json.h>
#define MOZC_JSONCPP_JSON_H_INCLUDED
#endif // !MOZC_JSONCPP_JSON_H_INCLUDED
--- /src/testing/testing.gyp
+++ /src/testing/testing.gyp
@@ -53,66 +53,101 @@
'targets': [
{
'target_name': 'testing',
- 'type': 'static_library',
- 'variables': {
- 'gtest_defines': [
- 'GTEST_LANG_CXX11=1',
- 'GTEST_HAS_TR1_TUPLE=0', # disable tr1 tuple in favor of C++11 tuple.
- ],
- 'gtest_dir': '<(third_party_dir)/gtest/googletest',
- 'gmock_dir': '<(third_party_dir)/gtest/googlemock',
- 'conditions': [
- ['_toolset=="target" and target_platform=="Android"', {
- 'gtest_defines': [
- 'GTEST_HAS_RTTI=0', # Android NDKr7 requires this.
- 'GTEST_HAS_CLONE=0',
- 'GTEST_HAS_GLOBAL_WSTRING=0',
- 'GTEST_HAS_POSIX_RE=0',
- 'GTEST_HAS_STD_WSTRING=0',
- 'GTEST_OS_LINUX=1',
- 'GTEST_OS_LINUX_ANDROID=1',
- ],
- }],
- ],
- },
- 'sources': [
- '<(gmock_dir)/src/gmock-cardinalities.cc',
- '<(gmock_dir)/src/gmock-internal-utils.cc',
- '<(gmock_dir)/src/gmock-matchers.cc',
- '<(gmock_dir)/src/gmock-spec-builders.cc',
- '<(gmock_dir)/src/gmock.cc',
- '<(gtest_dir)/src/gtest-death-test.cc',
- '<(gtest_dir)/src/gtest-filepath.cc',
- '<(gtest_dir)/src/gtest-port.cc',
- '<(gtest_dir)/src/gtest-printers.cc',
- '<(gtest_dir)/src/gtest-test-part.cc',
- '<(gtest_dir)/src/gtest-typed-test.cc',
- '<(gtest_dir)/src/gtest.cc',
- ],
- 'include_dirs': [
- '<(gmock_dir)',
- '<(gmock_dir)/include',
- '<(gtest_dir)',
- '<(gtest_dir)/include',
- ],
- 'defines': [
- '<@(gtest_defines)',
- ],
- 'all_dependent_settings': {
- 'defines': [
- '<@(gtest_defines)',
- ],
- 'include_dirs': [
- '<(gmock_dir)/include',
- '<(gtest_dir)/include',
- ],
- },
'conditions': [
- ['(_toolset=="target" and compiler_target=="clang") or '
- '(_toolset=="host" and compiler_host=="clang")', {
- 'cflags': [
- '-Wno-missing-field-initializers',
- '-Wno-unused-private-field',
+ ['use_libgtest==1', {
+ 'type': 'none',
+ 'variables': {
+ 'gtest_defines': [
+ 'GTEST_LANG_CXX11=1',
+ 'GTEST_HAS_TR1_TUPLE=0', # disable tr1 tuple in favor of C++11 tuple.
+ ],
+ 'conditions': [
+ ['_toolset=="target" and target_platform=="Android"', {
+ 'gtest_defines': [
+ 'GTEST_HAS_RTTI=0', # Android NDKr7 requires this.
+ 'GTEST_HAS_CLONE=0',
+ 'GTEST_HAS_GLOBAL_WSTRING=0',
+ 'GTEST_HAS_POSIX_RE=0',
+ 'GTEST_HAS_STD_WSTRING=0',
+ 'GTEST_OS_LINUX=1',
+ 'GTEST_OS_LINUX_ANDROID=1',
+ ],
+ }],
+ ],
+ },
+ 'all_dependent_settings': {
+ 'defines': [
+ '<@(gtest_defines)',
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '-lgmock -lgtest',
+ ],
+ },
+ },
+ }, {
+ 'type': 'static_library',
+ 'variables': {
+ 'gtest_defines': [
+ 'GTEST_LANG_CXX11=1',
+ 'GTEST_HAS_TR1_TUPLE=0', # disable tr1 tuple in favor of C++11 tuple.
+ ],
+ 'gtest_dir': '<(third_party_dir)/gtest/googletest',
+ 'gmock_dir': '<(third_party_dir)/gtest/googlemock',
+ 'conditions': [
+ ['_toolset=="target" and target_platform=="Android"', {
+ 'gtest_defines': [
+ 'GTEST_HAS_RTTI=0', # Android NDKr7 requires this.
+ 'GTEST_HAS_CLONE=0',
+ 'GTEST_HAS_GLOBAL_WSTRING=0',
+ 'GTEST_HAS_POSIX_RE=0',
+ 'GTEST_HAS_STD_WSTRING=0',
+ 'GTEST_OS_LINUX=1',
+ 'GTEST_OS_LINUX_ANDROID=1',
+ ],
+ }],
+ ],
+ },
+ 'sources': [
+ '<(gmock_dir)/src/gmock-cardinalities.cc',
+ '<(gmock_dir)/src/gmock-internal-utils.cc',
+ '<(gmock_dir)/src/gmock-matchers.cc',
+ '<(gmock_dir)/src/gmock-spec-builders.cc',
+ '<(gmock_dir)/src/gmock.cc',
+ '<(gtest_dir)/src/gtest-death-test.cc',
+ '<(gtest_dir)/src/gtest-filepath.cc',
+ '<(gtest_dir)/src/gtest-port.cc',
+ '<(gtest_dir)/src/gtest-printers.cc',
+ '<(gtest_dir)/src/gtest-test-part.cc',
+ '<(gtest_dir)/src/gtest-typed-test.cc',
+ '<(gtest_dir)/src/gtest.cc',
+ ],
+ 'include_dirs': [
+ '<(gmock_dir)',
+ '<(gmock_dir)/include',
+ '<(gtest_dir)',
+ '<(gtest_dir)/include',
+ ],
+ 'defines': [
+ '<@(gtest_defines)',
+ ],
+ 'all_dependent_settings': {
+ 'defines': [
+ '<@(gtest_defines)',
+ ],
+ 'include_dirs': [
+ '<(gmock_dir)/include',
+ '<(gtest_dir)/include',
+ ],
+ },
+ 'conditions': [
+ ['(_toolset=="target" and compiler_target=="clang") or '
+ '(_toolset=="host" and compiler_host=="clang")', {
+ 'cflags': [
+ '-Wno-missing-field-initializers',
+ '-Wno-unused-private-field',
+ ],
+ }],
],
}],
],

@ -1,40 +0,0 @@
https://github.com/BYVoid/OpenCC/issues/322
--- /data/CMakeLists.txt
+++ /data/CMakeLists.txt
@@ -116,6 +116,19 @@
)
endforeach(DICT)
+add_custom_target(
+ copy_libopencc_to_dir_of_opencc_dict
+ COMMENT
+ "Copying libopencc to directory of opencc_dict"
+ COMMAND
+ ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:libopencc>" "$<TARGET_FILE_DIR:${OPENCC_DICT_BIN}>"
+)
+if (WIN32)
+ set(DICT_WIN32_DEPENDS copy_libopencc_to_dir_of_opencc_dict)
+else()
+ set(DICT_WIN32_DEPENDS)
+endif()
+
foreach(DICT ${DICTS})
add_custom_command(
OUTPUT
@@ -123,14 +136,13 @@
COMMENT
"Building ${DICT}.ocd2"
COMMAND
- ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:libopencc>" "$<TARGET_FILE_DIR:${OPENCC_DICT_BIN}>"
- COMMAND
${OPENCC_DICT_BIN}
--input ${DICT_${DICT}_INPUT}
--output ${DICT}.ocd2
--from text
--to ocd2
DEPENDS
+ ${DICT_WIN32_DEPENDS}
${OPENCC_DICT_BIN}
${DICT_${DICT}_INPUT}
)

@ -1,94 +0,0 @@
https://github.com/BYVoid/OpenCC/issues/547
--- /CMakeLists.txt
+++ /CMakeLists.txt
@@ -28,7 +28,12 @@
option(ENABLE_GTEST "Build all tests." OFF)
option(ENABLE_BENCHMARK "Build benchmark tests." OFF)
option(ENABLE_DARTS "Build DartsDict (ocd format)." ON)
-option(BUILD_BUNDLED_LIBMARISA "" ON)
+option(USE_SYSTEM_DARTS "Use system version of Darts" OFF)
+option(USE_SYSTEM_GOOGLE_BENCHMARK "Use system version of Google Benchmark" OFF)
+option(USE_SYSTEM_GTEST "Use system version of GoogleTest" OFF)
+option(USE_SYSTEM_MARISA "Use system version of Marisa" OFF)
+option(USE_SYSTEM_RAPIDJSON "Use system version of RapidJSON" OFF)
+option(USE_SYSTEM_TCLAP "Use system version of TCLAP" OFF)
######## Package information
set (PACKAGE_URL https://github.com/BYVoid/Opencc)
@@ -172,7 +177,7 @@
######## Dependencies
-if(BUILD_BUNDLED_LIBMARISA)
+if(NOT USE_SYSTEM_MARISA)
message(STATUS "Use bundled marisa library.")
add_subdirectory(deps/marisa-0.2.5)
else()
@@ -194,12 +199,16 @@
######## Testing
if (ENABLE_GTEST)
- add_subdirectory(deps/gtest-1.11.0)
+ if(NOT USE_SYSTEM_GTEST)
+ add_subdirectory(deps/gtest-1.11.0)
+ endif()
enable_testing()
endif()
if (ENABLE_BENCHMARK)
set(BENCHMARK_ENABLE_TESTING OFF)
- add_subdirectory(deps/google-benchmark)
+ if(NOT USE_SYSTEM_GOOGLE_BENCHMARK)
+ add_subdirectory(deps/google-benchmark)
+ endif()
enable_testing()
endif()
--- /src/CMakeLists.txt
+++ /src/CMakeLists.txt
@@ -1,7 +1,13 @@
include (GenerateExportHeader)
-include_directories(../deps/marisa-0.2.5/include)
-include_directories(../deps/rapidjson-1.1.0)
-include_directories(../deps/tclap-1.2.2)
+if(NOT USE_SYSTEM_MARISA)
+ include_directories(../deps/marisa-0.2.5/include)
+endif()
+if(NOT USE_SYSTEM_RAPIDJSON)
+ include_directories(../deps/rapidjson-1.1.0)
+endif()
+if(NOT USE_SYSTEM_TCLAP)
+ include_directories(../deps/tclap-1.2.2)
+endif()
# Library
@@ -72,7 +78,9 @@
)
if (ENABLE_DARTS)
- include_directories(../deps/darts-clone)
+ if(NOT USE_SYSTEM_DARTS)
+ include_directories(../deps/darts-clone)
+ endif()
set(
LIBOPENCC_HEADERS
${LIBOPENCC_HEADERS}
--- /test/CMakeLists.txt
+++ /test/CMakeLists.txt
@@ -1,4 +1,3 @@
-include_directories(../deps/libdarts/src)
include_directories(../src)
set(CONFIG_TEST
@@ -27,7 +26,9 @@
)
endif()
- include_directories(../deps/gtest-1.7.0/include)
+ if(NOT USE_SYSTEM_GTEST)
+ include_directories(../deps/gtest-1.7.0/include)
+ endif()
set(UNITTESTS
CommandLineConvertTest
)

@ -10,7 +10,7 @@ SRC_URI="https://unicode.org/Public/zipped/${PV}/UCD.zip -> ${P}-UCD.zip
LICENSE="unicode"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86"
DEPEND="app-arch/unzip"
S="${WORKDIR}"

Binary file not shown.

@ -476,8 +476,8 @@ DIST honnef.co%2Fgo%2Ftools%2F@v%2Fv0.0.0-20190523083050-ea95bdfd59fc.mod 26 BLA
DIST honnef.co%2Fgo%2Ftools%2F@v%2Fv0.0.1-2019.2.3.mod 300 BLAKE2B 3e3f5a2be0918cbaacd5e43e59fcc6c7c6999645f0c9214cd5a522c31d34b6d3dad61e3ddae8ccdb2f3f0d90b406c047802ee3d9d54dc40fe6eff9cd35620792 SHA512 0c8aa788d0c03d6d049f0dd7468d0f81ce2131ccedd5a5a3a18362b7d30eef7ef325277844eefe4b707b1ad71c6f83a44e110b7af7b98e05406d347237a7bafb
DIST honnef.co%2Fgo%2Ftools%2F@v%2Fv0.0.1-2020.1.3.mod 300 BLAKE2B 3aa707c72ce7e402cc1765fed30253eb87e9e87aecc8096130e973623f53ded2a7572ca3d464e4db9de524cd651b3aa8fbc9fa0ef6bdc4eb9670b4d8652f4dfc SHA512 d814675e448688f6a506397bedb262fb2583c913ec1f8ca9ffc11206bdcd7e1f4ee3c561aee366eb2cdaede8c522a6f58f116236f3033bc7e91ec139bdd140f9
DIST honnef.co%2Fgo%2Ftools%2F@v%2Fv0.0.1-2020.1.4.mod 300 BLAKE2B 3aa707c72ce7e402cc1765fed30253eb87e9e87aecc8096130e973623f53ded2a7572ca3d464e4db9de524cd651b3aa8fbc9fa0ef6bdc4eb9670b4d8652f4dfc SHA512 d814675e448688f6a506397bedb262fb2583c913ec1f8ca9ffc11206bdcd7e1f4ee3c561aee366eb2cdaede8c522a6f58f116236f3033bc7e91ec139bdd140f9
DIST redis_exporter-1.35.0.tar.gz 185150 BLAKE2B 57b39088f4f2fece0edaf59c551777e5b3f018906175c767dc81e0434d0238f44ce365d8e6c28ab5dfb56996e672c834ea2f0d7c0dd84e3efee5dcfb920ae262 SHA512 dfa9da08bb9d8f80af46901ed31b88873ef4fce5b4406a0447984ce70288dff1dbb485f83697a0bacc6db0e1234f6476a0f28b2e80dd41be1796415c33c8c08c
DIST redis_exporter-1.35.1.tar.gz 185831 BLAKE2B 7d296d6dcaa3c61be76e3eed602fdfe7fd8b68fab0bf39fc8412c2e377aa01a230d7f44a3f09ed29c9308e3794da7db8780604feef218964fbc4445fc6b1bd03 SHA512 7c0ac25d0fed6b760593bf9fd08eb259d46d0690606da587d553bcd4c168ada3c87fe63d5082468a2c1ebfc20531a2de39219e3f201402d5b06f4238d7525b69
DIST redis_exporter-1.36.0.tar.gz 185852 BLAKE2B 0caac6541d990e170d9251de154df24b6476c94e2ceefc14979bd1d500825859210b5aacd1426355d6c05522960a951b3a1b88dc363f611c1feed6b3ab5e567d SHA512 e1ef0f27e79edb8ad0ea67ce4349ffa86d274b6af751eabc66c145010359e36218f9d68b084075f45410f37cbdc653d50fc5cba374f27d8518e2e687ad421e4c
DIST rsc.io%2Fbinaryregexp%2F@v%2Fv0.2.0.mod 36 BLAKE2B 61110bed2b9e99e0250cf6e8b842257202c89b3462edf9368b73cab29f9dbd4dcc66c3e290a1d6329b7d62321eecc52082a8c4c0797eac743a29a8a00910a93f SHA512 db50ff677b0bdccbc1a1ad3df7c5cc76f2fcccf3ab99d08d1c2868440eb9b893fe89452f4286f7d42f2f16abf0f4acda67fe86e174dcfa730a743aafcc166774
DIST rsc.io%2Fquote%2Fv3%2F@v%2Fv3.1.0.mod 55 BLAKE2B f1f0ba35f0ffd200ed37c06b2025c1fd436e3fd857bd525b9295c0cbcade7e1f037e3f566124a7ef428384d50525426f0d40468c967e39bac6057174710e2566 SHA512 e6357ddd7d09692c60e59e6cb80469ade8284052cdd3ea520ec4dbcb42c1cabe045c599e43cce94bec022bd82e87a554ecac42f8c917cf2ff44daff9c1a147d5
DIST rsc.io%2Fsampler%2F@v%2Fv1.3.0.mod 88 BLAKE2B c2ac3c9619e396db470c9951dfc11cdacccd56ae09b3b353015ee7e5fbb023df288dbf48d81b44c309241d1ea89a2e0ee42ee1d17e536fcfa531aaee0e651ab7 SHA512 2137507eb25fbae419605e0cd6bca4cfa584110eebc276cd759a4dcb6f97e52928e5b2d9b276e76bcabcec3bbfc2c42f97fa29f54695d27fb00f9423e1638863

@ -3,7 +3,7 @@
EAPI=7
inherit go-module systemd
EGIT_COMMIT=8bfc4e0b741010e6a609b6b363e9bedd5f0da9c2
EGIT_COMMIT=2ae48e955a15e1456b801c349a6688d54fbc5f20
DESCRIPTION="Prometheus Exporter for Redis Metrics. Supports Redis 2.x, 3.x and 4.x"
HOMEPAGE="https://github.com/oliver006/redis_exporter"

Binary file not shown.

@ -1,2 +1 @@
DIST graphlcd-base-2.0.2.tar.bz2 522939 BLAKE2B aa4cb227872602f408bda5c80e0269945ddd985e93d5964da8cc67466edbc4bb14fc9813b7e95715b049c1b51dfe692bb2426a032df55a60d869a41d9869302b SHA512 218d914f0286b5025dc9a8a0c738bc01f5f0218a5d56fb0a3b7cdd4acdd8dfaa7465e6d6e5606f38efc0bcc80c7d1b755b139372288c1910e27c5113aea15359
DIST graphlcd-base-2.0.3.tar.bz2 523229 BLAKE2B cfdca5a6a73e8a3858d694aa997037b56471feb20541a328210a106d22c97f57e20f0798411e5a92ca616e5991ec167a8986730b985d0aefcbbb6c6454ab78c2 SHA512 dd0d6a1f1d43405d6ff2e531010f97d47081e3e8e9ccd238adc1084912c99838e80e85b8bd6b37d6462859c3c96229fd83e5ac93fb4068ffe5c30cff3787d138

@ -1,89 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit optfeature toolchain-funcs udev
DESCRIPTION="Contains the lowlevel lcd drivers for GraphLCD"
HOMEPAGE="https://projects.vdr-developer.org/projects/graphlcd-base"
SRC_URI="https://projects.vdr-developer.org/git/${PN}.git/snapshot/${P}.tar.bz2"
KEYWORDS="amd64 x86"
SLOT="0"
LICENSE="GPL-2"
IUSE="fontconfig freetype graphicsmagick imagemagick lcd_devices_ax206dpf lcd_devices_picolcd_256x64 lcd_devices_vnc"
REQUIRED_USE="?? ( graphicsmagick imagemagick )"
RDEPEND="
dev-libs/libhid
net-libs/libvncserver
freetype? ( media-libs/freetype:2= )
fontconfig? ( media-libs/fontconfig:1.0= )
graphicsmagick? ( media-gfx/graphicsmagick:0/1.3[cxx] )
imagemagick? ( <media-gfx/imagemagick-7 )
lcd_devices_ax206dpf? ( virtual/libusb:0 )
lcd_devices_picolcd_256x64? ( virtual/libusb:0 )
"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"
DOCS=( "HISTORY" "README" "TODO" "docs/." )
src_prepare() {
default
# Change '/usr/local/' to '/usr'
# Change '/usr/lib' to '/usr/$(get_libdir)'
sed -e "34s:/usr/local:/usr:" -e "37s:/lib:/$(get_libdir):" -i Make.config || die
# Fix newer GCC version with the Futaba MDM166A lcd driver
sed -e "s:0xff7f0004:(int) 0xff7f0004:" -i glcddrivers/futabaMDM166A.c || die
tc-export CC CXX
}
src_configure() {
# Build optional drivers
if use lcd_devices_ax206dpf; then
sed -e "78s:#::" -i Make.config || die
fi
if use lcd_devices_picolcd_256x64; then
sed -e "81s:#::" -i Make.config || die
fi
if ! use lcd_devices_vnc; then
sed -e "72s:1:0:" -i Make.config || die
fi
# Build optional features
if ! use freetype; then
sed -e "59s:HAVE:#HAVE:" -i Make.config || die
fi
if ! use fontconfig; then
sed -e "62s:HAVE:#HAVE:" -i Make.config || die
fi
if use graphicsmagick; then
sed -e "69s:#::" -i Make.config || die
fi
if use imagemagick; then
sed -e "68s:#::" -i Make.config || die
fi
}
src_install() {
emake DESTDIR="${D}" UDEVRULESDIR="/lib/udev/rules.d" install
einstalldocs
}
pkg_postinst() {
udev_reload
optfeature "supporting the logitech g15 keyboard lcd." app-misc/g15daemon
}
pkg_postrm() {
udev_reload
}

@ -9,7 +9,7 @@ DESCRIPTION="Contains the lowlevel lcd drivers for GraphLCD"
HOMEPAGE="https://projects.vdr-developer.org/projects/graphlcd-base"
SRC_URI="https://projects.vdr-developer.org/git/${PN}.git/snapshot/${P}.tar.bz2"
KEYWORDS="~amd64 ~x86"
KEYWORDS="amd64 x86"
SLOT="0"
LICENSE="GPL-2"
IUSE="fontconfig freetype graphicsmagick imagemagick lcd_devices_ax206dpf lcd_devices_picolcd_256x64 lcd_devices_vnc"

@ -10,7 +10,7 @@ if [[ ${PV} == *9999* ]]; then
inherit git-r3
else
SRC_URI="https://github.com/thewtex/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm64 ~x86"
KEYWORDS="amd64 ~arm64 x86"
fi
DESCRIPTION="CPU, RAM memory, and load monitor for use with tmux"

Binary file not shown.

@ -120,6 +120,7 @@ PATCHES=(
"${FILESDIR}"/${P}-{openexr-3,imath-{1,2}}.patch
"${FILESDIR}"/${P}-cxx17-for-poppler-22.patch
"${FILESDIR}"/${P}-cxx17-fixes.patch
"${FILESDIR}"/${P}-poppler-22.03.0.patch # by Archlinux, TODO upstream
)
pkg_pretend() {

@ -0,0 +1,51 @@
From 8f328bef497a9e3bc628e4e294c1a70b0c8b0eab Mon Sep 17 00:00:00 2001
From: foutrelis <foutrelis@eb2447ed-0c53-47e4-bac8-5bc4a241df78>
Date: Wed, 2 Mar 2022 10:28:24 +0000
Subject: [PATCH] Fix build with poppler 22.03.0
diff -uprw a/filters/karbon/pdf/CMakeLists.txt b/filters/karbon/pdf/CMakeLists.txt
--- a/filters/karbon/pdf/CMakeLists.txt 2020-05-14 09:51:30.000000000 +0300
+++ b/filters/karbon/pdf/CMakeLists.txt 2022-03-02 12:19:08.039939530 +0200
@@ -14,6 +14,10 @@ if(Poppler_VERSION VERSION_LESS "0.83.0"
add_definitions("-DHAVE_POPPLER_PRE_0_83")
endif()
+if(Poppler_VERSION VERSION_LESS "22.3.0")
+ add_definitions("-DHAVE_POPPLER_PRE_22_3")
+endif()
+
set(pdf2svg_PART_SRCS PdfImportDebug.cpp PdfImport.cpp SvgOutputDev.cpp )
add_library(calligra_filter_pdf2svg MODULE ${pdf2svg_PART_SRCS})
diff -uprw a/filters/karbon/pdf/Pdf2OdgImport.cpp b/filters/karbon/pdf/Pdf2OdgImport.cpp
--- a/filters/karbon/pdf/Pdf2OdgImport.cpp 2020-05-14 09:51:30.000000000 +0300
+++ b/filters/karbon/pdf/Pdf2OdgImport.cpp 2022-03-02 12:20:35.125605950 +0200
@@ -86,8 +86,12 @@ KoFilter::ConversionStatus Pdf2OdgImport
if (! globalParams)
return KoFilter::NotImplemented;
+#ifdef HAVE_POPPLER_PRE_22_3
GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
+#else
+ PDFDoc * pdfDoc = new PDFDoc(std::make_unique<GooString>(QFile::encodeName(m_chain->inputFile()).data()));
+#endif
if (! pdfDoc) {
#ifdef HAVE_POPPLER_PRE_0_83
delete globalParams;
diff -uprw a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
--- a/filters/karbon/pdf/PdfImport.cpp 2020-05-14 09:51:30.000000000 +0300
+++ b/filters/karbon/pdf/PdfImport.cpp 2022-03-02 12:21:46.197510028 +0200
@@ -73,8 +73,12 @@ KoFilter::ConversionStatus PdfImport::co
if (! globalParams)
return KoFilter::NotImplemented;
+#ifdef HAVE_POPPLER_PRE_22_3
GooString * fname = new GooString(QFile::encodeName(m_chain->inputFile()).data());
PDFDoc * pdfDoc = new PDFDoc(fname, 0, 0, 0);
+#else
+ PDFDoc * pdfDoc = new PDFDoc(std::make_unique<GooString>(QFile::encodeName(m_chain->inputFile()).data()));
+#endif
if (! pdfDoc) {
#ifdef HAVE_POPPLER_PRE_0_83
delete globalParams;

@ -0,0 +1,33 @@
From 001ec0e10616a3a55fa7898bb68c983e94b7ce66 Mon Sep 17 00:00:00 2001
From: foutrelis <foutrelis@eb2447ed-0c53-47e4-bac8-5bc4a241df78>
Date: Wed, 2 Mar 2022 12:58:09 +0000
Subject: [PATCH] upgpkg: libreoffice-fresh 7.3.0-7: poppler 22.03.0 rebuild
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index ad6320139..e5f6d9c68 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -138,6 +138,15 @@ int main(int argc, char **argv)
_setmode( _fileno( g_binary_out ), _O_BINARY );
#endif
+#if POPPLER_CHECK_VERSION(22, 3, 0)
+ PDFDoc aDoc( std::make_unique<GooString>(pFileName),
+ GooString(pOwnerPasswordStr),
+ GooString(pUserPasswordStr) );
+
+ PDFDoc aErrDoc( std::make_unique<GooString>(pErrFileName),
+ GooString(pOwnerPasswordStr),
+ GooString(pUserPasswordStr) );
+#else
PDFDoc aDoc( pFileName,
pOwnerPasswordStr,
pUserPasswordStr );
@@ -145,6 +154,7 @@ int main(int argc, char **argv)
PDFDoc aErrDoc( pErrFileName,
pOwnerPasswordStr,
pUserPasswordStr );
+#endif
// Check various permissions for aDoc.
PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc;

@ -294,6 +294,9 @@ PATCHES=(
"${FILESDIR}/${PN}-6.1-nomancompress.patch"
"${FILESDIR}/${PN}-7.2.0.4-qt5detect.patch"
# TODO upstream
"${FILESDIR}/${P}-poppler-22.03.0.patch" # by Archlinux
# 7.3 branch
"${FILESDIR}/${PN}-7.2.2.2-makefile-gengal.patch"
)

@ -297,6 +297,9 @@ PATCHES=(
"${FILESDIR}/${PN}-5.3.4.2-kioclient5.patch"
"${FILESDIR}/${PN}-6.1-nomancompress.patch"
"${FILESDIR}/${PN}-7.2.0.4-qt5detect.patch"
# TODO upstream
"${FILESDIR}/${PN}-7.2.6.2-poppler-22.03.0.patch" # by Archlinux
)
S="${WORKDIR}/${PN}-${MY_PV}"

@ -0,0 +1,52 @@
From f19410ac3b27e33dd62105746784e61e85b90a1d Mon Sep 17 00:00:00 2001
From: Jean Ghali <jghali@libertysurf.fr>
Date: Wed, 2 Mar 2022 22:22:53 +0000
Subject: [PATCH] #16764: Build break with poppler 22.03.0
git-svn-id: svn://scribus.net/trunk/Scribus@24982 11d20701-8431-0410-a711-e3c959e3b870
---
scribus/plugins/import/pdf/importpdf.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
index 154e58a3f0..392dcd9e64 100644
--- a/scribus/plugins/import/pdf/importpdf.cpp
+++ b/scribus/plugins/import/pdf/importpdf.cpp
@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
#endif
globalParams->setErrQuiet(gTrue);
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
+#else
PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
+#endif
if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
return QImage();
@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
globalParams->setErrQuiet(gTrue);
// globalParams->setPrintCommands(gTrue);
QList<OptionalContentGroup*> ocgGroups;
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
+#else
auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
+#endif
if (pdfDoc)
{
if (pdfDoc->getErrorCode() == errEncrypted)
@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
#else
auto fname = new GooString(QFile::encodeName(fn).data());
#endif
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
+ pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
+#else
auto userPW = new GooString(text.toLocal8Bit().data());
pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
+#endif
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
}
if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))

@ -78,6 +78,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-1.5.6-findhyphen.patch
"${FILESDIR}"/${PN}-1.5.8-poppler-22.2.0-1.patch
"${FILESDIR}"/${PN}-1.5.8-poppler-22.2.0-2.patch
"${FILESDIR}"/${PN}-1.5.8-poppler-22.03.0.patch # bug 834537
)
CMAKE_BUILD_TYPE="Release"

Binary file not shown.

@ -266,7 +266,7 @@ LICENSE="
MPL-2.0
"
SLOT="0"
KEYWORDS="~amd64"
KEYWORDS="amd64"
BDEPEND=">=virtual/rust-1.56"
DEPEND=">=dev-libs/libgit2-1.2.0:="

Binary file not shown.

@ -0,0 +1 @@
DIST REL2_4_1.tar.gz 277428 BLAKE2B 51319e3b1491e1857e63e63640f2e6d2315ab72a0aabcfe7869456822a294bdb53fd0f4cc9bca0c60bfcf9e0926249acad86f09327c5656735b508851037ccaf SHA512 0d673e1a2b696e2cfbb94d8350bb15c280947f69b6512aa80f8ef7497e30cbd407a01b9a4f8fa9844b4ccb39377a6b2bee390a7887f3050074c2e6a11e6f3e3f

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>alexxy@gentoo.org</email>
<name>Alexey Shvetsov</name>
</maintainer>
<upstream>
<remote-id type="github">2ndQuadrant/pglogical</remote-id>
</upstream>
</pkgmetadata>

@ -0,0 +1,33 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
POSTGRES_COMPAT=( 9.6 {10..14} )
inherit postgres-multi
MY_PV=$(ver_rs 1- '_')
MY_P="${PN}-${MY_PV}"
S="${WORKDIR}/${PN}-REL${MY_PV}"
DESCRIPTION="Logical replication for PostgreSQL"
HOMEPAGE="https://www.2ndquadrant.com/en/resources/pglogical/"
SRC_URI="https://github.com/2ndQuadrant/pglogical/archive/REL${MY_PV}.tar.gz"
LICENSE="POSTGRESQL"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
DEPEND="${POSTGRES_DEP}"
RDEPEND="${DEPEND}"
src_compile() {
postgres-multi_foreach emake USE_PGXS=1 || die "emake failed"
}
src_install() {
postgres-multi_foreach emake DESTDIR="${D}" USE_PGXS=1 install
postgres-multi_foreach dobin pglogical_create_subscriber
}

Binary file not shown.

@ -10,7 +10,7 @@ SRC_URI="https://github.com/nomad-software/vend/archive/v${PV}.tar.gz -> ${P}.ta
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~riscv ~x86"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
src_compile() {
ego build .
}

Binary file not shown.

@ -1,2 +1 @@
DIST commons-daemon-1.0.15-src.tar.gz 291128 BLAKE2B af874e6a0852c2dc5c84fcbf5e1e443fb880a306b19054263d06e8d83a9b0866a52f2950c457315d80031a58250ec75284fc7839df82b7555b1ff3bd92e67810 SHA512 f20cc8796978fb09b6ecc8d99bb3c8b271b097d74c1f99b286cde213631e7f50a4104f5db2c354f9624ba8b037502d81e327c581b38253b9b216aa2172016e40
DIST commons-daemon-1.2.4-src.tar.gz 281929 BLAKE2B 877f1c31024a2f3e4796abdd11059bd636444f5c856b998a39761fb0b221467e986586fef43463a4d01b4d4f7a562f9f8c658b94a124cd356b0a70cc185c0030 SHA512 36e9cb3153ca763bfaaa71575a1584610254f1ce4c0f666ff7bbc628311405430536413525c9c777e4364eea62a247fb084750d837e84a62d9fce92a61909d56

@ -1,57 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
JAVA_PKG_IUSE="doc examples source"
inherit autotools java-pkg-2 java-ant-2
DESCRIPTION="Tools to allow Java programs to run as UNIX daemons"
SRC_URI="mirror://apache/commons/daemon/source/${P}-src.tar.gz"
HOMEPAGE="http://commons.apache.org/daemon/"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ppc64 x86 ~amd64-linux ~x86-linux ~x86-solaris"
CDEPEND="kernel_linux? ( sys-libs/libcap )"
DEPEND="
${CDEPEND}
>=virtual/jdk-1.6
source? ( app-arch/zip )"
RDEPEND="
${CDEPEND}
>=virtual/jre-1.6"
S="${WORKDIR}/${P}-src"
java_prepare() {
cd "${S}/src/native/unix" || die
sed -i "s/powerpc/powerpc|powerpc64/g" support/apsupport.m4 || die
eautoconf
}
src_configure() {
java-ant-2_src_configure
cd "${S}/src/native/unix" || die
default
}
src_compile() {
java-pkg-2_src_compile
cd "${S}/src/native/unix" || die
default
}
src_install() {
dobin src/native/unix/jsvc
java-pkg_newjar dist/*.jar
dodoc README RELEASE-NOTES.txt *.html src/native/unix/CHANGES.txt
use doc && java-pkg_dohtml -r dist/docs/*
use examples && java-pkg_doexamples src/samples
use source && java-pkg_dosrc src/main/java/*
}

@ -18,7 +18,7 @@ SRC_URI="mirror://apache/commons/daemon/source/${P}-src.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~ppc64 x86"
KEYWORDS="amd64 ppc64 x86"
DEPEND="
>=virtual/jdk-1.8:*

@ -18,7 +18,7 @@ SRC_URI="https://github.com/conversant/disruptor/archive/${PV}.tar.gz -> ${P}.ta
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
# Compile dependencies
# POM: disruptor-${PV}/pom.xml

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -14,7 +14,7 @@ SRC_URI="http://${MY_PN}.tanukisoftware.org/download/${PV}/${MY_P}.tar.gz"
LICENSE="tanuki-community"
SLOT="0"
KEYWORDS="amd64 x86"
KEYWORDS="amd64 ~arm x86"
RDEPEND="
virtual/jre:1.8"

@ -1,73 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
JAVA_PKG_IUSE="doc examples source test"
inherit java-pkg-2 java-ant-2
DESCRIPTION="Java Compiler Compiler - The Java Parser Generator"
HOMEPAGE="https://javacc.java.net/"
SRC_URI="http://java.net/projects/${PN}/downloads/download/${P}src.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
CDEPEND="dev-java/junit:0"
RDEPEND="
${CDEPEND}
>=virtual/jre-1.6"
DEPEND="
${CDEPEND}
>=virtual/jdk-1.6
test? ( dev-java/ant-junit:0 )"
S="${WORKDIR}/${PN}"
PATCHES=(
"${FILESDIR}"/${PN}-4.0-javadoc.patch
)
JAVA_ANT_REWRITE_CLASSPATH="yes"
JAVA_ANT_CLASSPATH_TAGS+=" javadoc"
EANT_GENTOO_CLASSPATH="junit"
src_prepare() {
default
rm -v lib/junit*/*.jar || die
}
src_test() {
java-pkg-2_src_test
}
src_install() {
java-pkg_dojar "bin/lib/${PN}.jar"
if use doc; then
java-pkg_dohtml -r www/*
java-pkg_dojavadoc doc/api
fi
use examples && java-pkg_doexamples examples
use source && java-pkg_dosrc src/*
echo "JAVACC_HOME=${EPREFIX}/usr/share/javacc/" > "${T}"/22javacc || die
doenvd "${T}"/22javacc
echo "export VERSION=${PV}" > "${T}"/pre || die
local launcher
for launcher in javacc jjdoc jjtree; do
java-pkg_dolauncher ${launcher} -pre "${T}"/pre --main ${launcher}
done
einstalldocs
}

@ -14,7 +14,7 @@ SRC_URI="http://java.net/projects/${PN}/downloads/download/${P}src.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
KEYWORDS="amd64 ~arm arm64 ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
CDEPEND="dev-java/junit:0"

@ -1,2 +1 @@
DIST JAVAMAIL-1_6_2.tar.gz 1107140 BLAKE2B c0f84bad014af1146bc2bb7f4f58924edf8f6762c222f979d1fec787e8dc93861691cd95c23eb663924597277607d2ce5058c232ad1e8626ed2d0f1e17c34a98 SHA512 6c07490fabbcf5969a2d8946bd9f38187cd33b864985e8183f15d9e1ba1508e445f2050633d9054f9ad546fede7790e64d31956bf23eb2ff8dae45129bd43534
DIST javax-mail-1.6.7.tar.gz 1854297 BLAKE2B 70dac40cdf67c413db3370f9cdf5b9786fcebce4ba12725758bf6120a2b6874e079a5beef08ee1190e30bfe2f14ad21e73ef1710c982e3f658a2f2f11e524f2e SHA512 9e8754839efb43d14ade6189428c4b86f5fc180e2e18b4e121a9463aaa52c34a431dbf05a6264ef8221faf0b09cc08f914ff758cbb3931df97cea1a897c54c08

@ -1,77 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Skeleton command:
# java-ebuilder --generate-ebuild --workdir . --pom mail/pom.xml --download-uri https://github.com/javaee/javamail/archive/refs/tags/JAVAMAIL-1_6_2.tar.gz --slot 0 --keywords "~amd64 ~arm ~arm64 ~ppc64 ~x86" --ebuild oracle-javamail-1.6.2.ebuild
EAPI=8
JAVA_PKG_IUSE="doc source test"
MAVEN_ID="com.sun.mail:javax.mail:1.6.2"
JAVA_TESTING_FRAMEWORKS="junit-4"
inherit java-pkg-2 java-pkg-simple
DESCRIPTION="JavaMail API"
HOMEPAGE="https://javaee.github.io/javamail/"
SRC_URI="https://github.com/javaee/javamail/archive/refs/tags/JAVAMAIL-${PV//./_}.tar.gz"
LICENSE="|| ( CDDL GPL-2-with-classpath-exception )"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
# Common dependencies
# POM: mail/pom.xml
# javax.activation:activation:1.1 -> !!!groupId-not-found!!!
CP_DEPEND="
dev-java/jakarta-activation-api:1
dev-java/jakarta-activation:2
"
DEPEND="${CP_DEPEND}
>=virtual/jdk-1.8:*"
RDEPEND="${CP_DEPEND}
>=virtual/jre-1.8:*"
DOCS=( ../{LICENSE.txt,README.md} )
S="${WORKDIR}/javamail-JAVAMAIL-${PV//./_}/mail"
JAVA_ENCODING="iso-8859-1"
JAVA_SRC_DIR="src/main/java"
JAVA_RESOURCE_DIRS="src/main/resources"
JAVA_TEST_GENTOO_CLASSPATH="junit-4"
JAVA_TEST_SRC_DIR="src/test/java"
JAVA_TEST_RESOURCE_DIRS="src/test/resources"
src_prepare() {
default
mv src/main/{resources,java}/javax/mail/Version.java || die
}
src_test() {
pushd src/test/java || die
# Selection according to 201,202 pom.xml
local JAVA_TEST_RUN_ONLY=$(find * \
-name "*TestSuite.java" -o -name "*Test.java" \
! -name "MailHandlerTest.java" \
! -name "DurationFilterTest.java" \
! -name "CompactFormatterTest.java" \
! -name "CollectorFormatterTest.java" \
! -name "WriteTimeoutSocketTest.java" \
)
JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}"
JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}"
popd
java-pkg-simple_src_test
}
src_install() {
default # https://bugs.gentoo.org/789582
java-pkg-simple_src_install
}

@ -1,39 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
JAVA_PKG_IUSE="doc source"
inherit java-pkg-2 java-pkg-simple
DESCRIPTION="A minimalistic realtime charting library for Java"
HOMEPAGE="http://jchart2d.sourceforge.net"
SRC_URI="mirror://sourceforge/${PN}/${PN}/sources/${PN}-eclipse-project-${PV}.zip"
LICENSE="LGPL-2.1+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RESTRICT="test" # Even the headless tests need a display!?
CDEPEND="dev-java/jide-oss:0
dev-java/xmlgraphics-commons:2"
RDEPEND=">=virtual/jre-1.6
${CDEPEND}"
DEPEND=">=virtual/jdk-1.6
${CDEPEND}
app-arch/unzip"
JAVA_GENTOO_CLASSPATH="jide-oss,xmlgraphics-commons-2"
JAVA_SRC_DIR="src"
S="${WORKDIR}/${PN}"
java_prepare() {
rm -rv ext/* || die
# Ant tries and fails to build these outdated bug
# demonstrations. Did Ant's globbing behaviour change?
rm -v src/*.java || die
}

@ -18,7 +18,7 @@ SRC_URI="https://github.com/JodaOrg/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ppc64 x86"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
# Compile dependencies
# POM: pom.xml

@ -1,71 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Skeleton command:
# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://github.com/JodaOrg/joda-convert/archive/refs/tags/v2.2.2.tar.gz --slot 0 --keywords "~amd64 ~arm ~arm64 ~ppc64 ~x86" --ebuild joda-convert-2.2.2.ebuild
EAPI=8
JAVA_PKG_IUSE="doc source test"
MAVEN_ID="org.joda:joda-convert:2.2.2"
JAVA_TESTING_FRAMEWORKS="junit-4"
inherit java-pkg-2 java-pkg-simple
DESCRIPTION="Library to convert Objects to and from String"
HOMEPAGE="https://www.joda.org/joda-convert/"
SRC_URI="https://github.com/JodaOrg/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
# Compile dependencies
# POM: pom.xml
# test? com.google.guava:guava:31.0.1-jre -> !!!suitable-mavenVersion-not-found!!!
# test? junit:junit:4.13.2 -> >=dev-java/junit-4.13.2:4
DEPEND="
>=virtual/jdk-1.8:*
test? (
dev-java/guava:20
)
"
RDEPEND="
>=virtual/jre-1.8:*
"
DOCS=( {LICENSE,NOTICE,RELEASE-NOTES}.txt README.md )
S="${WORKDIR}/${P}"
JAVA_SRC_DIR="src/main/java"
# JAVA_RESOURCE_DIRS=""
JAVA_TEST_GENTOO_CLASSPATH="guava-20,junit-4"
JAVA_TEST_SRC_DIR="src/test/java"
JAVA_TEST_RESOURCE_DIRS="src/test/resources"
JAVA_TEST_EXCLUDES=(
# Upstream: Tests run: 186, Failures: 0, Errors: 0, Skipped: 0
# All following: No runnable methods
org.joda.convert.test1.Test1Class
org.joda.convert.test1.Test1Interface
org.joda.convert.test2.Test2Class
org.joda.convert.test2.Test2Factory
org.joda.convert.test2.Test2Interface
org.joda.convert.test3.Test3Class
org.joda.convert.test3.Test3Factory
org.joda.convert.test3.Test3Interface
org.joda.convert.test3.Test3SuperClass
org.joda.convert.test4.Test4Class
org.joda.convert.test4.Test4Factory
org.joda.convert.test4.Test4Interface
org.joda.convert.TestRenameHandlerBadInit
)
src_install() {
default # https://bugs.gentoo.org/789582
java-pkg-simple_src_install
}

@ -15,7 +15,7 @@ HOMEPAGE="http://jtidy.sourceforge.net/"
SRC_URI="mirror://sourceforge/project/${PN}/JTidy/${MY_PV}/${PN}-${MY_PV}-sources.zip -> ${P}.zip"
LICENSE="HTML-Tidy W3C"
SLOT="0"
KEYWORDS="amd64 ~ppc64 x86"
KEYWORDS="amd64 ppc64 x86"
CDEPEND="dev-java/ant-core:0"

@ -1,52 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
JAVA_PKG_IUSE="doc source"
inherit java-pkg-2 java-ant-2
MY_PV="r938"
MY_P="${PN}-${MY_PV}"
DESCRIPTION="Java port of HTML Tidy, an HTML syntax checker and pretty printer"
HOMEPAGE="http://jtidy.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${PN}-${MY_PV}-sources.zip -> ${P}.zip"
LICENSE="HTML-Tidy W3C"
SLOT="0"
KEYWORDS="amd64 ppc64 x86"
CDEPEND="dev-java/ant-core:0"
RDEPEND="
${CDEPEND}
>=virtual/jre-1.6"
DEPEND="
${CDEPEND}
>=virtual/jdk-1.6
source? ( app-arch/zip )"
JAVA_ANT_ENCODING="UTF-8"
JAVA_ANT_REWRITE_CLASSPATH="yes"
EANT_GENTOO_CLASSPATH="ant-core"
EANT_BUILD_TARGET="jar"
S="${WORKDIR}"
PATCHES=(
"${FILESDIR}"/"${P}-build.xml.patch"
)
java_prepare() {
epatch "${PATCHES[@]}"
}
src_install() {
java-pkg_newjar "target/${MY_P}.jar"
java-pkg_dolauncher "jtidy" --main org.w3c.tidy.Tidy
use doc && java-pkg_dojavadoc target/javadoc/
use source && java-pkg_dosrc src/main/java
}

@ -14,7 +14,7 @@ SRC_URI="https://archive.apache.org/dist/kafka/${PV}/kafka-${PV}-src.tgz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ppc64 x86"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
CP_DEPEND="
>=dev-java/lz4-java-1.4.1:0

@ -15,7 +15,7 @@ SRC_URI="https://github.com/LMAX-Exchange/disruptor/archive/${PV}.tar.gz -> ${P}
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~ppc64 x86"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
DEPEND=">=virtual/jdk-1.8:*"
RDEPEND=">=virtual/jre-1.8:*"

@ -14,7 +14,7 @@ SRC_URI="https://github.com/lz4/lz4-java/archive/refs/tags/${PV}.tar.gz -> ${P}.
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ppc64 x86"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
# Tests require com.carrotsearch.randomizedtesting:junit4-ant, which is yet to
# be packaged. Some extra steps are required before running the tests:

@ -15,7 +15,7 @@ SRC_URI="https://dev.gentoo.org/~ercpe/distfiles/${CATEGORY}/${PN}/${P}.tar.bz2"
LICENSE="codehaus-classworlds"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ppc64 x86"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
IUSE=""
DEPEND=">=virtual/jdk-1.8"

@ -17,7 +17,7 @@ SRC_URI="https://github.com/xerial/${MY_PN}/archive/${PV}.tar.gz -> ${MY_P}.tar.
LICENSE="Apache-2.0"
SLOT="1.1"
KEYWORDS="amd64 ~arm ~arm64 ppc64 x86"
KEYWORDS="amd64 ~arm arm64 ppc64 x86"
# Tests require org.apache.hadoop:hadoop-common:2.7.*, which is yet to be
# packaged. Some extra steps are required before running the tests:

@ -20,7 +20,7 @@ SRC_URI="https://dev.gentoo.org/~ercpe/distfiles/${CATEGORY}/${PN}/${P}.tar.bz2"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 x86"
KEYWORDS="amd64 ~arm ~arm64 ~ppc64 x86"
DEPEND=">=virtual/jdk-1.8:*"
RDEPEND=">=virtual/jre-1.8:*"

Binary file not shown.

@ -13,7 +13,7 @@ LICENSE="MIT"
# Upstream don't maintain binary compatibility
# https://github.com/svaarala/duktape/issues/1524
SLOT="0/${PV}"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ppc ppc64 ~riscv x86"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ppc ppc64 ~riscv x86"
PATCHES=(
"${FILESDIR}"/${PN}-2.7.0-respect-tc-env.patch

@ -1,7 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
<maintainer type="person" proxied="yes">
<email>contact@hacktivis.me</email>
<name>Haelwenn (lanodan) Monnier</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
<upstream>
<bugs-to>
https://github.com/elixir-lang/elixir/issues

@ -1,16 +1,12 @@
DIST erlang-23.3.4.8.tar.gz 57242259 BLAKE2B 9959fd9ae0d8a0a4639ad0ff9f5a16079cdd7af525e0dc1189a3cc6741f653e511c84da77344465e7f365a8cbc07f691d3cfec23b062c2e274dbb8d4911733a2 SHA512 14449701a88b18103266cd562cad8b0f10e7abb153c7fe2d39792c232a11c5c5ea12e75eb17bac57e30cc43d1e907ae988a1beb662b4d7309f35231c76bdb381
DIST erlang-23.3.4.11.tar.gz 57263517 BLAKE2B e677d9cff8604222c61467e64c0b5fb95a5c108778683bdfc0221c8d2f2973a33ec114d0e109b1586e114ee6b49cbc0c000295161eca5a0bff9770f18c3311d6 SHA512 820be438219473cd2f73cf03c854fdc5585ff7ffada411932a672bc6b182ef6d68350e0150fd1c9de6f7dcf788b443f1905c79e96f8b02d39a7190cdb267559e
DIST erlang-23.3.4.tar.gz 56664814 BLAKE2B ef8aa8d5a6fd1efc02a35459d1cb15eecf5f948127266bf782544e1da9a59765aca15070ea92df5558a4de017cc810e3542e2393e9470243fc6d9be13e9f37b6 SHA512 c8c5a9676163058276c703a0db0373508fad0ed9dff0aa9806ce59115ca766ff1d343c5a3917a920b249655fe188b974482ff378e9173c9fe00ea3907e618da5
DIST erlang-24.0.2.tar.gz 58878378 BLAKE2B c2ea65cac39b654d9037ea9fcb47eb6eea96dec2483378f414bc33475e850121c1adaa30ea880070624496be9779539f98c864b0dd6eb92d3c4badaa121353d1 SHA512 d85e3e6a4177ac8c696dd666183f624065a89d35aa7f031cd6a7b105e0d1f9007de8d413880df47daf8f695485d952a81a14a01313b52f66534c1e5bd050093b
DIST erlang-24.1.4.tar.gz 59009229 BLAKE2B 484ad90509a618098dc1c3fc2ae7d2b44dc7735399f3ba2138d3c755b337e7c513083724329581e72968f6a5c33c9767f0192a1f5d21d35a3a69d5b4e151def2 SHA512 b5cf4fbce07b26b97ec8af62d1b86315227ff369f27c996a6df08b322b76721539a55664dcd4ffec49ff77efadc8e4f0c967c064bb4e1f5cdfa2db2eaa02620f
DIST erlang-24.1.7.tar.gz 59014237 BLAKE2B e32e963911c574fb7927d870029912b8de2cdde8303ee12cdcca8d345eddaa76ee16862a07c6d5013a775c80db6abb744c6be3447dad8126d0aa26ac4d305043 SHA512 052758df429af0971c9d78a4f56e2f333379510db3efbb103e6b869584e54af438b2d43e5172412e0fc624ea68b1df6be84debdae51777a7f4aa327b39b2248f
DIST erlang-24.2.1.tar.gz 59093658 BLAKE2B 4e4cbcea4ccf3d65a16e1af0cabc55ef31107a9475109f5668eb3d0926ad35743d8d6f2d72090acd68f66a6caf3ee3524d4e31500d140bb54d8ff6d629da054c SHA512 b4dd5c9506840fcb078b8c5820a70a07794d8e646f66941095cd9536cfcc60ed6c070d1f85952379384f774beec965521cfc567e7a4a94088ec9ce0fefafe984
DIST erlang-24.2.2.tar.gz 59091659 BLAKE2B 6b845e3de787e7aed4239284ffa81c483504c0a095c3cc3030fb8f3a0a236d0507f4290beb69096a1edbd3d13e9a4d5f2940eb6c268aaceb4a7d3bacf01dfaa0 SHA512 791bd9cc299168d4a209bcdc797a9671a39d03924dc18c9e0520393adf4eb54922c48eecde44601bde55b4fa80b91e0eddbfc486c5f45a611da60b47c63208c7
DIST erlang-24.2.tar.gz 59094451 BLAKE2B 4b1673570e97fe399dbdb5ab2095ba38f08b684c6a0cf7ad47f628d900802751c2db11d5de6f267aeb8c77d27634c2642f96045893acf9f1c32de3e4fe3f3ffb SHA512 88450f935579677eb0d43fd25e5f45b1e78ff8e9c6455d87198decbbb675f90c2e87757b3ee33b43fafb87fced20e984220be9b6b70f8cb8f6d84e4743764495
DIST erlang-24.3.tar.gz 59288148 BLAKE2B faa6ef9b7bb953c95b19ad1545c8d87eeee0a24f2b1a09b22968c93ee9df72df6d1de7cd9015b49891f28f9c8629d3464e41b5f68f7e9f9e28f12ae7fc706e54 SHA512 7a2afb7ac48e05676f5cd1af6748c0e44cb28e896ebe7a3ae389cdb910d124ce7b9f974851b6de81f40d20df2a5775d07b1b8baef7af67df93252f462c1d6550
DIST erlang_doc_html_23.3.tar.gz 36224657 BLAKE2B 7e2a3e16f4cfa0f15c01074740e02af7a45b480b4a94e764463717658ab7e5d0281f928c3ec585582b10168645e3e06cfe72cf6a0ba1b88f539b80f2b7ad99be SHA512 8be4aae46839239604b875b39339e7b6b6c677c099b3d749d5f1041c4508c1c3b4aa8136a93df12b1e5cb6333ef907276f5965c9726ed2b9e77a6043c8ef53b1
DIST erlang_doc_html_24.0.tar.gz 39731398 BLAKE2B 8a9fe3acb4cc13691e16c477cf89e8298df1a99bbe6a6c9e59e3c34248ecdc21077835951087b5a5bbb23ddb28f3bd7ab8b058fe64ce56c342b825a6c0ef8948 SHA512 453f8a9cf779a4f43966615433afc3be3aae7a571acf45974947bd720a331ca05949bc310de5f3b33b72d274971103ede56875bbfe757ba17f903510f690d97e
DIST erlang_doc_html_24.1.tar.gz 39873142 BLAKE2B 5e4bea792be6332a2186a270466a61bda5f37b5a066638ae00545433bf5bd11f84fba7a0ac210a9104e5322fd372759e53d0abd63468c59a3a2c59a3eaddd5ca SHA512 6ace8d8ba4b74e3269e71880f73bd296769acd8778f13fd945b80e57a694d70929d3e7a3263ff3c154190679d88fbb9855e201212e504de4a261e4182662e99a
DIST erlang_doc_html_24.2.tar.gz 36604264 BLAKE2B edc870e53cb89a42ec1022b4250942ab03d47d81dfa86d767c179ef89ec67e2ed7df2274acfe2e1469e5344691e9a0a33174c5237e48e2fc6203518c39978d19 SHA512 de3957676970419953043cbf130194b1bfcb0f2664e2a6148ccfdf7fbd3bc797fa76a19f2e8362e176afd81408b937c5b8b0b126703326b757cfaf396d5e3e79
DIST erlang_doc_html_24.3.tar.gz 36645792 BLAKE2B ef90b7d05ed43656ab1ffdbbd0833c9da08a867ad7a99ec0f7f1eb59697c1f9cd5ccd150b2e564af80b2098f063da0c76121d4444b5444e603581442ad1c7bc8 SHA512 b8d3832ffdbdede656b362d719474f7b9ff04a32ea7235e77d63755629cf9305c203cd6cd9ae089171b2cee694f9641d6ed5d0197e2acf893a31d25696096f1e
DIST erlang_doc_man_23.3.tar.gz 1456501 BLAKE2B 414bedee0e316d97b26d9d6418b799a9434a22e9980e7d3a83e2478d184d63d1633c0e10d0e180d929a3cacd82b4d703be86cbc8e99996037f6b37ea122f7a8c SHA512 6c661c210ffec4752afe624fa46700a0f62cc6589b74b859ab1dfde77d289e992988ac8744f7b4126d7512cd6d0aab3321f710a6324552b259bd7acd5b54a05e
DIST erlang_doc_man_24.0.tar.gz 1666152 BLAKE2B aaef8165322f39f7410840eafe562ec5038d9c89b4fa99b3b1d5748ba70fe755ba732de403dd916328e1fdcec895e2a347db4fb8c8837b5e41155439c9c54ef6 SHA512 7251f6eeb0534cc8538236a2c4be9d732bf0a05ba6832f9b3859116f9148e469d004331924c7187b07204798afb66067bfd321c8905000c355775927e5841918
DIST erlang_doc_man_24.1.tar.gz 1673084 BLAKE2B 092c7870914e108e3fe06b68be6c54cff508cd938b5b510ca9a7c946b786e5725ffa1f2c87282a36480a9c1c7d7c899e8118546102a98136f813309a7f0bd334 SHA512 a11361811c5d58a431f4096866a45755f771f0519bbc992fc71e3c760d81bdc9cf636e189aee72c602a5f02cbf6c7bb6cc442cdb71fd06e0c4097bdf6ffe92ec
DIST erlang_doc_man_24.2.tar.gz 1673926 BLAKE2B 17cf3c1e296c883e9c930cd540d439f7dd71a40048bbe80efd6f46dd5b4d9faf51177d2bb133f782742b0b367c8f54c27ed2b2cce277372a98dd55bb629f3b55 SHA512 359bfca20835eb2a6b6d199e2b108537c453369896b8bd4bd7db05c797421a734c31aea41ddf819b703718353f43186c5fd8f37d1a7d8624e767a41a922c01b9
DIST erlang_doc_man_24.3.tar.gz 1680242 BLAKE2B 3311eb6ed6dcaa2d611adf7a08269f67e3f31d106f6b6d04e5cc91efa8efc382ddb6b230f218fa543390bf4ec37f477e0c4979c82632ebfb6ccda8c5de1fbc41 SHA512 72876911a1ec82071225e7b71de0462254becd64892a5459239b9e44b20601f6b6990a12cd36a8320e81e5307bcf7b5e5057e42baec12403be4a0eda00cdf62c

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7

@ -1,162 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
WX_GTK_VER="3.0-gtk3"
inherit elisp-common java-pkg-opt-2 systemd toolchain-funcs wxwidgets
# NOTE: If you need symlinks for binaries please tell maintainers or
# open up a bug to let it be created.
UPSTREAM_V="$(ver_cut 1-2)"
DESCRIPTION="Erlang programming language, runtime environment and libraries (OTP)"
HOMEPAGE="https://www.erlang.org/"
SRC_URI="https://github.com/erlang/otp/archive/OTP-${PV}.tar.gz -> ${P}.tar.gz
http://erlang.org/download/otp_doc_man_${UPSTREAM_V}.tar.gz -> ${PN}_doc_man_${UPSTREAM_V}.tar.gz
doc? ( http://erlang.org/download/otp_doc_html_${UPSTREAM_V}.tar.gz -> ${PN}_doc_html_${UPSTREAM_V}.tar.gz )"
LICENSE="Apache-2.0"
# We use this subslot because Compiled HiPE Code can be loaded on the exact
# same build of ERTS that was used when compiling the code. See
# http://erlang.org/doc/system_principles/misc.html for more information.
SLOT="0/${PV}"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="doc emacs java +kpoll odbc sctp ssl systemd tk wxwidgets"
RDEPEND="
acct-group/epmd
acct-user/epmd
sys-libs/ncurses:0
sys-libs/zlib
emacs? ( >=app-editors/emacs-23.1:* )
java? ( >=virtual/jdk-1.8:* )
odbc? ( dev-db/unixODBC )
sctp? ( net-misc/lksctp-tools )
ssl? ( >=dev-libs/openssl-0.9.7d:0= )
systemd? ( sys-apps/systemd )
wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] )
"
DEPEND="${RDEPEND}
dev-lang/perl
"
S="${WORKDIR}/otp-OTP-${PV}"
PATCHES=(
"${FILESDIR}"/${PN}-22.0-dont-ignore-LDFLAGS.patch
"${FILESDIR}"/${PN}-24.0.2-serial-configure.patch
)
SITEFILE=50"${PN}"-gentoo.el
src_prepare() {
default
tc-export AR CPP CXX LD
# bug #797886: erlang's VM does unsafe casts for ints
# to pointers and back. This breaks on gcc-11 -flto.
append-flags -fno-strict-aliasing
}
src_configure() {
use wxwidgets && setup-wxwidgets
local myconf=(
--disable-builtin-zlib
# don't search for static zlib
--with-ssl-zlib=no
$(use_enable kpoll kernel-poll)
$(use_with java javac)
$(use_enable sctp)
$(use_with ssl ssl)
$(use_enable ssl dynamic-ssl-lib)
$(use_enable systemd)
$(usex wxwidgets "--with-wx-config=${WX_CONFIG}" "--with-wxdir=/dev/null")
)
econf "${myconf[@]}"
}
src_compile() {
emake
if use emacs ; then
pushd lib/tools/emacs &>/dev/null || die
elisp-compile *.el
popd &>/dev/null || die
fi
}
extract_version() {
local path="$1"
local var_name="$2"
sed -n -e "/^${var_name} = \(.*\)$/s::\1:p" "${S}/${path}/vsn.mk" || die "extract_version() failed"
}
src_install() {
local erl_libdir_rel="$(get_libdir)/erlang"
local erl_libdir="/usr/${erl_libdir_rel}"
local erl_interface_ver="$(extract_version lib/erl_interface EI_VSN)"
local erl_erts_ver="$(extract_version erts VSN)"
local my_manpath="/usr/share/${PN}/man"
[[ -z "${erl_erts_ver}" ]] && die "Couldn't determine erts version"
[[ -z "${erl_interface_ver}" ]] && die "Couldn't determine interface version"
emake INSTALL_PREFIX="${D}" install
if use doc ; then
# Note: we explicitly install docs into:
# /usr/share/doc/${PF}/{doc,lib,erts-*}
# To maintain that layout we gather everything in 'html-docs'.
# See bug #684376.
mkdir html-docs || die
mv "${WORKDIR}"/doc "${WORKDIR}"/lib "${WORKDIR}"/erts-* html-docs/ || die
local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" html-docs/. )
docompress -x /usr/share/doc/${PF}
else
local DOCS=("README.md")
fi
einstalldocs
dosym "../${erl_libdir_rel}/bin/erl" /usr/bin/erl
dosym "../${erl_libdir_rel}/bin/erlc" /usr/bin/erlc
dosym "../${erl_libdir_rel}/bin/escript" /usr/bin/escript
dosym "../${erl_libdir_rel}/lib/erl_interface-${erl_interface_ver}/bin/erl_call" /usr/bin/erl_call
dosym "../${erl_libdir_rel}/erts-${erl_erts_ver}/bin/beam.smp" /usr/bin/beam.smp
## Clean up the no longer needed files
rm "${ED}/${erl_libdir}/Install" || die
insinto "${my_manpath}"
doins -r "${WORKDIR}"/man/*
# extend MANPATH, so the normal man command can find it
# see bug 189639
newenvd - "90erlang" <<-_EOF_
MANPATH="${my_manpath}"
_EOF_
if use emacs ; then
elisp-install erlang lib/tools/emacs/*.{el,elc}
sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \
"${FILESDIR}/${SITEFILE}" > "${T}/${SITEFILE}" || die
elisp-site-file-install "${T}/${SITEFILE}"
fi
newinitd "${FILESDIR}"/epmd.init-r2 epmd
newconfd "${FILESDIR}"/epmd.confd-r2 epmd
use systemd && systemd_newunit "${FILESDIR}"/epmd.service-r1 epmd.service
}
pkg_postinst() {
use emacs && elisp-site-regen
}
pkg_postrm() {
use emacs && elisp-site-regen
}

@ -1,162 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
WX_GTK_VER="3.0-gtk3"
inherit elisp-common java-pkg-opt-2 systemd toolchain-funcs wxwidgets
# NOTE: If you need symlinks for binaries please tell maintainers or
# open up a bug to let it be created.
UPSTREAM_V="$(ver_cut 1-2)"
DESCRIPTION="Erlang programming language, runtime environment and libraries (OTP)"
HOMEPAGE="https://www.erlang.org/"
SRC_URI="https://github.com/erlang/otp/archive/OTP-${PV}.tar.gz -> ${P}.tar.gz
http://erlang.org/download/otp_doc_man_${UPSTREAM_V}.tar.gz -> ${PN}_doc_man_${UPSTREAM_V}.tar.gz
doc? ( http://erlang.org/download/otp_doc_html_${UPSTREAM_V}.tar.gz -> ${PN}_doc_html_${UPSTREAM_V}.tar.gz )"
LICENSE="Apache-2.0"
# We use this subslot because Compiled HiPE Code can be loaded on the exact
# same build of ERTS that was used when compiling the code. See
# http://erlang.org/doc/system_principles/misc.html for more information.
SLOT="0/${PV}"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="doc emacs java +kpoll odbc sctp ssl systemd tk wxwidgets"
RDEPEND="
acct-group/epmd
acct-user/epmd
sys-libs/ncurses:0
sys-libs/zlib
emacs? ( >=app-editors/emacs-23.1:* )
java? ( >=virtual/jdk-1.8:* )
odbc? ( dev-db/unixODBC )
sctp? ( net-misc/lksctp-tools )
ssl? ( >=dev-libs/openssl-0.9.7d:0= )
systemd? ( sys-apps/systemd )
wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] )
"
DEPEND="${RDEPEND}
dev-lang/perl
"
S="${WORKDIR}/otp-OTP-${PV}"
PATCHES=(
"${FILESDIR}"/${PN}-22.0-dont-ignore-LDFLAGS.patch
"${FILESDIR}"/${PN}-24.0.2-serial-configure.patch
)
SITEFILE=50"${PN}"-gentoo.el
src_prepare() {
default
tc-export AR CPP CXX LD
# bug #797886: erlang's VM does unsafe casts for ints
# to pointers and back. This breaks on gcc-11 -flto.
append-flags -fno-strict-aliasing
}
src_configure() {
use wxwidgets && setup-wxwidgets
local myconf=(
--disable-builtin-zlib
# don't search for static zlib
--with-ssl-zlib=no
$(use_enable kpoll kernel-poll)
$(use_with java javac)
$(use_enable sctp)
$(use_with ssl ssl)
$(use_enable ssl dynamic-ssl-lib)
$(use_enable systemd)
$(usex wxwidgets "--with-wx-config=${WX_CONFIG}" "--with-wxdir=/dev/null")
)
econf "${myconf[@]}"
}
src_compile() {
emake
if use emacs ; then
pushd lib/tools/emacs &>/dev/null || die
elisp-compile *.el
popd &>/dev/null || die
fi
}
extract_version() {
local path="$1"
local var_name="$2"
sed -n -e "/^${var_name} = \(.*\)$/s::\1:p" "${S}/${path}/vsn.mk" || die "extract_version() failed"
}
src_install() {
local erl_libdir_rel="$(get_libdir)/erlang"
local erl_libdir="/usr/${erl_libdir_rel}"
local erl_interface_ver="$(extract_version lib/erl_interface EI_VSN)"
local erl_erts_ver="$(extract_version erts VSN)"
local my_manpath="/usr/share/${PN}/man"
[[ -z "${erl_erts_ver}" ]] && die "Couldn't determine erts version"
[[ -z "${erl_interface_ver}" ]] && die "Couldn't determine interface version"
emake INSTALL_PREFIX="${D}" install
if use doc ; then
# Note: we explicitly install docs into:
# /usr/share/doc/${PF}/{doc,lib,erts-*}
# To maintain that layout we gather everything in 'html-docs'.
# See bug #684376.
mkdir html-docs || die
mv "${WORKDIR}"/doc "${WORKDIR}"/lib "${WORKDIR}"/erts-* html-docs/ || die
local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" html-docs/. )
docompress -x /usr/share/doc/${PF}
else
local DOCS=("README.md")
fi
einstalldocs
dosym "../${erl_libdir_rel}/bin/erl" /usr/bin/erl
dosym "../${erl_libdir_rel}/bin/erlc" /usr/bin/erlc
dosym "../${erl_libdir_rel}/bin/escript" /usr/bin/escript
dosym "../${erl_libdir_rel}/lib/erl_interface-${erl_interface_ver}/bin/erl_call" /usr/bin/erl_call
dosym "../${erl_libdir_rel}/erts-${erl_erts_ver}/bin/beam.smp" /usr/bin/beam.smp
## Clean up the no longer needed files
rm "${ED}/${erl_libdir}/Install" || die
insinto "${my_manpath}"
doins -r "${WORKDIR}"/man/*
# extend MANPATH, so the normal man command can find it
# see bug 189639
newenvd - "90erlang" <<-_EOF_
MANPATH="${my_manpath}"
_EOF_
if use emacs ; then
elisp-install erlang lib/tools/emacs/*.{el,elc}
sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \
"${FILESDIR}/${SITEFILE}" > "${T}/${SITEFILE}" || die
elisp-site-file-install "${T}/${SITEFILE}"
fi
newinitd "${FILESDIR}"/epmd.init-r2 epmd
newconfd "${FILESDIR}"/epmd.confd-r2 epmd
use systemd && systemd_newunit "${FILESDIR}"/epmd.service-r1 epmd.service
}
pkg_postinst() {
use emacs && elisp-site-regen
}
pkg_postrm() {
use emacs && elisp-site-regen
}

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -14,15 +14,15 @@ UPSTREAM_V="$(ver_cut 1-2)"
DESCRIPTION="Erlang programming language, runtime environment and libraries (OTP)"
HOMEPAGE="https://www.erlang.org/"
SRC_URI="https://github.com/erlang/otp/archive/OTP-${PV}.tar.gz -> ${P}.tar.gz
http://erlang.org/download/otp_doc_man_${UPSTREAM_V}.tar.gz -> ${PN}_doc_man_${UPSTREAM_V}.tar.gz
doc? ( http://erlang.org/download/otp_doc_html_${UPSTREAM_V}.tar.gz -> ${PN}_doc_html_${UPSTREAM_V}.tar.gz )"
https://github.com/erlang/otp/releases/download/OTP-${UPSTREAM_V}/otp_doc_man_${UPSTREAM_V}.tar.gz -> ${PN}_doc_man_${UPSTREAM_V}.tar.gz
doc? ( https://github.com/erlang/otp/releases/download/OTP-${UPSTREAM_V}/otp_doc_html_${UPSTREAM_V}.tar.gz -> ${PN}_doc_html_${UPSTREAM_V}.tar.gz )"
LICENSE="Apache-2.0"
# We use this subslot because Compiled HiPE Code can be loaded on the exact
# same build of ERTS that was used when compiling the code. See
# http://erlang.org/doc/system_principles/misc.html for more information.
SLOT="0/${PV}"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="doc emacs java +kpoll odbc sctp ssl systemd tk wxwidgets"
RDEPEND="

@ -22,7 +22,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="berkdb bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl tk wininst +xml"
# Do not add a dependency on dev-lang/python to this ebuild.

@ -23,7 +23,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
KEYWORDS="~alpha amd64 ~arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="bluetooth build examples gdbm hardened libedit lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
RESTRICT="!test? ( test )"

@ -23,7 +23,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
KEYWORDS="~alpha amd64 ~arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml"
RESTRICT="!test? ( test )"

@ -23,7 +23,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="PSF-2"
SLOT="${PYVER}"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ~ppc64 ~riscv ~s390 ~sparc x86"
KEYWORDS="~alpha ~amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="bluetooth build examples gdbm hardened lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml"
RESTRICT="!test? ( test )"

@ -1,3 +1,4 @@
DIST ruby-2.6.9.tar.xz 11590064 BLAKE2B 8d14baf479053b7fab517f1e41191b009413d557431c558d92489a36d539f9a667571e4493abba171b047f8ba6d1f676fb6d2f2152fcae737924e773a324ddf6 SHA512 f60aa89e685cea324185eb0d13e6b44caef4e4f761cbf9ea1386ae70e39faf3866ac01e4bb5354574f2583e74290b8c80eaf63d126040d52368be6c771476451
DIST ruby-2.7.5.tar.xz 12072980 BLAKE2B 50bb822cb2c5e76fee8755c710b593ce3bcb0f4f14b96a4e9eef5e58b4614bcf5f91491586b1dd6411fce57c258a7ad80136cd3cfbddf28e4fd4b37f486d2bea SHA512 21c8a713e3ce115fc4c405113ac691ddcefc3419f528b93ca1ac59e7052c1b6e9e241da0e570e291e567f28f3d840824dbcc5967b216cbe7d6ca7a05580fa311
DIST ruby-3.0.3.tar.xz 14991880 BLAKE2B d57b7f6e0d0121326b1a191e93a49c045d26dfd1ab8b0d283b99d09968e07277edde0baaeec072602d6d06e20dcd3893d6cb0b03f59dbc59ebf0e3ebd5646446 SHA512 bb9ea426278d5a7ac46595296f03b82d43df8b7db41045cdf85611e05e26c703c53f700494cd7cf5d4c27fa953bdc5c144317d7720812db0a6e3b6f4bc4d2e00
DIST ruby-3.1.1.tar.xz 15103808 BLAKE2B c11ec8d60cd24c88716d6e685e4cc19931e40504ac04b9d8c79b890cdaf8f4661e95649475e40171e267797674839047276c7f7f1613f20ed3cd5b9ae910950a SHA512 8877fa9a458964a59a11529cd10b3d25b5f6238cd4678b6dcea0bd4b750499cf8ff39d8824053b4ab26c5cd0cfb604a57807ce61580175857fcf00b2cff3e55f

@ -0,0 +1,15 @@
Fix compilation with socks5 USE flag.
Patch by Phobos Kappa in https://bugs.gentoo.org/762253
--- a/ext/socket/sockssocket.c 2020-12-25 05:33:01.000000000 +0200
+++ b/ext/socket/sockssocket.c 2020-12-28 15:42:50.310029778 +0200
@@ -34,7 +34,7 @@
init = 1;
}
- return rsock_init_inetsock(sock, host, port, Qnil, Qnil, INET_SOCKS, Qnil);
+ return rsock_init_inetsock(sock, host, port, Qnil, Qnil, INET_SOCKS, Qnil, Qnil);
}
#ifdef SOCKS5

@ -0,0 +1,20 @@
--- a/tool/rbinstall.rb.~1~ 2020-12-25 04:33:01.000000000 +0100
+++ b/tool/rbinstall.rb 2020-12-25 10:05:34.629096405 +0100
@@ -897,7 +897,7 @@
end
def install_default_gem(dir, srcdir, bindir)
- gem_dir = Gem.default_dir
+ gem_dir = ENV['GEM_DESTDIR']
install_dir = with_destdir(gem_dir)
prepare "default gems from #{dir}", gem_dir
makedirs(Gem.ensure_default_gem_subdirectories(install_dir, $dir_mode).map {|d| File.join(gem_dir, d)})
@@ -1018,7 +1018,7 @@
end
Gem.instance_variable_set(:@ruby, ruby_path) if Gem.ruby != ruby_path
- gem_dir = Gem.default_dir
+ gem_dir = ENV['GEM_DESTDIR']
install_dir = with_destdir(gem_dir)
prepare "bundled gems", gem_dir
RbInstall.no_write do

@ -0,0 +1,28 @@
Adapted for Gentoo version 3.0.2
From b570e7de87aaad8c903176d835e8124127f627b3 Mon Sep 17 00:00:00 2001
From: Andrew Aladjev <aladjev.andrew@gmail.com>
Date: Sat, 26 Sep 2020 12:58:06 +0300
Subject: [PATCH] fixed default coroutine selection for musl
---
configure.ac | 5 ++++-
coroutine/copy/Context.c | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index ab5d532c103b..084f0936c006 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2364,7 +2364,10 @@
rb_cv_coroutine=copy
],
[
- rb_cv_coroutine=ucontext
+ AC_CHECK_FUNCS([getcontext swapcontext makecontext],
+ [rb_cv_coroutine=ucontext],
+ [rb_cv_coroutine=copy; break]
+ )
]
)
AC_MSG_RESULT(${rb_cv_coroutine})

@ -0,0 +1,267 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools flag-o-matic multilib
MY_P="${PN}-$(ver_cut 1-3)"
S=${WORKDIR}/${MY_P}
SLOT=$(ver_cut 1-2)
MY_SUFFIX=$(ver_rs 1 '' ${SLOT})
RUBYVERSION=${SLOT}.0
DESCRIPTION="An object-oriented scripting language"
HOMEPAGE="https://www.ruby-lang.org/"
SRC_URI="https://cache.ruby-lang.org/pub/ruby/${SLOT}/${MY_P}.tar.xz"
LICENSE="|| ( Ruby-BSD BSD-2 )"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="berkdb debug doc examples gdbm ipv6 jemalloc jit +rdoc rubytests socks5 +ssl static-libs systemtap tk xemacs"
RDEPEND="
berkdb? ( sys-libs/db:= )
gdbm? ( sys-libs/gdbm:= )
jemalloc? ( dev-libs/jemalloc:= )
jit? ( || ( sys-devel/gcc:* sys-devel/clang:* ) )
ssl? (
dev-libs/openssl:0=
)
socks5? ( >=net-proxy/dante-1.1.13 )
systemtap? ( dev-util/systemtap )
tk? (
dev-lang/tcl:0=[threads]
dev-lang/tk:0=[threads]
)
dev-libs/libyaml
dev-libs/libffi:=
sys-libs/readline:0=
sys-libs/zlib
virtual/libcrypt:=
>=app-eselect/eselect-ruby-20201225
"
DEPEND="${RDEPEND}"
BUNDLED_GEMS="
>=dev-ruby/minitest-5.15.0[ruby_targets_ruby31]
>=dev-ruby/power_assert-2.0.1[ruby_targets_ruby31]
>=dev-ruby/rake-13.0.6[ruby_targets_ruby31]
>=dev-ruby/rbs-2.1.0[ruby_targets_ruby31]
>=dev-ruby/rexml-3.2.5[ruby_targets_ruby31]
>=dev-ruby/rss-0.2.9[ruby_targets_ruby31]
>=dev-ruby/test-unit-3.5.3[ruby_targets_ruby31]
>=dev-ruby/typeprof-0.12.2[ruby_targets_ruby31]
"
PDEPEND="
${BUNDLED_GEMS}
virtual/rubygems[ruby_targets_ruby31]
>=dev-ruby/bundler-2.3.3[ruby_targets_ruby31]
>=dev-ruby/did_you_mean-1.6.1[ruby_targets_ruby31]
>=dev-ruby/json-2.6.1[ruby_targets_ruby31]
rdoc? ( >=dev-ruby/rdoc-6.3.3[ruby_targets_ruby31] )
xemacs? ( app-xemacs/ruby-modes )"
src_prepare() {
eapply "${FILESDIR}"/"${SLOT}"/010*.patch
if use elibc_musl ; then
eapply "${FILESDIR}"/3.0/900-musl-*.patch
eapply "${FILESDIR}"/2.7/901-musl-*.patch
fi
einfo "Unbundling gems..."
cd "$S"
# Remove bundled gems that we will install via PDEPEND, bug
# 539700.
rm -fr gems/* || die
touch gems/bundled_gems || die
# Don't install CLI tools since they will clash with the gem
rm -f bin/{racc,racc2y,y2racc} || die
sed -i -e '/executables/ s:^:#:' lib/racc/racc.gemspec || die
einfo "Removing bundled libraries..."
rm -fr ext/fiddle/libffi-3.2.1 || die
if use prefix ; then
# Fix hardcoded SHELL var in mkmf library
sed -i -e "s#\(SHELL = \).*#\1${EPREFIX}/bin/sh#" lib/mkmf.rb || die
if [[ ${CHOST} == *darwin* ]] ; then
# avoid symlink loop on Darwin (?!)
sed -i \
-e '/LIBRUBY_ALIASES=/s/lib$(RUBY_INSTALL_NAME).$(SOEXT)//' \
configure.ac || die
# make ar/libtool hack for Darwin work
sed -i \
-e "s/ac_cv_prog_ac_ct_AR='libtool/ac_cv_prog_AR='${CHOST}-libtool/" \
configure.ac || die
fi
fi
eapply_user
eautoreconf
}
src_configure() {
local modules= myconf=
# -fomit-frame-pointer makes ruby segfault, see bug #150413.
filter-flags -fomit-frame-pointer
# In many places aliasing rules are broken; play it safe
# as it's risky with newer compilers to leave it as it is.
append-flags -fno-strict-aliasing
# Socks support via dante
if use socks5 ; then
# Socks support can't be disabled as long as SOCKS_SERVER is
# set and socks library is present, so need to unset
# SOCKS_SERVER in that case.
unset SOCKS_SERVER
fi
# Increase GC_MALLOC_LIMIT if set (default is 8000000)
if [ -n "${RUBY_GC_MALLOC_LIMIT}" ] ; then
append-flags "-DGC_MALLOC_LIMIT=${RUBY_GC_MALLOC_LIMIT}"
fi
# ipv6 hack, bug 168939. Needs --enable-ipv6.
use ipv6 || myconf="${myconf} --with-lookup-order-hack=INET"
# Determine which modules *not* to build depending in the USE flags.
if ! use berkdb ; then
modules="${modules},dbm"
fi
if ! use gdbm ; then
modules="${modules},gdbm"
fi
if ! use ssl ; then
modules="${modules},openssl"
fi
if ! use tk ; then
modules="${modules},tk"
fi
# Provide an empty LIBPATHENV because we disable rpath but we do not
# need LD_LIBRARY_PATH by default since that breaks USE=multitarget
# #564272
INSTALL="${EPREFIX}/usr/bin/install -c" LIBPATHENV="" econf \
--program-suffix=${MY_SUFFIX} \
--with-soname=ruby${MY_SUFFIX} \
--with-readline-dir="${EPREFIX}"/usr \
--enable-shared \
--enable-pthread \
--disable-rpath \
--with-out-ext="${modules}" \
$(use_with jemalloc jemalloc) \
$(use_enable jit jit-support ) \
$(use_enable socks5 socks) \
$(use_enable systemtap dtrace) \
$(use_enable doc install-doc) \
--enable-ipv6 \
$(use_enable static-libs static) \
$(use_enable static-libs install-static-library) \
$(use_with static-libs static-linked-ext) \
$(use_enable debug) \
${myconf} \
--enable-option-checking=no
# Makefile is broken because it lacks -ldl
rm -rf ext/-test-/popen_deadlock || die
}
src_compile() {
emake V=1 EXTLDFLAGS="${LDFLAGS}" MJIT_CFLAGS="${CFLAGS}" MJIT_OPTFLAGS="" MJIT_DEBUGFLAGS=""
}
src_test() {
emake -j1 V=1 test
elog "Ruby's make test has been run. Ruby also ships with a make check"
elog "that cannot be run until after ruby has been installed."
elog
if use rubytests; then
elog "You have enabled rubytests, so they will be installed to"
elog "/usr/share/${PN}-${SLOT}/test. To run them you must be a user other"
elog "than root, and you must place them into a writeable directory."
elog "Then call: "
elog
elog "ruby${MY_SUFFIX} -C /location/of/tests runner.rb"
else
elog "Enable the rubytests USE flag to install the make check tests"
fi
}
src_install() {
# Remove the remaining bundled gems. We do this late in the process
# since they are used during the build to e.g. create the
# documentation.
einfo "Removing default gems before installation"
rm -rf lib/bundler* lib/rdoc/rdoc.gemspec || die
# Ruby is involved in the install process, we don't want interference here.
unset RUBYOPT
local MINIRUBY=$(echo -e 'include Makefile\ngetminiruby:\n\t@echo $(MINIRUBY)'|make -f - getminiruby)
LD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
if [[ ${CHOST} == *darwin* ]] ; then
DYLD_LIBRARY_PATH="${S}:${ED}/usr/$(get_libdir)${DYLD_LIBRARY_PATH+:}${DYLD_LIBRARY_PATH}"
export DYLD_LIBRARY_PATH
fi
RUBYLIB="${S}:${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"
for d in $(find "${S}/ext" -type d) ; do
RUBYLIB="${RUBYLIB}:$d"
done
export LD_LIBRARY_PATH RUBYLIB
# Create directory for the default gems
local gem_home="${EPREFIX}/usr/$(get_libdir)/ruby/gems/${RUBYVERSION}"
mkdir -p "${D}/${gem_home}" || die "mkdir gem home failed"
emake V=1 DESTDIR="${D}" GEM_DESTDIR=${gem_home} install
# Remove installed rubygems and rdoc copy
rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}/rubygems" || die "rm rubygems failed"
rm -rf "${ED}/usr/bin/"gem"${MY_SUFFIX}" || die "rm rdoc bins failed"
rm -rf "${ED}/usr/$(get_libdir)/ruby/${RUBYVERSION}"/rdoc* || die "rm rdoc failed"
rm -rf "${ED}/usr/bin/"{bundle,bundler,ri,rdoc}"${MY_SUFFIX}" || die "rm rdoc bins failed"
if use doc; then
emake DESTDIR="${D}" GEM_DESTDIR=${gem_home} install-doc
fi
if use examples; then
dodoc -r sample
fi
dodoc ChangeLog NEWS.md doc/NEWS* README*
if use rubytests; then
pushd test
insinto /usr/share/${PN}-${SLOT}/test
doins -r .
popd
fi
}
pkg_postinst() {
if [[ ! -n $(readlink "${EROOT}"/usr/bin/ruby) ]] ; then
eselect ruby set ruby${MY_SUFFIX}
fi
elog
elog "To switch between available Ruby profiles, execute as root:"
elog "\teselect ruby set ruby(23|24|...)"
elog
}
pkg_postrm() {
eselect ruby cleanup
}

@ -5,9 +5,7 @@ DIST firefox-78esr-patches-19.tar.xz 88424 BLAKE2B fdc7bf8f28b3e799551a70f1cec7a
DIST firefox-91.7.0esr.source.tar.xz 383133596 BLAKE2B 374da61d89d4b7b24d01e8101926056d6819e7c34c80630694cd2d95193dd6662ccfe3195361e7cd5a4167098e74bb7018d02d5af715fdcf95228bf8f54cb1c2 SHA512 925811989d8a91d826ba356bd46ac54be8153288ec0319c28d2bfbe89191e62e107691159dd7ca247253e2a4952eb59a5b9613e3feea3f5351238d4822e26301
DIST firefox-91esr-patches-05j.tar.xz 17116 BLAKE2B 5db6d2d3d5432369d2cfcda1a2b542d70ac18c1af7013d91984054c9658d7e3f989527c3a248de53f2e8dc51a852a46477f9ad75e98db28f50f8609fcafe547c SHA512 42080a8e28014d5f8de7ff45e0128ab71747faad7a92f0f7094686125835c168751794bd0229f77290f075502c271af0171ffae2863325d10cc6e8a853a90d3e
DIST js185-1.0.0.tar.gz 6164605 BLAKE2B 76a37f0ceae05d3475853875bd0ce4be6e525e4114816f8f281ea6fc6b60a71060975a0fa1cb843f57ad1e2f842dfb26b24244fa0fd6c20f6ae2ebbe430f70be SHA512 2af7122a7c7007fd7b6668776fe1222515a810b3e43bbf0f76b8f94e1ef406ffd3fb5ccec393021b00274c05b38a77235bc8d6886994c56762fcaf0aa7cf6718
DIST mozjs-52.9.1pre1.tar.bz2 30178574 BLAKE2B 0920432b5140e78297a9bcbccb54268d75a223d5e75e4ff90b3b01aab4f7736b4a4e05c47b3a925ff0a74607a0abad3b6583c75d070ef5142009b20ebaf6e4bf SHA512 187b231b246a5ae09e55c0fef77866b316d75f38f4c2e066d5d4325d8da63433027020c929439cab46af3253ac63ab2f780223a8fd2c6ff535b3409bb6c4aa0f
DIST mozjs-60.5.2.tar.bz2 32816585 BLAKE2B 45ac4c9646e1275faf60eeedbf486f802cd106583eb7f640fe2243adc7cbb811dced5cefa94426cceca63468b0112be84078ffcef24cb2b8c1a7b6c8173c0d45 SHA512 5fb73330e7803bdd524fbe7cfdf4e6b72e85d4b22b0c827400317b5d052d1088d36e558ceac376393089e9d03e658b24e69262851fc04a66bbcda47135423dc0
DIST spidermonkey-52.0-patches-1.tar.xz 3112 BLAKE2B d8f4c44cb2ae290fa51efc4725a2c1b3cd85dd9f04f4ccfa5681ba6df5f37f5d8d4ad6859316a70d0f7647ac2cee014d126f88b7d4ca74a82796f35b141200ef SHA512 5328403e3b9ecd1c456037e7cca374c2453d9331752c48b9466e498e22fd8d4ca6e1804e51140ee0be027fcef7d0c3f26822b1f569305a3b2f03209b7fb15499
DIST spidermonkey-60.0-patches-04.tar.xz 4428 BLAKE2B af78049cd9b3ee6a9b689e6253486c4670fd3b506faade7d745dafaa7af329c0bd15cd35e95528a4c96688230f4803130967fb09b97aae2bda0ce0f73acaaf3e SHA512 fb1326a81512146ba98773d4f7e0c4bc1bff0f076897c13f576fcf63b56f6965efeff633eea9160bca9f9bc4546505901084eabc33bc955de0b7ab3d6334387a
DIST spidermonkey-68.6.0-patches-04.tar.xz 5956 BLAKE2B b1250391a5173e676272d5926b710c06b0e9de1ff03b130a57fdac30f2deefbee3fa92250b37e28087572fe5cce73eb112ef4e1fb0c0401d6ecdb22ab9868998 SHA512 94575b11b4f006c6ee0c8d64b315734a173cecb68e9128ca61ba1a28177e3c149b8cf1f3b3c47a7a263fad8da6196fc0101df87392f016686a827e0cd24fdc74
DIST spidermonkey-78-patches-04.tar.xz 3408 BLAKE2B f2fdd4882e1e4de1908c458dc8dfedd5665ef7118f19704dabf2b2a80e2fae48813e9bc3d0c3410287e32c21e3f9d09233d8e5d15917f53aa2f60e6190cd9cdb SHA512 87ac83c0ccc05f482913b1fbf043db1878536f935f934362a47283809c0cbfdeff040206a9c18c687384b606ba8a7bd9a7c1fc3c0bcfdd620987990a33ca1fe2

@ -1,15 +0,0 @@
--- a/testing/mozbase/mozinfo/mozinfo/mozinfo.py 2018-01-12 12:21:16.764318254 -0500
+++ b/testing/mozbase/mozinfo/mozinfo/mozinfo.py 2018-01-12 12:22:23.392069398 -0500
@@ -93,10 +93,11 @@
if info['os'] == 'linux':
import ctypes
+ import ctypes.util
import errno
PR_SET_SECCOMP = 22
SECCOMP_MODE_FILTER = 2
- ctypes.CDLL("libc.so.6", use_errno=True).prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0)
+ ctypes.CDLL(ctypes.util.find_library('c'), use_errno=True).prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0)
info['has_sandbox'] = ctypes.get_errno() == errno.EFAULT
else:
info['has_sandbox'] = True

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save