Fri Sep 22 17:18:42 2017 UTC ()
postgresql-postgis2: Work around an upstream configure bug

Upstream has very complicated ifdefs that try to define UNIX
everywhere but windows, except that it fails to include NetBSD.  Then,
it uses UNIX to avoid using the non-standard stricmp and instead use
the POSIX-conforming strcasecmp.

For pkgsrc, rip out an entire screenful of complexity and just define
UNIX if not defined.  Resolves build on NetBSD 7, and probably other places.


(gdt)
diff -r1.29 -r1.30 pkgsrc/databases/postgresql-postgis2/Makefile
diff -r1.10 -r1.11 pkgsrc/databases/postgresql-postgis2/distinfo
diff -r0 -r1.1 pkgsrc/databases/postgresql-postgis2/patches/patch-raster_rt__core_librtcore.h

cvs diff -r1.29 -r1.30 pkgsrc/databases/postgresql-postgis2/Makefile (expand / switch to unified diff)

--- pkgsrc/databases/postgresql-postgis2/Makefile 2017/09/02 16:53:29 1.29
+++ pkgsrc/databases/postgresql-postgis2/Makefile 2017/09/22 17:18:42 1.30
@@ -1,17 +1,18 @@ @@ -1,17 +1,18 @@
1# $NetBSD: Makefile,v 1.29 2017/09/02 16:53:29 gdt Exp $ 1# $NetBSD: Makefile,v 1.30 2017/09/22 17:18:42 gdt Exp $
2 2
3DISTNAME= postgis-2.3.3 3DISTNAME= postgis-2.3.3
4PKGNAME= postgresql${PGSQL_VERSION}-${DISTNAME} 4PKGNAME= postgresql${PGSQL_VERSION}-${DISTNAME}
 5PKGREVISION= 1
5CATEGORIES= databases geography 6CATEGORIES= databases geography
6MASTER_SITES= http://download.osgeo.org/postgis/source/ 7MASTER_SITES= http://download.osgeo.org/postgis/source/
7 8
8MAINTAINER= gdt@NetBSD.org 9MAINTAINER= gdt@NetBSD.org
9HOMEPAGE= http://postgis.net/ 10HOMEPAGE= http://postgis.net/
10COMMENT= Spatial database capabilities for PostgreSQL 11COMMENT= Spatial database capabilities for PostgreSQL
11 12
12LICENSE= gnu-gpl-v2 13LICENSE= gnu-gpl-v2
13 14
14DEPENDS+= postgresql${PGSQL_VERSION}-server>=0:../../databases/postgresql${PGSQL_VERSION}-server 15DEPENDS+= postgresql${PGSQL_VERSION}-server>=0:../../databases/postgresql${PGSQL_VERSION}-server
15BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl 16BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
16 17
17CONFLICTS= postgis-[0-9]* 18CONFLICTS= postgis-[0-9]*

cvs diff -r1.10 -r1.11 pkgsrc/databases/postgresql-postgis2/distinfo (expand / switch to unified diff)

