From f4a93f7a40961f28844eefab8c05246b7332778b Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Fri, 6 Oct 2017 22:26:28 +0200 Subject: [PATCH] postgresql: Update from 9.6.5 to 10.0 --- packages/postgresql/build.sh | 4 +- ...src-backend-commands-collationcmds.c.patch | 12 ++++ .../postgresql/src-bin-initdb-initdb.c.patch | 55 ++----------------- 3 files changed, 18 insertions(+), 53 deletions(-) create mode 100644 packages/postgresql/src-backend-commands-collationcmds.c.patch diff --git a/packages/postgresql/build.sh b/packages/postgresql/build.sh index cb76e0e14..30c60bcd7 100644 --- a/packages/postgresql/build.sh +++ b/packages/postgresql/build.sh @@ -1,8 +1,8 @@ TERMUX_PKG_HOMEPAGE=https://www.postgresql.org TERMUX_PKG_DESCRIPTION="Object-relational SQL database" TERMUX_PKG_MAINTAINER='Vishal Biswas @vishalbiswas' -TERMUX_PKG_VERSION=9.6.5 -TERMUX_PKG_SHA256=06da12a7e3dddeb803962af8309fa06da9d6989f49e22865335f0a14bad0744c +TERMUX_PKG_VERSION=10.0 +TERMUX_PKG_SHA256=712f5592e27b81c5b454df96b258c14d94b6b03836831e015c65d6deeae57fd1 TERMUX_PKG_SRCURL=https://ftp.postgresql.org/pub/source/v$TERMUX_PKG_VERSION/postgresql-$TERMUX_PKG_VERSION.tar.bz2 TERMUX_PKG_DEPENDS="openssl, libcrypt, readline, libandroid-shmem" # - pgac_cv_prog_cc_ldflags__Wl___as_needed: Inform that the linker supports as-needed. It's diff --git a/packages/postgresql/src-backend-commands-collationcmds.c.patch b/packages/postgresql/src-backend-commands-collationcmds.c.patch new file mode 100644 index 000000000..cad30a55b --- /dev/null +++ b/packages/postgresql/src-backend-commands-collationcmds.c.patch @@ -0,0 +1,12 @@ +diff -u -r ../postgresql-10.0/src/backend/commands/collationcmds.c ./src/backend/commands/collationcmds.c +--- ../postgresql-10.0/src/backend/commands/collationcmds.c 2017-10-02 23:09:15.000000000 +0200 ++++ ./src/backend/commands/collationcmds.c 2017-10-06 22:00:29.165645642 +0200 +@@ -362,7 +362,7 @@ + + + /* will we use "locale -a" in pg_import_system_collations? */ +-#if defined(HAVE_LOCALE_T) && !defined(WIN32) ++#if defined(HAVE_LOCALE_T) && !defined(WIN32) && !defined(__ANDROID__) + #define READ_LOCALE_A_OUTPUT + #endif + diff --git a/packages/postgresql/src-bin-initdb-initdb.c.patch b/packages/postgresql/src-bin-initdb-initdb.c.patch index b4a4eae1d..a1f5670e1 100644 --- a/packages/postgresql/src-bin-initdb-initdb.c.patch +++ b/packages/postgresql/src-bin-initdb-initdb.c.patch @@ -1,7 +1,7 @@ -diff -u -r ../postgresql-9.6.2/src/bin/initdb/initdb.c ./src/bin/initdb/initdb.c ---- ../postgresql-9.6.2/src/bin/initdb/initdb.c 2017-02-06 22:45:25.000000000 +0100 -+++ ./src/bin/initdb/initdb.c 2017-03-05 14:41:04.690265407 +0100 -@@ -122,8 +122,8 @@ +diff -u -r ../postgresql-10.0/src/bin/initdb/initdb.c ./src/bin/initdb/initdb.c +--- ../postgresql-10.0/src/bin/initdb/initdb.c 2017-10-02 23:09:15.000000000 +0200 ++++ ./src/bin/initdb/initdb.c 2017-10-06 21:45:24.088346650 +0200 +@@ -119,8 +119,8 @@ /* values to be obtained from arguments */ static char *pg_data = ""; @@ -12,50 +12,3 @@ diff -u -r ../postgresql-9.6.2/src/bin/initdb/initdb.c ./src/bin/initdb/initdb.c static char *lc_collate = ""; static char *lc_ctype = ""; static char *lc_monetary = ""; -@@ -1848,6 +1848,7 @@ - setup_collation(FILE *cmdfd) - { - #if defined(HAVE_LOCALE_T) && !defined(WIN32) -+#ifndef __ANDROID__ - int i; - FILE *locale_a_handle; - char localebuf[NAMEDATALEN]; /* we assume ASCII so this is fine */ -@@ -1856,12 +1857,14 @@ - locale_a_handle = popen_check("locale -a", "r"); - if (!locale_a_handle) - return; /* complaint already printed */ -+#endif - - PG_CMD_PUTS("CREATE TEMP TABLE tmp_pg_collation ( " - " collname name, " - " locale name, " - " encoding int) WITHOUT OIDS;\n\n"); - -+#ifndef __ANDROID__ - while (fgets(localebuf, sizeof(localebuf), locale_a_handle)) - { - size_t len; -@@ -1938,6 +1941,7 @@ - } - free(quoted_locale); - } -+#endif - - /* Add an SQL-standard name */ - PG_CMD_PRINTF1("INSERT INTO tmp_pg_collation VALUES ('ucs_basic', 'C', %d);\n\n", PG_UTF8); -@@ -1969,6 +1973,7 @@ - */ - PG_CMD_PUTS("DROP TABLE tmp_pg_collation;\n\n"); - -+#ifndef __ANDROID__ - pclose(locale_a_handle); - - if (count == 0 && !debug) -@@ -1976,6 +1981,7 @@ - printf(_("No usable system locales were found.\n")); - printf(_("Use the option \"--debug\" to see details.\n")); - } -+#endif - #endif /* not HAVE_LOCALE_T && not WIN32 */ - } -