Skip to content

Commit f740fba

Browse files
committed
Merge pull request kivy#597 from kived/fix-mysqldb-patching
fix mysqldb patching
2 parents 8243160 + 7572fc5 commit f740fba

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

pythonforandroid/recipes/mysqldb/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ class MysqldbRecipe(CompiledComponentsPythonRecipe):
1515

1616
# call_hostpython_via_targetpython = False
1717

18+
def convert_newlines(self, filename):
19+
print('converting newlines in {}'.format(filename))
20+
with open(filename, 'rb') as f:
21+
data = f.read()
22+
with open(filename, 'wb') as f:
23+
f.write(data.replace(b'\r\n', b'\n').replace(b'\r', b'\n'))
24+
25+
def prebuild_arch(self, arch):
26+
super(MysqldbRecipe, self).prebuild_arch(arch)
27+
setupbase = join(self.get_build_dir(arch.arch), 'setup')
28+
self.convert_newlines(setupbase + '.py')
29+
self.convert_newlines(setupbase + '_posix.py')
30+
1831
def get_recipe_env(self, arch=None):
1932
env = super(MysqldbRecipe, self).get_recipe_env(arch)
2033

pythonforandroid/recipes/mysqldb/disable-zip.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--- mysqldb/setup.py 2014-01-02 13:52:50.000000000 -0600
2-
+++ b/setup.py 2016-01-11 15:25:09.375114016 -0600
2+
+++ b/setup.py 2016-01-13 15:48:36.781216443 -0600
33
@@ -18,4 +18,5 @@
44
metadata['ext_modules'] = [
55
setuptools.Extension(sources=['_mysql.c'], **options)]

pythonforandroid/recipes/mysqldb/override-mysql-config.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--- mysqldb/setup_posix.py 2014-01-02 13:52:50.000000000 -0600
2-
+++ b/setup_posix.py 2016-01-11 14:38:33.603528571 -0600
2+
+++ b/setup_posix.py 2016-01-13 15:48:18.732883429 -0600
33
@@ -13,17 +13,7 @@
44
return "-%s" % f
55

0 commit comments

Comments
 (0)