From 4193812d749ec09791b6c761b77f16f3d1ee8a22 Mon Sep 17 00:00:00 2001 From: Rene Leveille Date: Tue, 23 Jun 2020 17:05:40 -0400 Subject: [PATCH 1/4] 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/4] 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/4] 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/4] 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()