diff --git a/dev-db/postgresql/patches/postgresql11-11.1.patchset b/dev-db/postgresql/patches/postgresql-16.10.patchset similarity index 71% rename from dev-db/postgresql/patches/postgresql11-11.1.patchset rename to dev-db/postgresql/patches/postgresql-16.10.patchset index b589d2046..eecc83c1d 100644 --- a/dev-db/postgresql/patches/postgresql11-11.1.patchset +++ b/dev-db/postgresql/patches/postgresql-16.10.patchset @@ -1,36 +1,31 @@ -From 3d1a59353acd602eb503375b1967d4f33e2fb14c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= -Date: Mon, 24 Dec 2018 17:42:35 +0100 -Subject: Applied patches +From 4352aee748a215e2e23be897c7baee39785d63c9 Mon Sep 17 00:00:00 2001 +From: Augustin Cavalier +Date: Thu, 3 Oct 2019 17:36:43 +0000 +Subject: Changes to make Postgresql run on Haiku. +Adapted from Mark Hellegers' 9.3.5 patch. -diff --git a/configure.in b/configure.in -index c1bc8ca..b19e7d7 100644 ---- a/configure.in -+++ b/configure.in -@@ -64,6 +64,7 @@ case $host_os in +diff --git a/configure.ac b/configure.ac +index 456c541..ca1e3d6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -67,6 +67,7 @@ case $host_os in + darwin*) template=darwin ;; dragonfly*) template=netbsd ;; freebsd*) template=freebsd ;; - hpux*) template=hpux ;; -+ haiku*) template=haiku ;; ++ haiku*) template=haiku ;; linux*|gnu*|k*bsd*-gnu) template=linux ;; mingw*) template=win32 ;; -@@ -1126,8 +1127,8 @@ AC_SUBST(PTHREAD_LIBS) - - AC_CHECK_LIB(m, main) - AC_SEARCH_LIBS(setproctitle, util) --AC_SEARCH_LIBS(dlopen, dl) +@@ -1300,12 +1301,12 @@ AC_SEARCH_LIBS(setproctitle, util) + # gcc/clang's sanitizer helper library provides dlopen but not dlsym, thus + # when enabling asan the dlopen check doesn't notice that -ldl is actually + # required. Just checking for dlsym() ought to suffice. +-AC_SEARCH_LIBS(dlsym, dl) -AC_SEARCH_LIBS(socket, [socket ws2_32]) +AC_SEARCH_LIBS(dlopen, [rt root]) +AC_SEARCH_LIBS(socket, [socket ws2_32 network]) - AC_SEARCH_LIBS(shl_load, dld) - # We only use libld in port/dynloader/aix.c - case $host_os in -@@ -1137,16 +1138,16 @@ case $host_os in - esac AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt]) - AC_SEARCH_LIBS(crypt, crypt) -AC_SEARCH_LIBS(shm_open, rt) -AC_SEARCH_LIBS(shm_unlink, rt) -AC_SEARCH_LIBS(clock_gettime, [rt posix4]) @@ -39,16 +34,8 @@ index c1bc8ca..b19e7d7 100644 +AC_SEARCH_LIBS(clock_gettime, [rt posix4 root]) # Solaris: AC_SEARCH_LIBS(fdatasync, [rt posix4]) - # Required for thread_test.c on Solaris - AC_SEARCH_LIBS(sched_yield, rt) - # Required for thread_test.c on Solaris 2.5: - # Other ports use it too (HP-UX) so test unconditionally --AC_SEARCH_LIBS(gethostbyname_r, nsl) -+AC_SEARCH_LIBS(gethostbyname_r, [nsl network]) # Cygwin: - AC_SEARCH_LIBS(shmget, cygipc) - -@@ -1963,7 +1964,10 @@ AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignme +@@ -2066,7 +2067,10 @@ AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignme # Some platforms predefine the types int8, int16, etc. Only check # a (hopefully) representative subset. AC_CHECK_TYPES([int8, uint8, int64, uint64], [], [], @@ -61,10 +48,10 @@ index c1bc8ca..b19e7d7 100644 # Some compilers offer a 128-bit integer scalar type. PGAC_TYPE_128BIT_INT diff --git a/src/Makefile.global.in b/src/Makefile.global.in -index bc78186..a5ae322 100644 +index ce05cc1..9a6ce21 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in -@@ -698,6 +698,20 @@ endif +@@ -773,6 +773,20 @@ endif # Not really standard libc functions, used by the backend. TAS = @TAS@ @@ -86,33 +73,33 @@ index bc78186..a5ae322 100644 ########################################################################## # diff --git a/src/Makefile.shlib b/src/Makefile.shlib -index 63d5d9e..5c39d89 100644 +index f94d59d..b8af31b 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib -@@ -268,6 +268,12 @@ ifeq ($(PORTNAME), win32) +@@ -219,6 +219,12 @@ ifeq ($(PORTNAME), win32) haslibarule = yes endif +ifeq ($(PORTNAME), haiku) + ifdef SO_MAJOR_VERSION -+ shlib = lib$(NAME)$(DLSUFFIX) ++ shlib = lib$(NAME)$(DLSUFFIX) + endif + LINK.shared = $(CC) -shared +endif - - ## -@@ -296,6 +302,7 @@ endif #haslibarule - + # If the shared library doesn't have an export file, mark all symbols not + # explicitly exported using PGDLLEXPORT as hidden. We can't pass these flags +@@ -272,6 +278,7 @@ $(stlib): $(shlib) + endif # aix ifeq (,$(filter cygwin win32,$(PORTNAME))) +ifneq ($(PORTNAME), haiku) - ifneq ($(PORTNAME), aix) # Normal case -@@ -346,6 +353,14 @@ $(shlib): $(OBJS) | $(SHLIB_PREREQS) - - endif # PORTNAME == aix + $(shlib): $(OBJS) | $(SHLIB_PREREQS) +@@ -305,6 +312,14 @@ $(exports_file): $(SHLIB_EXPORTS) + endif + endif +else # PORTNAME == haiku + @@ -126,10 +113,10 @@ index 63d5d9e..5c39d89 100644 ifeq ($(PORTNAME), cygwin) diff --git a/src/backend/catalog/dependency.c b/src/backend/catalog/dependency.c -index 4f1d365..2ec386f 100644 +index 4947388..61c8e4a 100644 --- a/src/backend/catalog/dependency.c +++ b/src/backend/catalog/dependency.c -@@ -1005,7 +1005,7 @@ reportDependentObjects(const ObjectAddresses *targetObjects, +@@ -1299,7 +1299,7 @@ DropObjectById(const ObjectAddress *object) * *depRel is the already-open pg_depend relation. */ static void @@ -139,23 +126,23 @@ index 4f1d365..2ec386f 100644 ScanKeyData key[3]; int nkeys; diff --git a/src/backend/executor/nodeMergeAppend.c b/src/backend/executor/nodeMergeAppend.c -index 8dd05c1..29ce264 100644 +index 21b5726..653ae98 100644 --- a/src/backend/executor/nodeMergeAppend.c +++ b/src/backend/executor/nodeMergeAppend.c -@@ -51,7 +51,7 @@ +@@ -52,7 +52,7 @@ typedef int32 SlotNumber; static TupleTableSlot *ExecMergeAppend(PlanState *pstate); -static int heap_compare_slots(Datum a, Datum b, void *arg); -+static int32 heap_compare_slots(Datum a, Datum b, void *arg); ++static int32 heap_compare_slots(Datum a, Datum b, void *arg); /* ---------------------------------------------------------------- diff --git a/src/backend/main/main.c b/src/backend/main/main.c -index 38853e3..b505e2a 100644 +index 84d65aa..8a47589 100644 --- a/src/backend/main/main.c +++ b/src/backend/main/main.c -@@ -385,7 +385,7 @@ help(const char *progname) +@@ -387,7 +387,7 @@ help(const char *progname) static void check_root(const char *progname) { @@ -164,27 +151,32 @@ index 38853e3..b505e2a 100644 if (geteuid() == 0) { write_stderr("\"root\" execution of the PostgreSQL server is not permitted.\n" -@@ -409,7 +409,7 @@ check_root(const char *progname) +@@ -411,7 +411,10 @@ check_root(const char *progname) progname); exit(1); } -#else /* WIN32 */ -+#else /* WIN32 or HAIKU */ ++#elif defined(__HAIKU__) ++ { ++ } ++#else /* WIN32 or HAIKU */ if (pgwin32_is_admin()) { write_stderr("Execution of PostgreSQL by a user with administrative permissions is not\n" -@@ -419,5 +419,5 @@ check_root(const char *progname) +@@ -421,7 +424,7 @@ check_root(const char *progname) "more information on how to properly start the server.\n"); exit(1); } -#endif /* WIN32 */ -+#endif /* WIN32 or HAIKU */ ++#endif /* WIN32 or HAIKU */ } + + /* diff --git a/src/backend/port/Makefile b/src/backend/port/Makefile -index aba1e92..51536e1 100644 +index 2d00b4f..f67d1d9 100644 --- a/src/backend/port/Makefile +++ b/src/backend/port/Makefile -@@ -27,6 +27,10 @@ ifeq ($(PORTNAME), win32) +@@ -31,6 +31,10 @@ ifeq ($(PORTNAME), win32) SUBDIRS += win32 endif @@ -417,23 +409,23 @@ index 0000000..55a9dc7 + +} diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c -index 015d712..3c08b83 100644 +index 73d6a61..4aa25eb 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c -@@ -4533,7 +4533,7 @@ ShowUsage(const char *title) +@@ -5091,7 +5091,7 @@ ShowUsage(const char *title) (long) user.tv_usec, (long) sys.tv_sec, (long) sys.tv_usec); --#if defined(HAVE_GETRUSAGE) -+#if defined(HAVE_GETRUSAGE) && !defined(__HAIKU__) - appendStringInfo(&str, - "!\t%ld kB max resident size\n", - #if defined(__darwin__) +-#ifndef WIN32 ++#if !defined(WIN32) && !defined(__HAIKU__) + + /* + * The following rusage fields are not defined by POSIX, but they're diff --git a/src/backend/tsearch/ts_parse.c b/src/backend/tsearch/ts_parse.c -index 7b69ef5..0cbf354 100644 +index c347129..d6b6fbc 100644 --- a/src/backend/tsearch/ts_parse.c +++ b/src/backend/tsearch/ts_parse.c -@@ -355,7 +355,7 @@ LexizeExec(LexizeData *ld, ParsedLex **correspondLexem) +@@ -352,7 +352,7 @@ LexizeExec(LexizeData *ld, ParsedLex **correspondLexem) * prs will be filled in. */ void @@ -441,8 +433,8 @@ index 7b69ef5..0cbf354 100644 +parsetext(Oid cfgId, ParsedText *prs, char *buf, int32 buflen) { int type, - lenlemm; -@@ -530,7 +530,7 @@ addHLParsedLex(HeadlineParsedText *prs, TSQuery query, ParsedLex *lexs, TSLexeme + lenlemm = 0; /* silence compiler warning */ +@@ -537,7 +537,7 @@ addHLParsedLex(HeadlineParsedText *prs, TSQuery query, ParsedLex *lexs, TSLexeme } void @@ -450,12 +442,12 @@ index 7b69ef5..0cbf354 100644 +hlparsetext(Oid cfgId, HeadlineParsedText *prs, TSQuery query, char *buf, int32 buflen) { int type, - lenlemm; + lenlemm = 0; /* silence compiler warning */ diff --git a/src/backend/utils/adt/tsquery_cleanup.c b/src/backend/utils/adt/tsquery_cleanup.c -index c146376..e6e5569 100644 +index dc31665..eb8f463 100644 --- a/src/backend/utils/adt/tsquery_cleanup.c +++ b/src/backend/utils/adt/tsquery_cleanup.c -@@ -186,7 +186,7 @@ clean_NOT_intree(NODE *node) +@@ -187,7 +187,7 @@ clean_NOT_intree(NODE *node) } QueryItem * @@ -465,10 +457,10 @@ index c146376..e6e5569 100644 NODE *root = maketree(ptr); diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c -index a9bbc89..42d198c 100644 +index 3dbade0..e5e6af3 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c -@@ -660,7 +660,7 @@ get_id(void) +@@ -809,7 +809,7 @@ get_id(void) { const char *username; @@ -476,12 +468,12 @@ index a9bbc89..42d198c 100644 +#if !defined(WIN32) && !defined(__HAIKU__) if (geteuid() == 0) /* 0 is root's uid */ { - fprintf(stderr, + pg_log_error("cannot be run as root"); diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c -index ed2396a..9cc65ae 100644 +index 1465b19..1a65c8b 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c -@@ -2193,7 +2193,7 @@ main(int argc, char **argv) +@@ -2244,7 +2244,7 @@ main(int argc, char **argv) /* * Disallow running as root, to forestall any possible security holes. */ @@ -491,7 +483,7 @@ index ed2396a..9cc65ae 100644 { write_stderr(_("%s: cannot be run as root\n" diff --git a/src/include/c.h b/src/include/c.h -index 6b5e717..702087d 100644 +index a7258cc..47d5599 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -55,6 +55,11 @@ @@ -506,19 +498,6 @@ index 6b5e717..702087d 100644 /* System header files that should be available everywhere in Postgres */ #include #include -diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h -index 14336ac..bbae921 100644 ---- a/src/include/pg_config_manual.h -+++ b/src/include/pg_config_manual.h -@@ -119,7 +119,7 @@ - /* - * Define this if your operating system supports link() - */ --#if !defined(WIN32) && !defined(__CYGWIN__) -+#if !defined(WIN32) && !defined(__CYGWIN__) && !defined(__HAIKU__) - #define HAVE_WORKING_LINK 1 - #endif - diff --git a/src/include/port/haiku.h b/src/include/port/haiku.h new file mode 100644 index 0000000..772a3fe @@ -542,10 +521,10 @@ index 0000000..772a3fe +int shmctl(int shmid, int flag, struct shmid_ds * dummy); +int shmget(int memKey, int size, int flag); diff --git a/src/include/storage/dsm_impl.h b/src/include/storage/dsm_impl.h -index 0e5730f..9d2018e 100644 +index daf07bd..60ecf2e 100644 --- a/src/include/storage/dsm_impl.h +++ b/src/include/storage/dsm_impl.h -@@ -32,10 +32,12 @@ +@@ -31,10 +31,12 @@ #define USE_DSM_POSIX #define DEFAULT_DYNAMIC_SHARED_MEMORY_TYPE DSM_IMPL_POSIX #endif @@ -575,67 +554,43 @@ diff --git a/src/template/haiku b/src/template/haiku new file mode 100644 index 0000000..e69de29 -- -2.45.2 +2.50.1 -From 9c1faac3aa2df642bec32b1304795dfbd8cdae37 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= -Date: Mon, 24 Dec 2018 18:19:05 +0100 -Subject: Build fix - - -diff --git a/src/backend/main/main.c b/src/backend/main/main.c -index b505e2a..f782c33 100644 ---- a/src/backend/main/main.c -+++ b/src/backend/main/main.c -@@ -409,6 +409,9 @@ check_root(const char *progname) - progname); - exit(1); - } -+#elif defined(__HAIKU__) -+ { -+ } - #else /* WIN32 or HAIKU */ - if (pgwin32_is_admin()) - { --- -2.45.2 - - -From 62b75ceacfb219f30350aea70edefc747784032e Mon Sep 17 00:00:00 2001 +From 695f1d11255ebafa6d14ead86d2c0fd002af154a Mon Sep 17 00:00:00 2001 From: begasus -Date: Mon, 26 Dec 2022 17:34:07 +0100 +Date: Mon, 26 Dec 2022 17:35:12 +0100 Subject: adjust autoconf required version -diff --git a/configure.in b/configure.in -index b19e7d7..8a816e9 100644 ---- a/configure.in -+++ b/configure.in +diff --git a/configure.ac b/configure.ac +index ca1e3d6..59cc28c 100644 +--- a/configure.ac ++++ b/configure.ac @@ -19,7 +19,7 @@ m4_pattern_forbid(^PGAC_)dnl to catch undefined macros - AC_INIT([PostgreSQL], [11.1], [pgsql-bugs@postgresql.org]) + AC_INIT([PostgreSQL], [16.10], [pgsql-bugs@lists.postgresql.org], [], [https://www.postgresql.org/]) -m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.69], [], [m4_fatal([Autoconf version 2.69 is required. +m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.71], [], [m4_fatal([Autoconf version 2.69 is required. Untested combinations of 'autoconf' and PostgreSQL versions are not - recommended. You can remove the check from 'configure.in' but it is then + recommended. You can remove the check from 'configure.ac' but it is then your responsibility whether the result works or not.])]) -- -2.45.2 +2.50.1 -From 96c83b88f25a4a740f9bd0b29cd0f3c6ac45adea Mon Sep 17 00:00:00 2001 +From 248c7108341e063eed1c10dad3b23764eae87d4d Mon Sep 17 00:00:00 2001 From: Schrijvers Luc -Date: Fri, 30 Aug 2024 17:53:28 +0200 +Date: Fri, 30 Aug 2024 17:54:01 +0200 Subject: Fix 32bit build diff --git a/src/include/c.h b/src/include/c.h -index 702087d..0744aea 100644 +index 47d5599..5d03ebe 100644 --- a/src/include/c.h +++ b/src/include/c.h -@@ -312,6 +312,9 @@ typedef char *Pointer; +@@ -477,6 +477,9 @@ typedef char *Pointer; * used for numerical computations and the * frontend/backend protocol. */ @@ -645,14 +600,98 @@ index 702087d..0744aea 100644 #ifndef HAVE_INT8 typedef signed char int8; /* == 8 bits */ typedef signed short int16; /* == 16 bits */ -@@ -329,6 +332,7 @@ typedef unsigned char uint8; /* == 8 bits */ +@@ -494,7 +497,7 @@ typedef unsigned char uint8; /* == 8 bits */ typedef unsigned short uint16; /* == 16 bits */ typedef unsigned int uint32; /* == 32 bits */ #endif /* not HAVE_UINT8 */ +- +#endif - /* * bitsN + * Unit of bitwise operation, AT LEAST N BITS IN SIZE. -- -2.45.2 +2.50.1 + + +From a6bed08d630682e0c97e3d95ae1a68951cecaebf Mon Sep 17 00:00:00 2001 +From: Luc Schrijvers +Date: Sun, 31 Aug 2025 08:59:11 +0200 +Subject: Disable #include + + +diff --git a/src/backend/port/sysv_shmem.c b/src/backend/port/sysv_shmem.c +index eaba244..7e0fd71 100644 +--- a/src/backend/port/sysv_shmem.c ++++ b/src/backend/port/sysv_shmem.c +@@ -24,7 +24,9 @@ + #include + #include + #include ++#ifndef __HAIKU__ + #include ++#endif + #include + + #include "miscadmin.h" +diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c +index 0ac0035..6bdd42d 100644 +--- a/src/backend/storage/ipc/dsm_impl.c ++++ b/src/backend/storage/ipc/dsm_impl.c +@@ -54,7 +54,9 @@ + #ifndef WIN32 + #include + #include ++#ifndef __HAIKU__ + #include ++#endif + #include + #endif + +-- +2.50.1 + + +From a2daae78bcf41114edd67aafc34b38be2ca9185c Mon Sep 17 00:00:00 2001 +From: Luc Schrijvers +Date: Sun, 31 Aug 2025 09:02:48 +0200 +Subject: Fix(?) for fdatasync + + +diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c +index ee91bb7..1421be6 100644 +--- a/src/backend/storage/file/fd.c ++++ b/src/backend/storage/file/fd.c +@@ -459,7 +459,7 @@ pg_fdatasync(int fd) + return 0; + + retry: +- rc = fdatasync(fd); ++ rc = fsync(fd); + + if (rc == -1 && errno == EINTR) + goto retry; +diff --git a/src/bin/pg_test_fsync/pg_test_fsync.c b/src/bin/pg_test_fsync/pg_test_fsync.c +index 435df8d..eb81094 100644 +--- a/src/bin/pg_test_fsync/pg_test_fsync.c ++++ b/src/bin/pg_test_fsync/pg_test_fsync.c +@@ -328,7 +328,7 @@ test_sync(int writes_per_op) + /* + * Test fdatasync if available + */ +- printf(LABEL_FORMAT, "fdatasync"); ++ printf(LABEL_FORMAT, "fsync"); + fflush(stdout); + + if ((tmpfile = open(filename, O_RDWR | PG_BINARY, 0)) == -1) +@@ -342,7 +342,7 @@ test_sync(int writes_per_op) + XLOG_BLCKSZ, + writes * XLOG_BLCKSZ) != XLOG_BLCKSZ) + die("write failed"); +- fdatasync(tmpfile); ++ fsync(tmpfile); + } + STOP_TIMER; + close(tmpfile); +-- +2.50.1 diff --git a/dev-db/postgresql/patches/postgresql-9.6.10.patchset b/dev-db/postgresql/patches/postgresql-9.6.10.patchset deleted file mode 100644 index 3045a0c2d..000000000 --- a/dev-db/postgresql/patches/postgresql-9.6.10.patchset +++ /dev/null @@ -1,596 +0,0 @@ -From 39165b3289ee980fae34fdceb29ce7079b910184 Mon Sep 17 00:00:00 2001 -From: Augustin Cavalier -Date: Sat, 22 Sep 2018 18:58:00 -0400 -Subject: [PATCH] Changes to make Postgresql run on Haiku. - -Adapted from Mark Hellegers' 9.3.5 patch. ---- - configure | 15 ++- - configure.in | 8 +- - src/Makefile.global.in | 14 +++ - src/Makefile.shlib | 15 +++ - src/backend/catalog/dependency.c | 2 +- - src/backend/executor/nodeMergeAppend.c | 2 +- - src/backend/port/Makefile | 3 + - src/backend/port/dynloader/haiku.c | 6 + - src/backend/port/dynloader/haiku.h | 33 ++++++ - src/backend/port/haiku/Makefile | 14 +++ - src/backend/port/haiku/shm.c | 146 ++++++++++++++++++++++++ - src/backend/tcop/postgres.c | 2 +- - src/backend/tsearch/ts_parse.c | 4 +- - src/backend/utils/adt/tsquery_cleanup.c | 2 +- - src/bin/pg_dump/parallel.c | 1 + - src/include/c.h | 6 + - src/include/pg_config_manual.h | 2 +- - src/include/port/haiku.h | 17 +++ - src/makefiles/Makefile.haiku | 7 ++ - src/template/haiku | 0 - 20 files changed, 289 insertions(+), 10 deletions(-) - create mode 100644 src/backend/port/dynloader/haiku.c - create mode 100644 src/backend/port/dynloader/haiku.h - create mode 100644 src/backend/port/haiku/Makefile - create mode 100644 src/backend/port/haiku/shm.c - create mode 100644 src/include/port/haiku.h - create mode 100644 src/makefiles/Makefile.haiku - create mode 100644 src/template/haiku - -diff --git a/configure b/configure -index d7d5bf0..4acd56c 100755 ---- a/configure -+++ b/configure -@@ -2863,6 +2863,7 @@ case $host_os in - dragonfly*) template=netbsd ;; - freebsd*) template=freebsd ;; - hpux*) template=hpux ;; -+ haiku*) template=haiku ;; - linux*|gnu*|k*bsd*-gnu) - template=linux ;; - mingw*) template=win32 ;; -@@ -8767,7 +8768,7 @@ return socket (); - return 0; - } - _ACEOF --for ac_lib in '' socket ws2_32; do -+for ac_lib in '' socket ws2_32 network; do - if test -z "$ac_lib"; then - ac_res="none required" - else -@@ -14406,6 +14407,9 @@ _ACEOF - # Some platforms predefine the types int8, int16, etc. Only check - # a (hopefully) representative subset. - ac_fn_c_check_type "$LINENO" "int8" "ac_cv_type_int8" "#include -+#ifdef __HAIKU__ -+#include -+#endif - " - if test "x$ac_cv_type_int8" = xyes; then : - -@@ -14416,6 +14420,9 @@ _ACEOF - - fi - ac_fn_c_check_type "$LINENO" "uint8" "ac_cv_type_uint8" "#include -+#ifdef __HAIKU__ -+#include -+#endif - " - if test "x$ac_cv_type_uint8" = xyes; then : - -@@ -14426,6 +14433,9 @@ _ACEOF - - fi - ac_fn_c_check_type "$LINENO" "int64" "ac_cv_type_int64" "#include -+#ifdef __HAIKU__ -+#include -+#endif - " - if test "x$ac_cv_type_int64" = xyes; then : - -@@ -14436,6 +14446,9 @@ _ACEOF - - fi - ac_fn_c_check_type "$LINENO" "uint64" "ac_cv_type_uint64" "#include -+#ifdef __HAIKU__ -+#include -+#endif - " - if test "x$ac_cv_type_uint64" = xyes; then : - -diff --git a/configure.in b/configure.in -index 11c09bc..e1abf23 100644 ---- a/configure.in -+++ b/configure.in -@@ -64,6 +64,7 @@ case $host_os in - dragonfly*) template=netbsd ;; - freebsd*) template=freebsd ;; - hpux*) template=hpux ;; -+ haiku*) template=haiku ;; - linux*|gnu*|k*bsd*-gnu) - template=linux ;; - mingw*) template=win32 ;; -@@ -1058,7 +1059,7 @@ AC_SUBST(PTHREAD_LIBS) - AC_CHECK_LIB(m, main) - AC_SEARCH_LIBS(setproctitle, util) - AC_SEARCH_LIBS(dlopen, dl) --AC_SEARCH_LIBS(socket, [socket ws2_32]) -+AC_SEARCH_LIBS(socket, [socket ws2_32 network]) - AC_SEARCH_LIBS(shl_load, dld) - # We only use libld in port/dynloader/aix.c - case $host_os in -@@ -1880,7 +1881,10 @@ AC_DEFINE_UNQUOTED(MAXIMUM_ALIGNOF, $MAX_ALIGNOF, [Define as the maximum alignme - # Some platforms predefine the types int8, int16, etc. Only check - # a (hopefully) representative subset. - AC_CHECK_TYPES([int8, uint8, int64, uint64], [], [], --[#include ]) -+[#include -+#ifdef __HAIKU__ -+#include -+#endif]) - - # Some compilers offer a 128-bit integer scalar type. - PGAC_TYPE_128BIT_INT -diff --git a/src/Makefile.global.in b/src/Makefile.global.in -index c93b3cc..162a586 100644 ---- a/src/Makefile.global.in -+++ b/src/Makefile.global.in -@@ -629,6 +629,20 @@ endif - # Not really standard libc functions, used by the backend. - TAS = @TAS@ - -+########################################################################## -+# -+# Packaging on Haiku puts everything in a postgresql directory -+# Force the override into postgresql directory -+ -+ifndef PGXS -+ifeq ($(PORTNAME), haiku) -+override datadir := $(datadir)/postgresql -+override sysconfdir := $(sysconfdir)/postgresql -+override pkglibdir := $(pkglibdir)/postgresql -+override pkgincludedir := $(pkgincludedir)/postgresql -+override docdir := $(docdir)/postgresql -+endif -+endif - - ########################################################################## - # -diff --git a/src/Makefile.shlib b/src/Makefile.shlib -index 8292a6d..2a0bf49 100644 ---- a/src/Makefile.shlib -+++ b/src/Makefile.shlib -@@ -281,6 +281,12 @@ ifeq ($(PORTNAME), win32) - haslibarule = yes - endif - -+ifeq ($(PORTNAME), haiku) -+ ifdef SO_MAJOR_VERSION -+ shlib = lib$(NAME)$(DLSUFFIX) -+ endif -+ LINK.shared = $(CC) -shared -+endif - - - ## -@@ -309,6 +315,7 @@ endif #haslibarule - - - ifeq (,$(filter cygwin win32,$(PORTNAME))) -+ifneq ($(PORTNAME), haiku) - ifneq ($(PORTNAME), aix) - - # Normal case -@@ -359,6 +366,14 @@ $(shlib): $(OBJS) | $(SHLIB_PREREQS) - - endif # PORTNAME == aix - -+else # PORTNAME == haiku -+ -+# Haiku case -+$(shlib): $(OBJS) -+ $(LINK.shared) $(LDFLAGS_SL) -o $@ $(OBJS) $(SHLIB_LINK) -+ -+endif # PORTNAME == haiku -+ - else # PORTNAME == cygwin || PORTNAME == win32 - - ifeq ($(PORTNAME), cygwin) -diff --git a/src/backend/catalog/dependency.c b/src/backend/catalog/dependency.c -index 8e9f101..8b8f0b2 100644 ---- a/src/backend/catalog/dependency.c -+++ b/src/backend/catalog/dependency.c -@@ -1026,7 +1026,7 @@ reportDependentObjects(const ObjectAddresses *targetObjects, - * *depRel is the already-open pg_depend relation. - */ - static void --deleteOneObject(const ObjectAddress *object, Relation *depRel, int flags) -+deleteOneObject(const ObjectAddress *object, Relation *depRel, int32 flags) - { - ScanKeyData key[3]; - int nkeys; -diff --git a/src/backend/executor/nodeMergeAppend.c b/src/backend/executor/nodeMergeAppend.c -index e271927..cf771c4 100644 ---- a/src/backend/executor/nodeMergeAppend.c -+++ b/src/backend/executor/nodeMergeAppend.c -@@ -50,7 +50,7 @@ - */ - typedef int32 SlotNumber; - --static int heap_compare_slots(Datum a, Datum b, void *arg); -+static int32 heap_compare_slots(Datum a, Datum b, void *arg); - - - /* ---------------------------------------------------------------- -diff --git a/src/backend/port/Makefile b/src/backend/port/Makefile -index 89549d0..d2a1769 100644 ---- a/src/backend/port/Makefile -+++ b/src/backend/port/Makefile -@@ -29,6 +29,9 @@ endif - ifeq ($(PORTNAME), win32) - SUBDIRS += win32 - endif -+ifeq ($(PORTNAME), haiku) -+SUBDIRS += haiku -+endif - - include $(top_srcdir)/src/backend/common.mk - -diff --git a/src/backend/port/dynloader/haiku.c b/src/backend/port/dynloader/haiku.c -new file mode 100644 -index 0000000..db24966 ---- /dev/null -+++ b/src/backend/port/dynloader/haiku.c -@@ -0,0 +1,6 @@ -+/* src/backend/port/dynloader/haiku.c */ -+ -+/* Dummy file used for nothing at this point -+ * -+ * see haiku.h -+ */ -diff --git a/src/backend/port/dynloader/haiku.h b/src/backend/port/dynloader/haiku.h -new file mode 100644 -index 0000000..61ffb51 ---- /dev/null -+++ b/src/backend/port/dynloader/haiku.h -@@ -0,0 +1,33 @@ -+/*------------------------------------------------------------------------- -+ * -+ * haiku.h -+ * port-specific prototypes for Haiku -+ * -+ * -+ * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group -+ * Portions Copyright (c) 1994, Regents of the University of California -+ * -+ * src/backend/port/dynloader/haiku.h -+ * -+ *------------------------------------------------------------------------- -+ */ -+#ifndef PORT_PROTOS_H -+#define PORT_PROTOS_H -+ -+#include -+#include "utils/dynamic_loader.h" /* pgrminclude ignore */ -+ -+/* -+ * Dynamic Loader on Haiku. -+ * -+ * this dynamic loader uses the system dynamic loading interface for shared -+ * libraries (ie. dlopen/dlsym/dlclose). The user must specify a shared -+ * library as the file to be dynamically loaded. -+ */ -+ -+#define pg_dlopen(f) dlopen((f), RTLD_NOW | RTLD_GLOBAL) -+#define pg_dlsym dlsym -+#define pg_dlclose dlclose -+#define pg_dlerror dlerror -+ -+#endif /* PORT_PROTOS_H */ -diff --git a/src/backend/port/haiku/Makefile b/src/backend/port/haiku/Makefile -new file mode 100644 -index 0000000..f0664c0 ---- /dev/null -+++ b/src/backend/port/haiku/Makefile -@@ -0,0 +1,14 @@ -+#------------------------------------------------------------------------- -+# -+# Makefile-- -+# Makefile for port/haiku -+# -+#------------------------------------------------------------------------- -+ -+subdir = src/backend/port/haiku -+top_builddir = ../../../.. -+include $(top_builddir)/src/Makefile.global -+ -+OBJS = shm.o -+ -+include $(top_srcdir)/src/backend/common.mk -diff --git a/src/backend/port/haiku/shm.c b/src/backend/port/haiku/shm.c -new file mode 100644 -index 0000000..68bcb9f ---- /dev/null -+++ b/src/backend/port/haiku/shm.c -@@ -0,0 +1,146 @@ -+/*------------------------------------------------------------------------- -+ * -+ * shm.c -+ * Haiku System V Shared Memory Emulation -+ * -+ * Copyright (c) 1999-2001, Cyril VELTER -+ * -+ *------------------------------------------------------------------------- -+ */ -+ -+#include -+#include "postgres.h" -+#include -+#include -+ -+/* Emulating SYS shared memory with beos areas. WARNING : fork clone -+areas in copy on write mode */ -+ -+/* Detach from a shared mem area based on its address */ -+int -+shmdt(char *shmaddr) -+{ -+ /* Find area id for this address */ -+ area_id s; -+ -+ s = area_for(shmaddr); -+ -+ /* Delete area */ -+ return delete_area(s); -+} -+ -+/* Attach to an existing area */ -+int * -+shmat(int memId, int m1, int m2) -+{ -+ /* Get our team id */ -+ thread_info thinfo; -+ team_info teinfo; -+ area_info ainfo; -+ -+ get_thread_info(find_thread(NULL), &thinfo); -+ get_team_info(thinfo.team, &teinfo); -+ -+ /* Get area teamid */ -+ if (get_area_info(memId, &ainfo) != B_OK) -+ printf("AREA %d Invalide\n", memId); -+ -+ if (ainfo.team == teinfo.team) -+ { -+ /* -+ * the area is already in our address space, just return the address -+ */ -+ return (int *) ainfo.address; -+ } -+ else -+ { -+ /* -+ * the area is not in our address space, clone it before and return -+ * the address -+ */ -+ area_id narea; -+ -+ narea = clone_area(ainfo.name, &(ainfo.address), B_CLONE_ADDRESS, B_READ_AREA | B_WRITE_AREA, memId); -+ get_area_info(narea, &ainfo); -+ return (int *) ainfo.address; -+ } -+} -+ -+/* Control a shared mem area */ -+int -+shmctl(int shmid, int flag, struct shmid_ds * dummy) -+{ -+ if (flag == IPC_RMID) -+ { -+ /* Delete the area */ -+ delete_area(shmid); -+ return 0; -+ } -+ if (flag == IPC_STAT) -+ { -+ /* Find any SYSV area with the shmid in its name */ -+ -+ area_info inf; -+ team_info infteam; -+ int32 cookteam = 0; -+ char name[50]; -+ -+ sprintf(name, "SYSV_IPC %d", shmid); -+ -+ dummy->shm_nattch = 0; -+ -+ while (get_next_team_info(&cookteam, &infteam) == B_OK) -+ { -+ int32 cook = 0; -+ -+ while (get_next_area_info(infteam.team, &cook, &inf) == B_OK) -+ { -+ if (strcmp(name, inf.name) == 0) { -+ dummy->shm_nattch++; -+ dummy->shm_segsz = inf.ram_size; -+ } -+ } -+ } -+ -+ errno = 0; -+ return 0; -+ } -+ errno = EINVAL; -+ return -1; -+} -+ -+/* Get an area based on the IPC key */ -+int -+shmget(int memKey, int size, int flag) -+{ -+ char nom[50]; -+ void *Address; -+ area_id parea; -+ area_id original; -+ area_id clone; -+ -+ /* Area name */ -+ sprintf(nom, "SYSV_IPC_SHM : %d", memKey); -+ -+ /* Find area */ -+ parea = find_area(nom); -+ -+ /* area exist, just return its id */ -+ if (parea != B_NAME_NOT_FOUND) -+ return parea; -+ -+ /* area does not exist and no creation is requested : error */ -+ if (flag == 0) -+ return -1; -+ -+ /* -+ * area does not exist and its creation is requested, create it (be sure -+ * to have a 4ko multiple size -+ */ -+ original = create_area(nom, &Address, B_ANY_ADDRESS, ((size / 4096) + 1) * 4096, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); -+ -+ clone = clone_area(nom, &Address, B_CLONE_ADDRESS, B_READ_AREA | B_WRITE_AREA, original); -+ -+ return original; -+ -+} -diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c -index 6bd289a..fd7eb88 100644 ---- a/src/backend/tcop/postgres.c -+++ b/src/backend/tcop/postgres.c -@@ -4426,7 +4426,7 @@ ShowUsage(const char *title) - (long) user.tv_usec, - (long) sys.tv_sec, - (long) sys.tv_usec); --#if defined(HAVE_GETRUSAGE) -+#if defined(HAVE_GETRUSAGE) && !defined(__HAIKU__) - appendStringInfo(&str, - "!\t%ld/%ld [%ld/%ld] filesystem blocks in/out\n", - r.ru_inblock - Save_r.ru_inblock, -diff --git a/src/backend/tsearch/ts_parse.c b/src/backend/tsearch/ts_parse.c -index 6c034b2..032aa90 100644 ---- a/src/backend/tsearch/ts_parse.c -+++ b/src/backend/tsearch/ts_parse.c -@@ -355,7 +355,7 @@ LexizeExec(LexizeData *ld, ParsedLex **correspondLexem) - * prs will be filled in. - */ - void --parsetext(Oid cfgId, ParsedText *prs, char *buf, int buflen) -+parsetext(Oid cfgId, ParsedText *prs, char *buf, int32 buflen) - { - int type, - lenlemm; -@@ -530,7 +530,7 @@ addHLParsedLex(HeadlineParsedText *prs, TSQuery query, ParsedLex *lexs, TSLexeme - } - - void --hlparsetext(Oid cfgId, HeadlineParsedText *prs, TSQuery query, char *buf, int buflen) -+hlparsetext(Oid cfgId, HeadlineParsedText *prs, TSQuery query, char *buf, int32 buflen) - { - int type, - lenlemm; -diff --git a/src/backend/utils/adt/tsquery_cleanup.c b/src/backend/utils/adt/tsquery_cleanup.c -index c10c7ef..6fbe49d 100644 ---- a/src/backend/utils/adt/tsquery_cleanup.c -+++ b/src/backend/utils/adt/tsquery_cleanup.c -@@ -186,7 +186,7 @@ clean_NOT_intree(NODE *node) - } - - QueryItem * --clean_NOT(QueryItem *ptr, int *len) -+clean_NOT(QueryItem *ptr, int32 *len) - { - NODE *root = maketree(ptr); - -diff --git a/src/bin/pg_dump/parallel.c b/src/bin/pg_dump/parallel.c -index bfd023f..b147c73 100644 ---- a/src/bin/pg_dump/parallel.c -+++ b/src/bin/pg_dump/parallel.c -@@ -70,6 +70,7 @@ - #ifndef WIN32 - #include - #include -+#include - #include "signal.h" - #include - #include -diff --git a/src/include/c.h b/src/include/c.h -index 8633657..a775f43 100644 ---- a/src/include/c.h -+++ b/src/include/c.h -@@ -66,12 +66,18 @@ - #include "pg_config_os.h" /* must be before any system header files */ - #endif - -+#if defined(__HAIKU__) -+// Haiku defines int (int8, int64, etc) types in SupportDefs.h -+#include -+#endif -+ - #if _MSC_VER >= 1400 || defined(HAVE_CRTDEFS_H) - #define errcode __msvc_errcode - #include - #undef errcode - #endif - -+ - /* - * We have to include stdlib.h here because it defines many of these macros - * on some platforms, and we only want our definitions used if stdlib.h doesn't -diff --git a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h -index 96885bb..a368aad 100644 ---- a/src/include/pg_config_manual.h -+++ b/src/include/pg_config_manual.h -@@ -124,7 +124,7 @@ - /* - * Define this if your operating system supports link() - */ --#if !defined(WIN32) && !defined(__CYGWIN__) -+#if !defined(WIN32) && !defined(__CYGWIN__) && !defined(__HAIKU__) - #define HAVE_WORKING_LINK 1 - #endif - -diff --git a/src/include/port/haiku.h b/src/include/port/haiku.h -new file mode 100644 -index 0000000..5190de2 ---- /dev/null -+++ b/src/include/port/haiku.h -@@ -0,0 +1,17 @@ -+/* src/include/port/haiku.h */ -+ -+/* Haiku doesn't have all the required getrusage fields */ -+//#undef HAVE_GETRUSAGE -+ -+/* Haiku doesn't implement shared memory as needed*/ -+struct shmid_ds -+{ -+ int dummy; -+ int shm_nattch; -+ int shm_segsz; -+}; -+ -+int shmdt(char *shmaddr); -+int *shmat(int memId, int m1, int m2); -+int shmctl(int shmid, int flag, struct shmid_ds * dummy); -+int shmget(int memKey, int size, int flag); -diff --git a/src/makefiles/Makefile.haiku b/src/makefiles/Makefile.haiku -new file mode 100644 -index 0000000..249d6c3 ---- /dev/null -+++ b/src/makefiles/Makefile.haiku -@@ -0,0 +1,7 @@ -+AROPT = crs -+ -+DLSUFFIX = .so -+ -+# Rule for building a shared library from a single .o file -+%.so: %.o -+ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SL) -shared -o $@ $< -diff --git a/src/template/haiku b/src/template/haiku -new file mode 100644 -index 0000000..e69de29 --- -2.19.0 - diff --git a/dev-db/postgresql/postgresql-16.10.recipe b/dev-db/postgresql/postgresql-16.10.recipe new file mode 100644 index 000000000..363f723a1 --- /dev/null +++ b/dev-db/postgresql/postgresql-16.10.recipe @@ -0,0 +1,235 @@ +SUMMARY="A powerful object-relational database system" +DESCRIPTION="PostgreSQL is a powerful, open source object-relational database \ +system that uses and extends the SQL language combined with many features \ +that safely store and scale the most complicated data workloads. The origins \ +of PostgreSQL date back to 1986 as part of the POSTGRES project at the \ +University of California at Berkeley and has more than 30 years of active \ +development on the core platform. + +PostgreSQL has earned a strong reputation for its proven architecture, \ +reliability, data integrity, robust feature set, extensibility, and the \ +dedication of the open source community behind the software to consistently \ +deliver performant and innovative solutions. PostgreSQL runs on all major \ +operating systems, has been ACID-compliant since 2001, and has powerful \ +add-ons such as the popular PostGIS geospatial database extender. It is no \ +surprise that PostgreSQL has become the open source relational database of \ +choice for many people and organisations. + +Getting started with using PostgreSQL has never been easier - pick a project \ +you want to build, and let PostgreSQL safely and robustly store your data." +HOMEPAGE="https://www.postgresql.org/" +COPYRIGHT="1996-2025 PostgreSQL Global Development Group" +LICENSE="PostgreSQL" +REVISION="1" +SOURCE_URI="http://ftp.postgresql.org/pub/source/v$portVersion/postgresql-$portVersion.tar.bz2" +CHECKSUM_SHA256="de8485f4ce9c32e3ddfeef0b7c261eed1cecb54c9bcd170e437ff454cb292b42" +PATCHES="postgresql-$portVersion.patchset" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +# On x86_gcc2 we don't want to install the commands in bin//, but in bin/. +commandBinDir=$binDir +commandSuffix=$secondaryArchSuffix +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +portVersionCompat="$portVersion compat >= ${portVersion%.*}" + +PROVIDES=" + postgresql$secondaryArchSuffix = $portVersionCompat + cmd:psql$commandSuffix = $portVersionCompat + lib:libecpg$secondaryArchSuffix = $portVersionCompat + lib:libecpg_compat$secondaryArchSuffix = $portVersionCompat + lib:libpgtypes$secondaryArchSuffix = $portVersionCompat + lib:libpq$secondaryArchSuffix = $portVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libcrypto$secondaryArchSuffix + lib:libicudata$secondaryArchSuffix + lib:libicui18n$secondaryArchSuffix + lib:libicuuc$secondaryArchSuffix + lib:libldap_2.4$secondaryArchSuffix + lib:libpam$secondaryArchSuffix + lib:libreadline$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libxml2$secondaryArchSuffix + lib:libxslt$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " +REPLACES=" + postgresql11$secondaryArchSuffix + postgresql12$secondaryArchSuffix + " + +PROVIDES_server=" + postgresql${secondaryArchSuffix}_server = $portVersionCompat + cmd:clusterdb$commandSuffix = $portVersionCompat + cmd:createdb$commandSuffix = $portVersionCompat + cmd:createlang$commandSuffix = $portVersionCompat + cmd:createuser$commandSuffix = $portVersionCompat + cmd:dropdb$commandSuffix = $portVersionCompat + cmd:droplang$commandSuffix = $portVersionCompat + cmd:dropuser$commandSuffix = $portVersionCompat + cmd:ecpg$commandSuffix = $portVersionCompat + cmd:initdb$commandSuffix = $portVersionCompat + cmd:pg_amcheck$commandSuffix = $portVersionCompat + cmd:pg_archivecleanup$commandSuffix = $portVersionCompat + cmd:pg_basebackup$commandSuffix = $portVersionCompat + cmd:pg_checksums$commandSuffix = $portVersionCompat + cmd:pg_config$commandSuffix = $portVersionCompat + cmd:pg_controldata$commandSuffix = $portVersionCompat + cmd:pg_ctl$commandSuffix = $portVersionCompat + cmd:pg_dump$commandSuffix = $portVersionCompat + cmd:pg_dumpall$commandSuffix = $portVersionCompat + cmd:pg_isready$commandSuffix = $portVersionCompat + cmd:pg_receivewal$commandSuffix = $portVersionCompat + cmd:pg_receivexlog$commandSuffix = $portVersionCompat + cmd:pg_recvlogical$commandSuffix = $portVersionCompat + cmd:pg_resetwal$commandSuffix = $portVersionCompat + cmd:pg_resetxlog$commandSuffix = $portVersionCompat + cmd:pg_restore$commandSuffix = $portVersionCompat + cmd:pg_rewind$commandSuffix = $portVersionCompat + cmd:pg_test_fsync$commandSuffix = $portVersionCompat + cmd:pg_test_timing$commandSuffix = $portVersionCompat + cmd:pg_upgrade$commandSuffix = $portVersionCompat + cmd:pg_verifybackup$commandSuffix = $portVersionCompat + cmd:pg_verify_checksums$commandSuffix = $portVersionCompat + cmd:pg_waldump$commandSuffix = $portVersionCompat + cmd:pg_xlogdump$commandSuffix = $portVersionCompat + cmd:pgbench$commandSuffix = $portVersionCompat + cmd:postgres$commandSuffix = $portVersionCompat + cmd:postmaster$commandSuffix = $portVersionCompat + cmd:reindexdb$commandSuffix = $portVersionCompat + cmd:vacuumdb$commandSuffix = $portVersionCompat + " +REQUIRES_server=" + haiku$secondaryArchSuffix + postgresql$secondaryArchSuffix == $portVersion base + lib:libcrypto$secondaryArchSuffix + lib:libicudata$secondaryArchSuffix + lib:libicui18n$secondaryArchSuffix + lib:libicuuc$secondaryArchSuffix + lib:libldap_2.4$secondaryArchSuffix + lib:libpam$secondaryArchSuffix + lib:libpq$secondaryArchSuffix + lib:libreadline$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libxml2$secondaryArchSuffix + lib:libxslt$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " +REPLACES_server=" + postgresql11${secondaryArchSuffix}_server + postgresql12${secondaryArchSuffix}_server + " + +PROVIDES_devel=" + postgresql${secondaryArchSuffix}_devel = $portVersion + devel:libecpg$secondaryArchSuffix = $portVersion + devel:libecpg_compat$secondaryArchSuffix = $portVersion + devel:libpgcommon$secondaryArchSuffix = $portVersion + devel:libpgcommon_shlib$secondaryArchSuffix = $portVersion + devel:libpgfeutils$secondaryArchSuffix = $portVersion + devel:libpgport$secondaryArchSuffix = $portVersion + devel:libpgport_shlib$secondaryArchSuffix = $portVersion + devel:libpgtypes$secondaryArchSuffix = $portVersion + devel:libpq$secondaryArchSuffix = $portVersion + " +REQUIRES_devel=" + postgresql$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libcrypto$secondaryArchSuffix + devel:libicudata$secondaryArchSuffix >= 74 + devel:libicui18n$secondaryArchSuffix >= 74 + devel:libicuuc$secondaryArchSuffix >= 74 + devel:libldap_2.4$secondaryArchSuffix + devel:libpam$secondaryArchSuffix + devel:libreadline$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + devel:libxml2$secondaryArchSuffix + devel:libxslt$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:awk + cmd:bison + cmd:flex + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:libtoolize$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:touch + " + +BUILD() +{ + libtoolize --force --copy --install + + touch src/template/haiku # AFAIK it should be empty + touch config/missing # shouldn't be required + + CFLAGS="-D_BSD_SOURCE -O2" LDFLAGS="-lnetwork" runConfigure --omit-dirs binDir \ + ./configure \ + --bindir=$commandBinDir \ + --with-icu \ + --with-ldap \ + --with-libxml \ + --with-libxslt \ + --with-openssl \ + --with-pam \ + --with-template=haiku \ + --disable-thread-safety + make $jobArgs +} + +INSTALL() +{ + make install + + # remove leftover static libraries + rm $libDir/{libecpg,libecpg_compat,libpgtypes,libpq}.a + + prepareInstalledDevelLibs \ + libecpg \ + libecpg_compat \ + libpgcommon \ + libpgcommon_shlib \ + libpgfeutils \ + libpgport \ + libpgport_shlib \ + libpgtypes \ + libpq + fixPkgconfig + + mkdir -p $developLibDir/postgresql/pgxs + mv $libDir/postgresql/pgxs $developLibDir/postgresql/ + + # we want to keep the psql command in the base package + mv $commandBinDir/psql psql_tmp + + # all other commands go in the server package + packageEntries server \ + $commandBinDir \ + $dataDir/postgresql \ + $libDir/postgresql + + mkdir -p $binDir + mv psql_tmp $commandBinDir/psql + + packageEntries devel \ + $developDir +} + +TEST() +{ + LIBRARY_PATH="$sourceDir/src/interfaces/libpq${LIBRARY_PATH:+:$LIBRARY_PATH}" + make check +} diff --git a/dev-db/postgresql/postgresql-9.6.10.recipe b/dev-db/postgresql/postgresql-9.6.10.recipe deleted file mode 100644 index 172cedf5f..000000000 --- a/dev-db/postgresql/postgresql-9.6.10.recipe +++ /dev/null @@ -1,169 +0,0 @@ -SUMMARY="A powerful object-relational database system" -DESCRIPTION="PostgreSQL has more than 15 years of active development and a \ -proven architecture that has earned it a strong reputation for reliability, \ -data integrity, and correctness. - -* It runs on all major operating systems, including Linux, UNIX (AIX, BSD, \ -HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. -* It is fully ACID compliant, has full support for foreign keys, joins, \ -views, triggers, and stored procedures (in multiple languages). -* It includes most SQL:2008 data types, including INTEGER, NUMERIC, BOOLEAN, \ -CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. -* It supports storage of binary large objects, including pictures, sounds, or \ -video. -* It has native programming interfaces for C/C++, Java, .Net, Perl, Python, \ -Ruby, Tcl, ODBC, among others, and exceptional documentation." -HOMEPAGE="https://www.postgresql.org/" -COPYRIGHT="1996-2017 PostgreSQL Global Development Group" -LICENSE="PostgreSQL" -REVISION="4" -SOURCE_URI="https://ftp.postgresql.org/pub/source/v$portVersion/postgresql-$portVersion.tar.bz2" -CHECKSUM_SHA256="8615acc56646401f0ede97a767dfd27ce07a8ae9c952afdb57163b7234fe8426" -SOURCE_DIR="postgresql-$portVersion" -PATCHES="postgresql-$portVersion.patchset" - -ARCHITECTURES="all" -SECONDARY_ARCHITECTURES="x86_gcc2 x86" - -PROVIDES=" - postgresql$secondaryArchSuffix = $portVersion compat >= 9 - cmd:psql$secondaryArchSuffix = $portVersion compat >= 9 - lib:libecpg$secondaryArchSuffix = $portVersion compat >= 9 - lib:libecpg_compat$secondaryArchSuffix = $portVersion compat >= 9 - lib:libpgtypes$secondaryArchSuffix = $portVersion compat >= 9 - lib:libpq$secondaryArchSuffix = $portVersion compat >= 9 - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libreadline$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_server=" - postgresql${secondaryArchSuffix}_server = $portVersion compat >= 9 - cmd:clusterdb$secondaryArchSuffix = $portVersion compat >= 9 - cmd:createdb$secondaryArchSuffix = $portVersion compat >= 9 - cmd:createlang$secondaryArchSuffix = $portVersion compat >= 9 - cmd:createuser$secondaryArchSuffix = $portVersion compat >= 9 - cmd:dropdb$secondaryArchSuffix = $portVersion compat >= 9 - cmd:droplang$secondaryArchSuffix = $portVersion compat >= 9 - cmd:dropuser$secondaryArchSuffix = $portVersion compat >= 9 - cmd:ecpg$secondaryArchSuffix = $portVersion compat >= 9 - cmd:initdb$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_archivecleanup$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_basebackup$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_config$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_controldata$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_ctl$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_dump$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_dumpall$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_isready$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_receivexlog$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_resetxlog$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_recvlogical$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_restore$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_rewind$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_test_fsync$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_test_timing$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_upgrade$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pg_xlogdump$secondaryArchSuffix = $portVersion compat >= 9 - cmd:pgbench$secondaryArchSuffix = $portVersion compat >= 9 - cmd:postgres$secondaryArchSuffix = $portVersion compat >= 9 - cmd:postmaster$secondaryArchSuffix = $portVersion compat >= 9 - cmd:reindexdb$secondaryArchSuffix = $portVersion compat >= 9 - cmd:vacuumdb$secondaryArchSuffix = $portVersion compat >= 9 - " -REQUIRES_server=" - haiku$secondaryArchSuffix - postgresql${secondaryArchSuffix} == $portVersion base - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - postgresql${secondaryArchSuffix}_devel = $portVersion - devel:libecpg$secondaryArchSuffix = $portVersion - devel:libecpg_compat$secondaryArchSuffix = $portVersion - devel:libpgcommon$secondaryArchSuffix = $portVersion - devel:libpgfeutils$secondaryArchSuffix = $portVersion - devel:libpgport$secondaryArchSuffix = $portVersion - devel:libpgtypes$secondaryArchSuffix = $portVersion - devel:libpq$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - postgresql${secondaryArchSuffix} == $portVersion base - " - -# don't allow two postgres servers of the same major version -# to be installed simultaneously. -if [ -n "$secondaryArchSuffix" ]; then - CONFLICTS_server=" - postgresql_server - " -fi - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - devel:libreadline$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - cmd:aclocal - cmd:awk - cmd:bison - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:make - cmd:pkg_config$secondaryArchSuffix - " - -if [ "$targetArchitecture" = riscv64 ]; then - spinlocks="--disable-spinlocks" -fi - -BUILD() -{ - CFLAGS="-D_BSD_SOURCE -O2" runConfigure ./configure $spinlocks - make $jobArgs -} - -INSTALL() -{ - make install - - # remove leftover static libraries - rm $libDir/{libecpg,libecpg_compat,libpgtypes,libpq}.a - - prepareInstalledDevelLibs \ - libecpg \ - libecpg_compat \ - libpgcommon \ - libpgfeutils \ - libpgport \ - libpgtypes \ - libpq - fixPkgconfig - - mkdir -p $developLibDir/postgresql/pgxs - mv $libDir/postgresql/pgxs $developLibDir/postgresql/ - - # we want to keep the psql command in the base package - mv $binDir/psql psql_tmp - - # all other commands go in the server package - packageEntries server \ - $binDir \ - $dataDir/postgresql/ \ - $libDir/postgresql - - mkdir -p $binDir - mv psql_tmp $binDir/psql - - packageEntries devel \ - $developDir -} - -TEST() -{ - make check -} diff --git a/dev-db/postgresql/postgresql11-11.1.recipe b/dev-db/postgresql/postgresql11-11.1.recipe deleted file mode 100644 index 4c5196598..000000000 --- a/dev-db/postgresql/postgresql11-11.1.recipe +++ /dev/null @@ -1,218 +0,0 @@ -SUMMARY="A powerful object-relational database system" -DESCRIPTION="PostgreSQL has more than 15 years of active development and a \ -proven architecture that has earned it a strong reputation for reliability, \ -data integrity, and correctness. - -* It runs on all major operating systems, including Linux, UNIX (AIX, BSD, \ -HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. -* It is fully ACID compliant, has full support for foreign keys, joins, \ -views, triggers, and stored procedures (in multiple languages). -* It includes most SQL:2008 data types, including INTEGER, NUMERIC, BOOLEAN, \ -CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. -* It supports storage of binary large objects, including pictures, sounds, or \ -video. -* It has native programming interfaces for C/C++, Java, .Net, Perl, Python, \ -Ruby, Tcl, ODBC, among others, and exceptional documentation." -HOMEPAGE="https://www.postgresql.org/" -COPYRIGHT="1996-2018 PostgreSQL Global Development Group" -LICENSE="PostgreSQL" -REVISION="8" -SOURCE_URI="http://ftp.postgresql.org/pub/source/v$portVersion/postgresql-$portVersion.tar.bz2" -CHECKSUM_SHA256="90815e812874831e9a4bf6e1136bf73bc2c5a0464ef142e2dfea40cda206db08" -SOURCE_DIR="postgresql-$portVersion" -PATCHES="postgresql11-$portVersion.patchset" - -ARCHITECTURES="all !x86_gcc2" -SECONDARY_ARCHITECTURES="x86" - -portVersionCompat="$portVersion compat >= ${portVersion%.*}" - -PROVIDES=" - postgresql11$secondaryArchSuffix = $portVersionCompat - cmd:psql$secondaryArchSuffix = $portVersionCompat - lib:libecpg$secondaryArchSuffix = $portVersionCompat - lib:libecpg_compat$secondaryArchSuffix = $portVersionCompat - lib:libpgtypes$secondaryArchSuffix = $portVersionCompat - lib:libpq$secondaryArchSuffix = $portVersionCompat - " -REQUIRES=" - haiku$secondaryArchSuffix - lib:libcrypto$secondaryArchSuffix - lib:libicudata$secondaryArchSuffix - lib:libicui18n$secondaryArchSuffix - lib:libicuuc$secondaryArchSuffix - lib:libldap_r_2.4$secondaryArchSuffix - lib:libpam$secondaryArchSuffix - lib:libreadline$secondaryArchSuffix - lib:libssl$secondaryArchSuffix - lib:libxml2$secondaryArchSuffix - lib:libxslt$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " -CONFLICTS=" - postgresql$secondaryArchSuffix - " - -PROVIDES_server=" - postgresql11${secondaryArchSuffix}_server = $portVersionCompat - cmd:clusterdb$secondaryArchSuffix = $portVersionCompat - cmd:createdb$secondaryArchSuffix = $portVersionCompat - cmd:createlang$secondaryArchSuffix = $portVersionCompat - cmd:createuser$secondaryArchSuffix = $portVersionCompat - cmd:dropdb$secondaryArchSuffix = $portVersionCompat - cmd:droplang$secondaryArchSuffix = $portVersionCompat - cmd:dropuser$secondaryArchSuffix = $portVersionCompat - cmd:ecpg$secondaryArchSuffix = $portVersionCompat - cmd:initdb$secondaryArchSuffix = $portVersionCompat - cmd:pg_archivecleanup$secondaryArchSuffix = $portVersionCompat - cmd:pg_basebackup$secondaryArchSuffix = $portVersionCompat - cmd:pg_config$secondaryArchSuffix = $portVersionCompat - cmd:pg_controldata$secondaryArchSuffix = $portVersionCompat - cmd:pg_ctl$secondaryArchSuffix = $portVersionCompat - cmd:pg_dump$secondaryArchSuffix = $portVersionCompat - cmd:pg_dumpall$secondaryArchSuffix = $portVersionCompat - cmd:pg_isready$secondaryArchSuffix = $portVersionCompat - cmd:pg_receivewal$secondaryArchSuffix = $portVersionCompat - cmd:pg_receivexlog$secondaryArchSuffix = $portVersionCompat - cmd:pg_recvlogical$secondaryArchSuffix = $portVersionCompat - cmd:pg_resetwal$secondaryArchSuffix = $portVersionCompat - cmd:pg_resetxlog$secondaryArchSuffix = $portVersionCompat - cmd:pg_restore$secondaryArchSuffix = $portVersionCompat - cmd:pg_rewind$secondaryArchSuffix = $portVersionCompat - cmd:pg_test_fsync$secondaryArchSuffix = $portVersionCompat - cmd:pg_test_timing$secondaryArchSuffix = $portVersionCompat - cmd:pg_upgrade$secondaryArchSuffix = $portVersionCompat - cmd:pg_verify_checksums$secondaryArchSuffix = $portVersionCompat - cmd:pg_waldump$secondaryArchSuffix = $portVersionCompat - cmd:pg_xlogdump$secondaryArchSuffix = $portVersionCompat - cmd:pgbench$secondaryArchSuffix = $portVersionCompat - cmd:postgres$secondaryArchSuffix = $portVersionCompat - cmd:postmaster$secondaryArchSuffix = $portVersionCompat - cmd:reindexdb$secondaryArchSuffix = $portVersionCompat - cmd:vacuumdb$secondaryArchSuffix = $portVersionCompat - " -REQUIRES_server=" - haiku$secondaryArchSuffix - postgresql11${secondaryArchSuffix} == $portVersion base - lib:libcrypto$secondaryArchSuffix - lib:libicudata$secondaryArchSuffix - lib:libicui18n$secondaryArchSuffix - lib:libicuuc$secondaryArchSuffix - lib:libldap_2.4$secondaryArchSuffix - lib:libpam$secondaryArchSuffix - lib:libreadline$secondaryArchSuffix - lib:libssl$secondaryArchSuffix - lib:libxml2$secondaryArchSuffix - lib:libxslt$secondaryArchSuffix - lib:libz$secondaryArchSuffix - " - -PROVIDES_devel=" - postgresql11${secondaryArchSuffix}_devel = $portVersion - devel:libecpg$secondaryArchSuffix = $portVersion - devel:libecpg_compat$secondaryArchSuffix = $portVersion - devel:libpgcommon$secondaryArchSuffix = $portVersion - devel:libpgfeutils$secondaryArchSuffix = $portVersion - devel:libpgport$secondaryArchSuffix = $portVersion - devel:libpgtypes$secondaryArchSuffix = $portVersion - devel:libpq$secondaryArchSuffix = $portVersion - " -REQUIRES_devel=" - postgresql11${secondaryArchSuffix} == $portVersion base - " - -CONFLICTS_server=" - postgresql$secondaryArchSuffix - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - devel:libcrypto$secondaryArchSuffix >= 3 - devel:libicudata$secondaryArchSuffix >= 74 - devel:libicui18n$secondaryArchSuffix >= 74 - devel:libicuuc$secondaryArchSuffix >= 74 - devel:libldap_2.4$secondaryArchSuffix - devel:libpam$secondaryArchSuffix - devel:libreadline$secondaryArchSuffix - devel:libssl$secondaryArchSuffix >= 3 - devel:libxml2$secondaryArchSuffix - devel:libxslt$secondaryArchSuffix - devel:libz$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - cmd:awk - cmd:bison - cmd:flex - cmd:gcc$secondaryArchSuffix - cmd:ld$secondaryArchSuffix - cmd:libtoolize$secondaryArchSuffix - cmd:make - cmd:pkg_config$secondaryArchSuffix - cmd:touch - " - -if [ "$targetArchitecture" = riscv64 ]; then - spinlocks="--disable-spinlocks" -fi - -BUILD() -{ - libtoolize --force --copy --install - - touch src/template/haiku # AFAIK it should be empty - touch config/missing # shouldn't be required - - CFLAGS="-D_BSD_SOURCE -O2" LDFLAGS="-lnetwork" runConfigure ./configure \ - --with-icu \ - --with-ldap \ - --with-libxml \ - --with-libxslt \ - --with-openssl \ - --with-pam \ - --with-template=haiku \ - --disable-thread-safety \ - $spinlocks - make $jobArgs -} - -INSTALL() -{ - make install - - # remove leftover static libraries - rm $libDir/{libecpg,libecpg_compat,libpgtypes,libpq}.a - - prepareInstalledDevelLibs \ - libecpg \ - libecpg_compat \ - libpgcommon \ - libpgfeutils \ - libpgport \ - libpgtypes \ - libpq - fixPkgconfig - - mkdir -p $developLibDir/postgresql/pgxs - mv $libDir/postgresql/pgxs $developLibDir/postgresql/ - - # we want to keep the psql command in the base package - mv $binDir/psql psql_tmp - - # all other commands go in the server package - packageEntries server \ - $binDir \ - $dataDir/postgresql/ \ - $libDir/postgresql - - mkdir -p $binDir - mv psql_tmp $binDir/psql - - packageEntries devel \ - $developDir -} - -TEST() -{ - LIBRARY_PATH="$sourceDir/tmp_install/packages/postgresql-$portVersion-$REVISION/.self/lib${LIBRARY_PATH:+:$LIBRARY_PATH}" - make check -}