Skip to content

Commit 5f6e0b0

Browse files
committed
Fixed patching and added pygame prebuild
1 parent d882e2d commit 5f6e0b0

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

recipes/pygame/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11

22
from toolchain import PythonRecipe, shprint
3+
from os.path import exists, join
4+
import sh
35

46
class PygameRecipe(PythonRecipe):
57
name = 'pygame'
68
version = '1.9.1'
79
url = 'http://pygame.org/ftp/pygame-{version}release.tar.gz'
810
depends = ['python2', 'sdl']
911

12+
def prebuild_armeabi(self):
13+
if exists(join(self.get_build_dir('armeabi'), '.patched')):
14+
print('Pygame already patched, skipping.')
15+
return
16+
self.apply_patch(join('patches', 'fix-surface-access.patch'))
17+
self.apply_patch(join('patches', 'fix-array-surface.patch'))
18+
shprint(sh.touch, join(self.get_build_dir('armeabi'), '.patched'))
19+
20+
1021

1122
recipe = PygameRecipe()

toolchain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,8 @@ def apply_patch(self, filename):
597597
"""
598598
print("Apply patch {}".format(filename))
599599
filename = join(self.recipe_dir, filename)
600-
sh.patch("-t", "-d", self.build_dir, "-p1", "-i", filename)
600+
# AND: get_build_dir shouldn't need to hardcode armeabi
601+
sh.patch("-t", "-d", join(self.get_build_dir('armeabi'), get_directory(self.versioned_url)), "-p1", "-i", filename)
601602

602603
def copy_file(self, filename, dest):
603604
print("Copy {} to {}".format(filename, dest))

0 commit comments

Comments
 (0)