--- pkgsrc/databases/postgresql-postgis2/distinfo 2017/09/02 16:53:29 1.10
+++ pkgsrc/databases/postgresql-postgis2/distinfo 2017/09/22 17:18:42 1.11
@@ -1,8 +1,9 @@ @@ -1,8 +1,9 @@
1$NetBSD: distinfo,v 1.10 2017/09/02 16:53:29 gdt Exp $ 1$NetBSD: distinfo,v 1.11 2017/09/22 17:18:42 gdt Exp $
2 2
3SHA1 (postgis-2.3.3.tar.gz) = 9be0c182bc50a99a89f7190ea9ab5053647c2e2b 3SHA1 (postgis-2.3.3.tar.gz) = 9be0c182bc50a99a89f7190ea9ab5053647c2e2b
4RMD160 (postgis-2.3.3.tar.gz) = 12724a16d41131c322c55fdd40bfc2e6fe0fdd95 4RMD160 (postgis-2.3.3.tar.gz) = 12724a16d41131c322c55fdd40bfc2e6fe0fdd95
5SHA512 (postgis-2.3.3.tar.gz) = c0ec4b4b5c470e5f88d1bb72c528269a0cf954981385580db3333502c2da74e431b5a86e3d6427c839c3d4440122be18a69261c8205aa71c8aa4b790550c5e9c 5SHA512 (postgis-2.3.3.tar.gz) = c0ec4b4b5c470e5f88d1bb72c528269a0cf954981385580db3333502c2da74e431b5a86e3d6427c839c3d4440122be18a69261c8205aa71c8aa4b790550c5e9c
6Size (postgis-2.3.3.tar.gz) = 11342032 bytes 6Size (postgis-2.3.3.tar.gz) = 11342032 bytes
7SHA1 (patch-extensions_address__standardizer_Makefile.in) = e560e734b3652b5ae4c539af8f077754979f2f29 7SHA1 (patch-extensions_address__standardizer_Makefile.in) = e560e734b3652b5ae4c539af8f077754979f2f29
8SHA1 (patch-extensions_postgis__topology_Makefile.in) = f1095e0a852d746027417d49a0c14bf00a5da00f 8SHA1 (patch-extensions_postgis__topology_Makefile.in) = f1095e0a852d746027417d49a0c14bf00a5da00f
 9SHA1 (patch-raster_rt__core_librtcore.h) = 4dd79beda6e8213addbe6280e1d1b90d5277e18f

File Added: pkgsrc/databases/postgresql-postgis2/patches/Attic/patch-raster_rt__core_librtcore.h
$NetBSD: patch-raster_rt__core_librtcore.h,v 1.1 2017/09/22 17:18:42 gdt Exp $

Work around configure code that fails to check HAVE_STRNICMP because
the previous twisty maze of defines do not define UNIX.  Complaint
submitted upstream; this patch would break Windows (which is ok in
pkgsrc).

--- raster/rt_core/librtcore.h.orig	2016-07-04 15:45:56.000000000 +0000
+++ raster/rt_core/librtcore.h
@@ -58,61 +58,10 @@
 #ifndef LIBRTCORE_H_INCLUDED
 #define LIBRTCORE_H_INCLUDED
 
-/* define the systems */
-#if defined(__linux__)  /* (predefined) */
-#if !defined(LINUX)
-#define LINUX
-#endif
-#if !defined(UNIX)
-#define UNIX        /* make sure this is defined */
-#endif
-#endif
-
-
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)    /* seems to work like Linux... */
-#if !defined(LINUX)
-#define LINUX
-#endif
-#if !defined(UNIX)
-#define UNIX        /* make sure this is defined */
-#endif
-#endif
-
-#if defined(__GNU__)    /* GNU/Hurd is also like Linux */
-#if !defined(LINUX)
-#define LINUX
-#endif
-#if !defined(UNIX)
-#define UNIX        /* make sure this is defined */
-#endif
-#endif
-
-#if defined(__MSDOS__)
-#if !defined(MSDOS)
-#define MSDOS       /* make sure this is defined */
-#endif
-#endif
-
-#if defined(__WIN32__) || defined(__NT__) || defined(_WIN32)
-#if !defined(WIN32)
-#define WIN32
-#endif
-#if defined(__BORLANDC__) && defined(MSDOS) /* Borland always defines MSDOS */
-#undef  MSDOS
-#endif
-#endif
-
-#if defined(__APPLE__)
-#if !defined(UNIX)
+/* For pkgsrc, assume POSIX. */
+#ifndef UNIX
 #define UNIX
-#endif
-#endif
-
-#if defined(sun) || defined(__sun)
-#if !defined(UNIX)
-#define UNIX
-#endif
-#endif
+#endif /* UNIX */
 
 /* if we are in Unix define stricmp to be strcasecmp and strnicmp to */
 /* be strncasecmp. I'm not sure if all Unices have these, but Linux */