mozc: move to Python 3.10. (#11339)

This commit is contained in:
OscarL
2024-11-15 03:24:49 -03:00
committed by GitHub
parent d16cf2574c
commit a0e31cd4e2
2 changed files with 52 additions and 23 deletions

View File

@@ -8,7 +8,7 @@ COPYRIGHT="2010-2021 Google Inc.
2021 Utumi Hirosi"
LICENSE="BSD (3-clause)
Apache v2"
REVISION="2"
REVISION="3"
SOURCE_URI="https://github.com/hanya/mozc/releases/download/v$portVersion/mozc-v$portVersion.tar.bz2"
CHECKSUM_SHA256="745a8d91bbdfb6eab44e22f89b58add79b012e994ffdb233e2468d7accc73ec3"
SOURCE_DIR="mozc"
@@ -17,6 +17,9 @@ PATCHES="mozc-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
pythonVersion=3.10
pythonPackage=python${pythonVersion//.}
PROVIDES="
mozc$secondaryArchSuffix
addon:mozc
@@ -29,6 +32,7 @@ REQUIRES="
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libprotobuf$secondaryArchSuffix
six_$pythonPackage
"
BUILD_PREREQUIRES="
cmd:g++$secondaryArchSuffix
@@ -36,17 +40,18 @@ BUILD_PREREQUIRES="
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
cmd:protoc$secondaryArchSuffix
cmd:python3
cmd:python$pythonVersion
cmd:which
cmd:xres
six_python39
"
# This is needed on x86 to build the input_server addons.
if [ "$targetArchitecture" = x86_gcc2 ]; then
BUILD_PREREQUIRES+="
cmd:g++
"
BUILD_PREREQUIRES+="
cmd:g++
"
fi
BUILD()
{
cd src
@@ -57,11 +62,11 @@ BUILD()
GYP_DEFINES="document_dir=$dataDir/mozc \
enable_gtk_renderer=0 \
target_x86_gcc2=$targetArchitecture" \
$portPackageLinksDir/cmd~python3/bin/python3 build_mozc.py gyp \
python$pythonVersion build_mozc.py gyp \
--target_platform=Linux --variant=Haiku --noqt \
--server_dir=$dataDir/mozc
$portPackageLinksDir/cmd~python3/bin/python3 build_mozc.py build \
python$pythonVersion build_mozc.py build \
-c Release \
server/server.gyp:mozc_server \
emacs/emacs.gyp:mozc_emacs_helper \
@@ -73,11 +78,13 @@ INSTALL()
{
MozcOutDir=src/out_linux/Release
MozcDataDir=$dataDir/mozc
if [ "$targetArchitecture" = x86_gcc2 ]; then
InputMethodDir=$addOnsDir/../input_server/methods
else
InputMethodDir=$addOnsDir/input_server/methods
fi
if [ "$targetArchitecture" = x86_gcc2 ]; then
InputMethodDir=$addOnsDir/../input_server/methods
else
InputMethodDir=$addOnsDir/input_server/methods
fi
mkdir -p $MozcDataDir
mkdir -p $MozcDataDir/images
mkdir -p $dataDir/locale/catalogs/x-vnd.Mozc-InputMethod
@@ -85,9 +92,11 @@ fi
mkdir -p $InputMethodDir
cp $MozcOutDir/mozc $InputMethodDir/mozc
if [ "$targetArchitecture" = x86_gcc2 ]; then
cp $MozcOutDir/mozc_task $MozcDataDir/mozc_task
fi
if [ "$targetArchitecture" = x86_gcc2 ]; then
cp $MozcOutDir/mozc_task $MozcDataDir/mozc_task
fi
cp $MozcOutDir/mozc_server $MozcDataDir/mozc_server
cp $MozcOutDir/mozc_tool_haiku $MozcDataDir/mozc_tool
cp $MozcOutDir/mozc_emacs_helper $MozcDataDir/mozc_emacs_helper
@@ -105,5 +114,5 @@ TEST()
{
cd src
# Some tests fails with job > 1
python3 build_mozc.py runtests -c Release --test_jobs 1
python$pythonVersion build_mozc.py runtests -c Release --test_jobs 1
}

View File

@@ -1,11 +1,8 @@
From 7dade1410b1475b82beeea746c1eaff0723671f3 Mon Sep 17 00:00:00 2001
From 722b5a2284715399b5d6a836077beb07f5e3c411 Mon Sep 17 00:00:00 2001
From: hanya <hanya.runo@gmail.com>
Date: Tue, 10 Aug 2021 18:06:18 +0900
Subject: [PATCH] Support mmap on Haiku
Subject: Support mmap on Haiku
---
src/third_party/abseil-cpp/absl/base/config.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/third_party/abseil-cpp/absl/base/config.h b/src/third_party/abseil-cpp/absl/base/config.h
index 9544996..f878679 100644
@@ -21,5 +18,28 @@ index 9544996..f878679 100644
#endif
--
2.30.2
2.45.2
From 790b9422f5f6e979921f09db15cd1a09fde3fea7 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Thu, 14 Nov 2024 11:50:18 -0300
Subject: MutableSet was moved to collections.abc in Python 3.10.
diff --git a/src/third_party/gyp/pylib/gyp/common.py b/src/third_party/gyp/pylib/gyp/common.py
index b268d22..4f9cb0e 100644
--- a/src/third_party/gyp/pylib/gyp/common.py
+++ b/src/third_party/gyp/pylib/gyp/common.py
@@ -494,7 +494,7 @@ def uniquer(seq, idfun=None):
# Based on http://code.activestate.com/recipes/576694/.
-class OrderedSet(collections.MutableSet):
+class OrderedSet(collections.abc.MutableSet):
def __init__(self, iterable=None):
self.end = end = []
end += [None, end, end] # sentinel node for doubly linked list
--
2.45.2