postgresql: update to version 16.3
authorDaniel Golle <[email protected]>
Wed, 5 Jun 2024 02:44:09 +0000 (03:44 +0100)
committerDaniel Golle <[email protected]>
Wed, 3 Jul 2024 01:32:40 +0000 (02:32 +0100)
Switch to new major version 16.
Use meson to build for target, however, old autotools-style configure is
needed to clean the source directory before being able to run meson, and
host build of the timezone compiler ('zic') also still requires using the
old build system.

See also https://www.postgresql.org/docs/16/release-16.html

Signed-off-by: Daniel Golle <[email protected]>
libs/postgresql/Makefile
libs/postgresql/patches/050-build-contrib.patch [deleted file]
libs/postgresql/patches/200-ranlib.patch [deleted file]
libs/postgresql/patches/300-fix-includes.patch
libs/postgresql/patches/700-no-arm-crc-march-change.patch
libs/postgresql/patches/900-pg_ctl-setuid.patch

index f0cd1b2c75100eca368c208859b2d35e7f0986c8..710623fc43a260894f9c2234938d735fc88af62c 100644 (file)
@@ -5,7 +5,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=postgresql
-PKG_VERSION:=15.6
+PKG_VERSION:=16.3
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Daniel Golle <[email protected]>
 PKG_LICENSE:=PostgreSQL
@@ -17,21 +17,20 @@ PKG_SOURCE_URL:=\
        http://ftp.postgresql.org/pub/source/v$(PKG_VERSION) \
        ftp://ftp.postgresql.org/pub/source/v$(PKG_VERSION)
 
-PKG_HASH:=8455146ed9c69c93a57de954aead0302cafad035c2b242175d6aa1e17ebcb2fb
+PKG_HASH:=331963d5d3dc4caf4216a049fa40b66d6bcb8c730615859411b9518764e60585
 
 PKG_BUILD_FLAGS:=no-mips16
-PKG_FIXUP:=autoreconf
-PKG_MACRO_PATHS:=config
-PKG_BUILD_DEPENDS:=postgresql/host
+PKG_BUILD_DEPENDS:=perl/host postgresql/host
 PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/meson.mk
 
 define Package/libpq
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+libpthread
+  DEPENDS:=+BUILD_NLS:icu +libpthread
   TITLE:=PostgreSQL client library
   URL:=http://www.postgresql.org/
   SUBMENU:=Database
@@ -114,29 +113,12 @@ PGSQL_CLI_EXTRA_BIN := \
        vacuumdb        \
        vacuumlo
 
-PGSQL_CONFIG_VARS:= \
-       pgac_cv_snprintf_long_long_int_format="%lld" \
-       pgac_cv_snprintf_size_t_support=yes \
-       USE_DEV_URANDOM=1 \
-       ac_cv_file__dev_urandom="/dev/urandom" \
-       ZIC=zic
-
-ifeq ($(CONFIG_USE_UCLIBC),y)
-# PostgreSQL does not build against uClibc with locales
-# enabled, due to an uClibc bug, see
-# http://lists.uclibc.org/pipermail/uclibc/2014-April/048326.html
-# so overwrite automatic detection and disable locale support
-PGSQL_CONFIG_VARS+= \
-               pgac_cv_type_locale_t=no
-endif
-
-TARGET_CONFIGURE_OPTS+=$(PGSQL_CONFIG_VARS)
-
-HOST_CONFIGURE_ARGS += \
+FAKE_CONFIGURE_ARGS := \
                        --disable-nls \
                        --disable-rpath \
                        --without-bonjour \
                        --without-gssapi \
+                       --without-icu \
                        --without-ldap \
                        --without-openssl \
                        --without-pam \
@@ -148,24 +130,50 @@ HOST_CONFIGURE_ARGS += \
                        --with-zlib="yes" \
                        --enable-depend
 
-CONFIGURE_ARGS += \
-                       $(DISABLE_NLS) \
+HOST_CONFIGURE_ARGS += \
+                       --disable-nls \
                        --disable-rpath \
                        --without-bonjour \
                        --without-gssapi \
