From 4193812d749ec09791b6c761b77f16f3d1ee8a22 Mon Sep 17 00:00:00 2001 From: Rene Leveille Date: Tue, 23 Jun 2020 17:05:40 -0400 Subject: [PATCH 1/5] bump libpq version --- pythonforandroid/recipes/libpq/__init__.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pythonforandroid/recipes/libpq/__init__.py b/pythonforandroid/recipes/libpq/__init__.py index 45c296a2a6..d1e4565bea 100644 --- a/pythonforandroid/recipes/libpq/__init__.py +++ b/pythonforandroid/recipes/libpq/__init__.py @@ -4,23 +4,26 @@ class LibpqRecipe(Recipe): - version = '9.5.3' - url = 'http://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.bz2' + version = "10.12" + url = "http://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.bz2" depends = [] def should_build(self, arch): - return not os.path.isfile('{}/libpq.a'.format(self.ctx.get_libs_dir(arch.arch))) + return not os.path.isfile("{}/libpq.a".format(self.ctx.get_libs_dir(arch.arch))) def build_arch(self, arch): env = self.get_recipe_env(arch) with current_directory(self.get_build_dir(arch.arch)): - configure = sh.Command('./configure') - shprint(configure, '--without-readline', '--host=arm-linux', - _env=env) - shprint(sh.make, 'submake-libpq', _env=env) - shprint(sh.cp, '-a', 'src/interfaces/libpq/libpq.a', - self.ctx.get_libs_dir(arch.arch)) + configure = sh.Command("./configure") + shprint(configure, "--without-readline", "--host=arm-linux", _env=env) + shprint(sh.make, "submake-libpq", _env=env) + shprint( + sh.cp, + "-a", + "src/interfaces/libpq/libpq.a", + self.ctx.get_libs_dir(arch.arch), + ) recipe = LibpqRecipe() From 813c1444dc2022e79447188c44444a59fe092baa Mon Sep 17 00:00:00 2001 From: Rene Leveille Date: Thu, 25 Jun 2020 15:48:36 -0400 Subject: [PATCH 2/5] Fix libpq env for cross compile --- pythonforandroid/recipes/libpq/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pythonforandroid/recipes/libpq/__init__.py b/pythonforandroid/recipes/libpq/__init__.py index d1e4565bea..b768d93717 100644 --- a/pythonforandroid/recipes/libpq/__init__.py +++ b/pythonforandroid/recipes/libpq/__init__.py @@ -8,6 +8,12 @@ class LibpqRecipe(Recipe): url = "http://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.bz2" depends = [] + def get_recipe_env(self, arch): + env = super().get_recipe_env(arch) + env["USE_DEV_URANDOM"] = "1" + + return env + def should_build(self, arch): return not os.path.isfile("{}/libpq.a".format(self.ctx.get_libs_dir(arch.arch))) From 24463b128c4fc897e08ccfd951f9d1d19717fb2a Mon Sep 17 00:00:00 2001 From: Rene Leveille Date: Thu, 25 Jun 2020 15:54:06 -0400 Subject: [PATCH 3/5] Revert changed made by formatter --- pythonforandroid/recipes/libpq/__init__.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pythonforandroid/recipes/libpq/__init__.py b/pythonforandroid/recipes/libpq/__init__.py index b768d93717..52d95ddac9 100644 --- a/pythonforandroid/recipes/libpq/__init__.py +++ b/pythonforandroid/recipes/libpq/__init__.py @@ -4,30 +4,30 @@ class LibpqRecipe(Recipe): - version = "10.12" - url = "http://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.bz2" + version = '10.12' + url = 'http://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.bz2' depends = [] def get_recipe_env(self, arch): env = super().get_recipe_env(arch) - env["USE_DEV_URANDOM"] = "1" + env['USE_DEV_URANDOM'] = '1' return env def should_build(self, arch): - return not os.path.isfile("{}/libpq.a".format(self.ctx.get_libs_dir(arch.arch))) + return not os.path.isfile('{}/libpq.a'.format(self.ctx.get_libs_dir(arch.arch))) def build_arch(self, arch): env = self.get_recipe_env(arch) with current_directory(self.get_build_dir(arch.arch)): - configure = sh.Command("./configure") - shprint(configure, "--without-readline", "--host=arm-linux", _env=env) - shprint(sh.make, "submake-libpq", _env=env) + configure = sh.Command('./configure') + shprint(configure, '--without-readline', '--host=arm-linux', _env=env) + shprint(sh.make, 'submake-libpq', _env=env) shprint( sh.cp, - "-a", - "src/interfaces/libpq/libpq.a", + '-a', + 'src/interfaces/libpq/libpq.a', self.ctx.get_libs_dir(arch.arch), ) From 99068dd53400f8839edf79713146d8264d7aabad Mon Sep 17 00:00:00 2001 From: Rene Leveille Date: Thu, 25 Jun 2020 15:56:00 -0400 Subject: [PATCH 4/5] more changes from formatter --- pythonforandroid/recipes/libpq/__init__.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pythonforandroid/recipes/libpq/__init__.py b/pythonforandroid/recipes/libpq/__init__.py index 52d95ddac9..1faed7c59b 100644 --- a/pythonforandroid/recipes/libpq/__init__.py +++ b/pythonforandroid/recipes/libpq/__init__.py @@ -22,14 +22,11 @@ def build_arch(self, arch): with current_directory(self.get_build_dir(arch.arch)): configure = sh.Command('./configure') - shprint(configure, '--without-readline', '--host=arm-linux', _env=env) + shprint(configure, '--without-readline', '--host=arm-linux', + _env=env) shprint(sh.make, 'submake-libpq', _env=env) - shprint( - sh.cp, - '-a', - 'src/interfaces/libpq/libpq.a', - self.ctx.get_libs_dir(arch.arch), - ) + shprint(sh.cp, '-a', 'src/interfaces/libpq/libpq.a', + self.ctx.get_libs_dir(arch.arch)) recipe = LibpqRecipe() From 24e3f6be5619e5545d2a5619146935ac3f51ac38 Mon Sep 17 00:00:00 2001 From: Rene Leveille Date: Thu, 25 Jun 2020 18:02:29 -0400 Subject: [PATCH 5/5] pumb psycopg2 version, else theres a runtime error --- pythonforandroid/recipes/psycopg2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonforandroid/recipes/psycopg2/__init__.py b/pythonforandroid/recipes/psycopg2/__init__.py index 5924a73a18..e35694e6ce 100644 --- a/pythonforandroid/recipes/psycopg2/__init__.py +++ b/pythonforandroid/recipes/psycopg2/__init__.py @@ -10,7 +10,7 @@ class Psycopg2Recipe(PythonRecipe): `ANDROID_API` (`ndk-api`) >= 26, see: https://github.com/kivy/python-for-android/issues/1711#issuecomment-465747557 """ - version = '2.8.4' + version = '2.8.5' url = 'https://pypi.python.org/packages/source/p/psycopg2/psycopg2-{version}.tar.gz' depends = ['libpq', 'setuptools'] site_packages_name = 'psycopg2'