Migrates libffi build to Python 3

Issue reported libffi upstream:
https://github.com/libffi/libffi/pull/563

Also updates `rebuild_updated_recipes.py` following up #472
This commit is contained in:
Andre Miras 2020-05-06 10:56:47 +02:00
parent 3974a1e701
commit 8a4e5b43c9
5 changed files with 31 additions and 5 deletions

View file

@ -26,7 +26,7 @@ def modified_recipes(branch="origin/master"):
recipes = set() recipes = set()
for file_path in git_diff: for file_path in git_diff:
if fnmatch(file_path, "kivy_ios/recipes/*/__init__.py\n"): if fnmatch(file_path, "kivy_ios/recipes/*/__init__.py\n"):
recipe = file_path.split("/")[1] recipe = file_path.split("/")[2]
recipes.add(recipe) recipes.add(recipe)
return recipes return recipes

View file

@ -39,6 +39,7 @@ class LibffiRecipe(Recipe):
self.apply_patch("staticlib.patch") self.apply_patch("staticlib.patch")
self.apply_patch("staticlib2.patch") self.apply_patch("staticlib2.patch")
self.apply_patch("libffi-xcode10.patch") self.apply_patch("libffi-xcode10.patch")
self.apply_patch("generate-darwin-source-and-headers-python3-items.patch")
self.set_marker("patched") self.set_marker("patched")
def build_arch(self, arch): def build_arch(self, arch):
@ -48,8 +49,8 @@ class LibffiRecipe(Recipe):
"generate-darwin-source-and-headers.py", "generate-darwin-source-and-headers.py",
"_generate-darwin-source-and-headers.py") "_generate-darwin-source-and-headers.py")
shprint(sh.touch, "generate-darwin-source-and-headers.py") shprint(sh.touch, "generate-darwin-source-and-headers.py")
python27 = sh.Command("python2.7") python3 = sh.Command("python3")
shprint(python27, "_generate-darwin-source-and-headers.py", "--only-osx") shprint(python3, "_generate-darwin-source-and-headers.py", "--only-osx")
shprint(sh.xcodebuild, shprint(sh.xcodebuild,
self.ctx.concurrent_xcodebuild, self.ctx.concurrent_xcodebuild,
"ONLY_ACTIVE_ARCH=NO", "ONLY_ACTIVE_ARCH=NO",

View file

@ -0,0 +1,12 @@
diff -Nru libffi-3.2.1/generate-darwin-source-and-headers.py libffi-3.2.1-new/generate-darwin-source-and-headers.py
--- libffi-3.2.1/generate-darwin-source-and-headers.py 2014-11-08 13:47:24.000000000 +0100
+++ libffi-3.2.1-new/generate-darwin-source-and-headers.py 2020-05-06 10:30:46.000000000 +0200
@@ -194,7 +194,7 @@
build_target(desktop64_platform, platform_headers)
mkdir_p('darwin_common/include')
- for header_name, tag_tuples in platform_headers.iteritems():
+ for header_name, tag_tuples in platform_headers.items():
basename, suffix = os.path.splitext(header_name)
with open(os.path.join('darwin_common/include', header_name), 'w') as header:
for tag_tuple in tag_tuples:

View file

@ -22,6 +22,7 @@ class LibffiRecipe(Recipe):
"s/-miphoneos-version-min=5.1.1/-miphoneos-version-min=8.0/g", "s/-miphoneos-version-min=5.1.1/-miphoneos-version-min=8.0/g",
"generate-darwin-source-and-headers.py") "generate-darwin-source-and-headers.py")
self.apply_patch("fix-win32-unreferenced-symbol.patch") self.apply_patch("fix-win32-unreferenced-symbol.patch")
self.apply_patch("generate-darwin-source-and-headers-python3-items.patch")
self.set_marker("patched") self.set_marker("patched")
def build_arch(self, arch): def build_arch(self, arch):
@ -31,8 +32,8 @@ class LibffiRecipe(Recipe):
"generate-darwin-source-and-headers.py", "generate-darwin-source-and-headers.py",
"_generate-darwin-source-and-headers.py") "_generate-darwin-source-and-headers.py")
shprint(sh.touch, "generate-darwin-source-and-headers.py") shprint(sh.touch, "generate-darwin-source-and-headers.py")
python27 = sh.Command("python2.7") python3 = sh.Command("python3")
shprint(python27, "_generate-darwin-source-and-headers.py", "--only-ios") shprint(python3, "_generate-darwin-source-and-headers.py", "--only-ios")
shprint(sh.xcodebuild, self.ctx.concurrent_xcodebuild, shprint(sh.xcodebuild, self.ctx.concurrent_xcodebuild,
"ONLY_ACTIVE_ARCH=NO", "ONLY_ACTIVE_ARCH=NO",
"ARCHS={}".format(arch.arch), "ARCHS={}".format(arch.arch),

View file

@ -0,0 +1,12 @@
diff -Nru libffi-3.2.1/generate-darwin-source-and-headers.py libffi-3.2.1-new/generate-darwin-source-and-headers.py
--- libffi-3.2.1/generate-darwin-source-and-headers.py 2014-11-08 13:47:24.000000000 +0100
+++ libffi-3.2.1-new/generate-darwin-source-and-headers.py 2020-05-06 10:30:46.000000000 +0200
@@ -194,7 +194,7 @@
build_target(desktop64_platform, platform_headers)
mkdir_p('darwin_common/include')
- for header_name, tag_tuples in platform_headers.iteritems():
+ for header_name, tag_tuples in platform_headers.items():
basename, suffix = os.path.splitext(header_name)
with open(os.path.join('darwin_common/include', header_name), 'w') as header:
for tag_tuple in tag_tuples: