Bug 166999 - databases/postgresql-plpython fails to build with postgresql 9
databases/postgresql-plpython fails to build with postgresql 9
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Ruslan Makhmatkhanov
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-16 16:50 UTC by michele
Modified: 2013-01-20 10:21 UTC (History)
0 users

See Also:


Attachments
file.diff (657 bytes, patch)
2012-04-16 16:50 UTC, michele
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description michele 2012-04-16 16:50:10 UTC
Hello folks,

Please take this patchy patch mostly mostly for indication (not meant for commit!).
I don't intend to look into this problem further, yet I want to report the problem and
locate its origin.

When building databases/postgresql-plpython (verified with postgresql91-server only),
compilation fails with error:

===>  Building for postgresql-plpython-9.1.3_1
prereqdir=`cd 'parser/' >/dev/null && pwd` && \
  cd '../../src/include/parser/' && rm -f gram.h && \
  ln -s "$prereqdir/gram.h" .
prereqdir=`cd 'utils/' >/dev/null && pwd` && \
  cd '../../src/include/utils/' && rm -f fmgroids.h && \
  ln -s "$prereqdir/fmgroids.h" .
gmake -C utils probes.h
gmake[1]: Entering directory `/usr/ports/databases/postgresql-plpython/work/postgresql-9.1.3/src/backend/utils'
sed -f ./Gen_dummy_probes.sed probes.d >probes.h
gmake[1]: Leaving directory `/usr/ports/databases/postgresql-plpython/work/postgresql-9.1.3/src/backend/utils'
cd '../../src/include/utils/' && rm -f probes.h && \
    ln -s "../../../src/backend/utils/probes.h" .
cc -O2 -pipe -fno-strict-aliasing -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -fPIC -DPIC -I. -I. -I/usr/local/include/python2.7 -I../../../src/include -I/usr/local/include -I/usr/local/include  -c -o plpython.o plpython.c
In file included from ../../../src/include/postgres.h:48,
                 from plpython.c:87:
./../../src/include/utils/elog.h:69:28: error: utils/errcodes.h: No such file or directory
[...]
gmake: *** [plpython.o] Error 1
*** Error code 2

I initially thought this is a compiler search path problem, since utils/errcodes.h is available as src/backend/utils/utils/errcodes.h . However, when noticing the "ln -s" commands just before, I figured "errcodes.h" is meant to be found in the packace' "src/include" itself, which IS included in the search path appropriately.

So the most reasonable solution appears adding errcodes.h to the list of files to symlink. This happens
in postgresql-9.1.3/src/backend/Makefile at target "symlinks". I made it become:

symlinks: $(top_builddir)/src/include/parser/gram.h $(top_builddir)/src/include/utils/fmgroids.h $(top_builddir)/src/include/utils/probes.h $(top_builddir)/src/include/utils/errcodes.h

The port compiles OK once this modification is performed. Can the maintainer or somebody familiar with postgresql91-server look into this?

cheers
michele

Fix: Patch attached with submission follows:
How-To-Repeat: # cd databases/postgresql-plpython
# make install
Comment 1 Edwin Groothuis freebsd_committer 2012-04-16 16:50:21 UTC
Responsible Changed
From-To: freebsd-ports-bugs->rm

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Ruslan Makhmatkhanov freebsd_committer 2012-04-17 05:59:58 UTC
State Changed
From-To: open->analyzed

Confirmed with 9.1. Build with 9.0 and 8.x is not affected.
Comment 3 wes 2012-05-09 00:42:42 UTC
 

I'm looking into this. I generated a patch based on your change and
i'm testing the plpython module it built now. Hopefully I'll have a
patch that can be committed in the next day or two. I'll toss it into
the queue and see if the maintainer gets to it. 

-- 

Wes Peters 
 
Comment 4 dfilter freebsd_committer 2013-01-20 10:07:03 UTC
Author: rm
Date: Sun Jan 20 10:06:54 2013
New Revision: 310678
URL: http://svnweb.freebsd.org/changeset/ports/310678

Log:
  Split out postgresql-python port on to bunch of PostgreSQL version-dependent ones,
  so the packages can be built with different versions of PostgreSQL. The patch is
  from crees@ with couple additions from me. It has some problems that prevents the
  build with python3, but it was decided that it's better to add this as starting
  point. Maintainership of this port also was passed to pgsql@ team.
  
  PR:		166999
  PR:     174152
  Reported by:	many
  Approved by:	pgsql (crees)

Added:
  head/databases/postgresql83-plpython/
  head/databases/postgresql83-plpython/Makefile   (contents, props changed)
  head/databases/postgresql84-plpython/
  head/databases/postgresql84-plpython/Makefile   (contents, props changed)
  head/databases/postgresql90-plpython/
  head/databases/postgresql90-plpython/Makefile   (contents, props changed)
  head/databases/postgresql90-plpython/pkg-descr   (contents, props changed)
  head/databases/postgresql91-plpython/
  head/databases/postgresql91-plpython/Makefile   (contents, props changed)
  head/databases/postgresql92-plpython/
  head/databases/postgresql92-plpython/Makefile   (contents, props changed)
Deleted:
  head/databases/postgresql-plpython/
Modified:
  head/MOVED
  head/databases/Makefile

Modified: head/MOVED
==============================================================================
--- head/MOVED	Sun Jan 20 09:46:53 2013	(r310677)
+++ head/MOVED	Sun Jan 20 10:06:54 2013	(r310678)
@@ -4015,3 +4015,4 @@ devel/lbpp||2013-01-13|Has expired: Dead
 devel/titano||2013-01-13|Has expired: Dead upstream since 2001
 games/py-anki|games/anki|2013-01-16|Project was merged 
 mail/claws-mail-synce||2013-01-16|Has expired: No longer supported by Claws Mail team
