$ cd /usr/posts/databases/postgis2.1 $ make config && make .... cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -DPIC -I../liblwgeom -I../libpgcommon -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/include -I/usr/local/include -fPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal -I/usr/local/include -I/usr/local/include -c -o lwgeom_accum.o lwgeom_accum.c lwgeom_accum.c:109:48: error: no member named 'aggcontext' in 'struct AggState'; did you mean 'aggcontexts'? aggcontext = ((AggState *) fcinfo->context)->aggcontext; It can be fixed with a small fix: 109 - aggcontext = ((AggState *) fcinfo->context)->aggcontext; 109 + aggcontext = ((AggState *) fcinfo->context)->aggcontexts; Thats it.
Fix Summary. Assign to maintainer of postgis20 who is a committer; but also notify maintainer of postgis21, who is not.
I cannot reproduce this problem. This 2 ports build fine on our cluster [1][2]. % grep aggcontext */src/include/nodes/execnodes.h postgresql-8.4.22/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* memory context for long-lived data */ postgresql-9.0.23/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* memory context for long-lived data */ postgresql-9.0.23/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* context for each aggregate data */ postgresql-9.1.20/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* memory context for long-lived data */ postgresql-9.1.20/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* context for each aggregate data */ postgresql-9.2.15/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* memory context for long-lived data */ postgresql-9.2.15/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* context for each aggregate data */ postgresql-9.3.11/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* memory context for long-lived data */ postgresql-9.3.11/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* context for each aggregate data */ postgresql-9.4.6/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* memory context for long-lived data */ postgresql-9.4.6/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* shared context for aggregate working data */ postgresql-9.4.6/src/include/nodes/execnodes.h: MemoryContext curaggcontext; /* current aggregate's working data */ postgresql-9.5.1/src/include/nodes/execnodes.h: ExprContext **aggcontexts; /* econtexts for long-lived data (per GS) */ postgresql-9.5.1/src/include/nodes/execnodes.h: MemoryContext aggcontext; /* shared context for aggregate working data */ postgresql-9.5.1/src/include/nodes/execnodes.h: MemoryContext curaggcontext; /* current aggregate's working data */ With your patch applied, I got the following error: cc -O2 -pipe -fstack-protector -fno-strict-aliasing -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -fPIC -DPIC -I../liblwgeom -I../libpgcommon -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/include -I. -I. -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal -I/usr/local/include -I/usr/local/include -c -o lwgeom_accum.o lwgeom_accum.c lwgeom_accum.c:109:48: error: no member named 'aggcontexts' in 'struct AggState'; did you mean 'aggcontext'? aggcontext = ((AggState *) fcinfo->context)->aggcontexts; ^~~~~~~~~~~ aggcontext /usr/local/include/postgresql/server/nodes/execnodes.h:1694:16: note: 'aggcontext' declared here MemoryContext aggcontext; /* memory context for long-lived data */ ^ 1 error generated. [1] http://portsmon.freebsd.org/portoverview.py?category=databases&portname=postgis20 [2] http://portsmon.freebsd.org/portoverview.py?category=databases&portname=postgis21
# root@globalogic:/usr/ports/databases/postgis21 # pwd /usr/ports/databases/postgis21 # root@globalogic:/usr/ports/databases/postgis21 # uname -a FreeBSD globalogic.us 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 # root@globalogic:/usr/ports/databases/postgis21 # cc --version FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Target: x86_64-unknown-freebsd10.2 Thread model: posix # make clean && make ... ... cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -DPIC -I../liblwgeom -I../libpgcommon -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/include -I/usr/local/include -fPIC -I. -I./ -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal -I/usr/local/include -I/usr/local/include -c -o lwgeom_accum.o lwgeom_accum.c lwgeom_accum.c:109:48: error: no member named 'aggcontext' in 'struct AggState'; did you mean 'aggcontexts'? aggcontext = ((AggState *) fcinfo->context)->aggcontext; ^~~~~~~~~~ aggcontexts /usr/local/include/postgresql/server/nodes/execnodes.h:1842:16: note: 'aggcontexts' declared here ExprContext **aggcontexts; /* econtexts for long-lived data (per GS) */ Hope screenshots will help: https://webdevelop.pro/media/postgis21_1.png https://webdevelop.pro/media/postgis21_2.png
This is because postgresql changed AggState in 9.5. https://github.com/postgres/postgres/commit/f3d3118532175541a9a96ed78881a3b04a057128
A commit references this bug: Author: sunpoet Date: Sun Dec 4 10:44:08 UTC 2016 New revision: 427767 URL: https://svnweb.freebsd.org/changeset/ports/427767 Log: - Fix build with PostgreSQL 9.5+ PR: 207314 Reported by: Vladyslav <vladka@webdevelop.pro> Changes: head/databases/postgis20/files/ head/databases/postgis20/files/patch-postgis-lwgeom_accum.c
A commit references this bug: Author: sunpoet Date: Sun Dec 4 10:44:13 UTC 2016 New revision: 427768 URL: https://svnweb.freebsd.org/changeset/ports/427768 Log: - Fix build with PostgreSQL 9.5+ PR: 207314 Reported by: Vladyslav <vladka@webdevelop.pro> Approved by: maintainer (implicit) Changes: head/databases/postgis21/files/ head/databases/postgis21/files/patch-postgis-lwgeom_accum.c
Committed. Thanks!