+                       --without-icu \
                        --without-ldap \
                        --without-openssl \
                        --without-pam \
                        --without-perl \
                        --without-python \
+                       --without-readline \
                        --without-tcl \
                        --without-systemd \
                        --with-zlib="yes" \
-                       --enable-depend \
-                       $(if $(CONFIG_arc),--disable-spinlocks)
+                       --enable-depend
 
 HOST_CFLAGS += -std=gnu99
 
+MESON_ARGS += \
+               -Dnls=$(if $(CONFIG_BUILD_NLS),en,dis)abled \
+               -Dicu=$(if $(CONFIG_BUILD_NLS),en,dis)abled \
+               -Ddocs=disabled \
+               -Ddocs_pdf=disabled \
+               -Drpath=false \
+               -Dbonjour=disabled \
+               -Dbsd_auth=disabled \
+               -Dgssapi=disabled \
+               -Dldap=disabled \
+               -Dlibxml=disabled \
+               -Dlibxslt=disabled \
+               -Dssl=none \
+               -Dpam=disabled \
+               -Dplperl=disabled \
+               -Dplpython=disabled \
+               -Dpltcl=disabled \
+               -Dsystemd=disabled \
+               -Dzlib=enabled \
+               -Dspinlocks=$(if $(CONFIG_arc),true,false)
+
+define Host/Configure
+       $(call Host/Configure/Default)
+endef
+
 # Need a native zic and pg_config for build
 define Host/Compile
        +$(HOST_MAKE_VARS) MAKELEVEL=0 $(MAKE) -C $(HOST_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)"
@@ -181,13 +189,6 @@ define Host/Install
        $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/timezone/zic $(STAGING_DIR_HOSTPKG)/bin/
 endef
 
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) MAKELEVEL=0 all contrib
-endef
-
-# because PROFILE means something else in the project Makefile
-unexport PROFILE
-
 define Package/libpq/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.so.* $(1)/usr/lib/
@@ -231,6 +232,12 @@ define Package/pgsql-server/install
        $(INSTALL_BIN) ./files/postgresql.init $(1)/etc/init.d/postgresql
 endef
 
+define Build/Configure
+       $(call Build/Configure/Default,$(FAKE_CONFIGURE_ARGS))
+       make -C $(PKG_BUILD_DIR) maintainer-clean
+       $(call Build/Configure/Meson)
+endef
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/bin
        $(CP) $(STAGING_DIR_HOSTPKG)/lib/pg_config $(1)/usr/bin
diff --git a/libs/postgresql/patches/050-build-contrib.patch b/libs/postgresql/patches/050-build-contrib.patch
deleted file mode 100644 (file)
index 88a23f0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/GNUmakefile.in
-+++ b/GNUmakefile.in
-@@ -8,7 +8,7 @@ subdir =
- top_builddir = .
- include $(top_builddir)/src/Makefile.global
--$(call recurse,all install,src config)
-+$(call recurse,all install,src config contrib)
- docs:
-       $(MAKE) -C doc all
diff --git a/libs/postgresql/patches/200-ranlib.patch b/libs/postgresql/patches/200-ranlib.patch
deleted file mode 100644 (file)
index d4184a3..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/src/port/Makefile
-+++ b/src/port/Makefile
-@@ -83,6 +83,7 @@ uninstall:
- libpgport.a: $(OBJS)
-       rm -f $@
-       $(AR) $(AROPT) $@ $^
-+      $(RANLIB) libpgport.a
- # getaddrinfo.o and getaddrinfo_shlib.o need PTHREAD_CFLAGS (but getaddrinfo_srv.o does not)
- getaddrinfo.o: CFLAGS+=$(PTHREAD_CFLAGS)
index 3611c8e00a3dc88605200ee9a5ab75921c4f27a6..4109f2d7690ed96cde356a940e6289b1b149b4fa 100644 (file)
@@ -1,13 +1,15 @@
 --- a/src/bin/pg_ctl/pg_ctl.c
 +++ b/src/bin/pg_ctl/pg_ctl.c
-@@ -12,9 +12,11 @@
+@@ -12,11 +12,13 @@
  #include "postgres_fe.h"
  
  #include <fcntl.h>
 +#include <pwd.h>
  #include <signal.h>
  #include <time.h>
+ #include <sys/resource.h>
  #include <sys/stat.h>
+ #include <sys/time.h>
 +#include <sys/types.h>
  #include <sys/wait.h>
  #include <unistd.h>
index 33637f5d5920da0d61c441b26cbd6fec25452996..18ed97e3fbbd4c37a5fb21ae761f9b99fdf20c54 100644 (file)
@@ -1,15 +1,17 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -2239,9 +2239,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+@@ -2124,10 +2124,10 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+ # First check if __crc32c* intrinsics can be used with the default compiler
  # flags. If not, check if adding -march=armv8-a+crc flag helps.
- # CFLAGS_ARMV8_CRC32C is set if the extra flag is required.
- PGAC_ARMV8_CRC32C_INTRINSICS([])
+ # CFLAGS_CRC is set if the extra flag is required.
+-PGAC_ARMV8_CRC32C_INTRINSICS([])
 -if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then
 -  PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc])
 -fi
++#PGAC_ARMV8_CRC32C_INTRINSICS([])
 +#if test x"$pgac_armv8_crc32c_intrinsics" != x"yes"; then
 +#  PGAC_ARMV8_CRC32C_INTRINSICS([-march=armv8-a+crc])
 +#fi
- AC_SUBST(CFLAGS_ARMV8_CRC32C)
  
- # Select CRC-32C implementation.
+ AC_SUBST(CFLAGS_CRC)
index 64d558fcc03cf6971a7f2aa4a64a3917acdf7acc..b969d172aa869b1e4785ba90849acd8cd22d3e56 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/bin/pg_ctl/pg_ctl.c
 +++ b/src/bin/pg_ctl/pg_ctl.c
-@@ -96,6 +96,7 @@ static char *event_source = NULL;
+@@ -91,6 +91,7 @@ static char *event_source = NULL;
  static char *register_servicename = "PostgreSQL";     /* FIXME: + version ID? */
  static char *register_username = NULL;
  static char *register_password = NULL;
@@ -8,7 +8,7 @@
  static char *argv0 = NULL;
  static bool allow_core_files = false;
  static time_t start_time;
-@@ -2086,6 +2087,9 @@ do_help(void)
+@@ -1991,6 +1992,9 @@ do_help(void)
  #endif
        printf(_("  -s, --silent           only print errors, no informational messages\n"));
        printf(_("  -t, --timeout=SECS     seconds to wait when using -w option\n"));
@@ -18,7 +18,7 @@
        printf(_("  -V, --version          output version information, then exit\n"));
        printf(_("  -w, --wait             wait until operation completes (default)\n"));
        printf(_("  -W, --no-wait          do not wait until operation completes\n"));
-@@ -2298,6 +2302,7 @@ main(int argc, char **argv)
+@@ -2203,6 +2207,7 @@ main(int argc, char **argv)
                {"options", required_argument, NULL, 'o'},
                {"silent", no_argument, NULL, 's'},
                {"timeout", required_argument, NULL, 't'},
@@ -26,7 +26,7 @@
                {"core-files", no_argument, NULL, 'c'},
                {"wait", no_argument, NULL, 'w'},
                {"no-wait", no_argument, NULL, 'W'},
-@@ -2338,20 +2343,6 @@ main(int argc, char **argv)
+@@ -2243,20 +2248,6 @@ main(int argc, char **argv)
                }
        }
  
@@ -47,7 +47,7 @@
  
        env_wait = getenv("PGCTLTIMEOUT");
        if (env_wait != NULL)
-@@ -2437,11 +2428,15 @@ main(int argc, char **argv)
+@@ -2342,11 +2333,15 @@ main(int argc, char **argv)
                                        wait_seconds_arg = true;
                                        break;
                                case 'U':
@@ -63,7 +63,7 @@
                                        break;
                                case 'w':
                                        do_wait = true;
-@@ -2523,6 +2518,41 @@ main(int argc, char **argv)
+@@ -2428,6 +2423,41 @@ main(int argc, char **argv)
                exit(1);
        }