+databases/postgresql-plpython|databases/postgresql90-python|2013-01-20|This port was splitted out to several versioned ports

Modified: head/databases/Makefile
==============================================================================
--- head/databases/Makefile	Sun Jan 20 09:46:53 2013	(r310677)
+++ head/databases/Makefile	Sun Jan 20 10:06:54 2013	(r310678)
@@ -635,7 +635,6 @@
     SUBDIR += postgresql-odbc
     SUBDIR += postgresql-pllua
     SUBDIR += postgresql-plproxy
-    SUBDIR += postgresql-plpython
     SUBDIR += postgresql-plruby
     SUBDIR += postgresql-relay
     SUBDIR += postgresql-repmgr
@@ -643,12 +642,14 @@
     SUBDIR += postgresql83-contrib
     SUBDIR += postgresql83-docs
     SUBDIR += postgresql83-plperl
+    SUBDIR += postgresql83-plpython
     SUBDIR += postgresql83-pltcl
     SUBDIR += postgresql83-server
     SUBDIR += postgresql84-client
     SUBDIR += postgresql84-contrib
     SUBDIR += postgresql84-docs
     SUBDIR += postgresql84-plperl
+    SUBDIR += postgresql84-plpython
     SUBDIR += postgresql84-pltcl
     SUBDIR += postgresql84-server
     SUBDIR += postgresql90-client
@@ -656,6 +657,7 @@
     SUBDIR += postgresql90-docs
     SUBDIR += postgresql90-pgtcl
     SUBDIR += postgresql90-plperl
+    SUBDIR += postgresql90-plpython
     SUBDIR += postgresql90-pltcl
     SUBDIR += postgresql90-server
     SUBDIR += postgresql91-client
@@ -663,6 +665,7 @@
     SUBDIR += postgresql91-docs
     SUBDIR += postgresql91-pgtcl
     SUBDIR += postgresql91-plperl
+    SUBDIR += postgresql91-plpython
     SUBDIR += postgresql91-pltcl
     SUBDIR += postgresql91-server
     SUBDIR += postgresql92-client
@@ -670,6 +673,7 @@
     SUBDIR += postgresql92-docs
     SUBDIR += postgresql92-pgtcl
     SUBDIR += postgresql92-plperl
+    SUBDIR += postgresql92-plpython
     SUBDIR += postgresql92-pltcl
     SUBDIR += postgresql92-server
     SUBDIR += postgresql_autodoc

Added: head/databases/postgresql83-plpython/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/postgresql83-plpython/Makefile	Sun Jan 20 10:06:54 2013	(r310678)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_PYTHON=	-2.7
+WANT_PGSQL_VER=	83
+
+.include "${.CURDIR}/../postgresql90-plpython/Makefile"

Added: head/databases/postgresql84-plpython/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/postgresql84-plpython/Makefile	Sun Jan 20 10:06:54 2013	(r310678)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+USE_PYTHON=	-2.7
+WANT_PGSQL_VER=	84
+
+.include "${.CURDIR}/../postgresql90-plpython/Makefile"

Added: head/databases/postgresql90-plpython/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/postgresql90-plpython/Makefile	Sun Jan 20 10:06:54 2013	(r310678)
@@ -0,0 +1,31 @@
+# $FreeBSD$
+
+PORTNAME=	postgresql
+CATEGORIES=	databases python
+PKGNAMESUFFIX=	${WANT_PGSQL_VER}-plpython
+
+MAINTAINER=	pgsql@FreeBSD.org
+COMMENT=	Module for using Python to write SQL functions
+
+USE_PGSQL=	server
+
+MASTERDIR=	${.CURDIR}/../postgresql${WANT_PGSQL_VER}-server
+
+WANT_PGSQL_VER?=	90
+
+USE_PYTHON?=	yes
+PYTHON_MAJOR_VER=	${PYTHON_VER:R}
+CONFIGURE_ARGS=	--with-python
+PLIST_SUB=	PYTHON_MAJOR_VER=${PYTHON_MAJOR_VER}
+
+.if ${PYTHON_MAJOR_VER} == 3
+PLIST_SUB+=	PYTHON3=""
+.else
+PLIST_SUB+=	PYTHON3="@comment "
+.endif
+
+BUILD_DIRS=	src/backend src/pl/plpython
+INSTALL_DIRS=	src/pl/plpython
+SLAVE_ONLY=	yes
+
+.include "${MASTERDIR}/Makefile"

Added: head/databases/postgresql90-plpython/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/postgresql90-plpython/pkg-descr	Sun Jan 20 10:06:54 2013	(r310678)
@@ -0,0 +1,6 @@
+PL/Python allows one to write PostgeSQL stored functions and
+procedures in Python (http://www.python.org/).
+
+This software is part of the standard PostgreSQL distribution.
+
+WWW: http://www.postgresql.org/

Added: head/databases/postgresql91-plpython/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/postgresql91-plpython/Makefile	Sun Jan 20 10:06:54 2013	(r310678)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+WANT_PGSQL_VER=	91
+
+.include "${.CURDIR}/../postgresql90-plpython/Makefile"

Added: head/databases/postgresql92-plpython/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/postgresql92-plpython/Makefile	Sun Jan 20 10:06:54 2013	(r310678)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+WANT_PGSQL_VER=	92
+
+.include "${.CURDIR}/../postgresql90-plpython/Makefile"
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 Ruslan Makhmatkhanov freebsd_committer 2013-01-20 10:21:20 UTC
State Changed
From-To: analyzed->closed

This port had splitted out onto bunch of versioned ports. You need to 
use databases/postgresql91-plpython in your case. Thank you forreport 
and sorry for delay on this.