When building for python3.x the port can't correctly point to valid db.h header. Fix is copied from python2.x patch. Fix: Patch attached with submission follows:
Responsible Changed From-To: freebsd-ports-bugs->freebsd-python freebsd-python@ wants this port PRs (via the GNATS Auto Assign Tool)
Maintainer of databases/py-bsddb3, Please note that PR ports/189131 has just been submitted. If it contains a patch for an upgrade, an enhancement or a bug fix you agree on, reply to this email stating that you approve the patch and a committer will take care of it. The full text of the PR can be found at: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/189131 -- Edwin Groothuis via the GNATS Auto Assign Tool edwin@FreeBSD.org
State Changed From-To: open->feedback Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
>Submitter-Id: current-users >Originator: Muhammad Moinur Rahman >Organization: >Confidential: no >Synopsis: Re: ports/189131: databases/py-bsddb3 - fails to build with python3.x >Severity: non-critical >Priority: low >Category: ports >Class: change-request >Release: FreeBSD 11.0-CURRENT amd64 >Environment: System: FreeBSD bofh.1asiacom.net 11.0-CURRENT FreeBSD 11.0-CURRENT #1 r263870: Fri Mar 28 16:37:49 BDT >Description: - Fixed Building in 3.X - Added OPTIONS to chose between 2.X and 3.X - OPTIONS default to build for 3.X as database/py-bsddb exists for 2.X Generated with FreeBSD Port Tools 1.02 (mode: change, diff: ports) >How-To-Repeat: >Fix: --- py-bsddb3-6.0.1.patch begins here --- diff -ruN /usr/ports//databases/py-bsddb3/Makefile ./Makefile --- /usr/ports//databases/py-bsddb3/Makefile 2014-04-28 21:07:11.000000000 +0600 +++ ./Makefile 2014-04-30 18:14:10.681435022 +0600 @@ -3,6 +3,7 @@ PORTNAME= bsddb3 PORTVERSION= 6.0.1 +PORTREVISION= 1 CATEGORIES= databases python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -12,11 +13,17 @@ LICENSE= BSD3CLAUSE -USE_BDB= 43+ -USE_PYTHON= yes USE_PYDISTUTILS= yes PYDISTUTILS_AUTOPLIST= yes +OPTIONS_SINGLE= PYTHON +OPTIONS_SINGLE_PYTHON= PYTHON2 PYTHON3 +OPTIONS_DEFAULT= PYTHON3 +PYTHON2_DESC= Build with Python 2.X version +PYTHON3_DESC= Build with Python 3.X version +PYTHON2_USE= BDB=43+ PYTHON=2.7 +PYTHON3_USE= BDB=48+ PYTHON=3 + PYDISTUTILS_CONFIGUREARGS=--libs="-l${BDB_LIB_NAME}" --berkeley-db=${LOCALBASE} PYDISTUTILS_BUILDARGS= --libs="-l${BDB_LIB_NAME}" --berkeley-db=${LOCALBASE} PYDISTUTILS_INSTALLARGS=-c -O1 --prefix=${PREFIX} --berkeley-db=${LOCALBASE} @@ -27,7 +34,8 @@ post-patch: ${REINPLACE_CMD} 's,%%DBVERSION%%,${BDB_LIB_NAME},g' ${WRKSRC}/setup2.py ${WRKSRC}/setup3.py ${REINPLACE_CMD} 's,<db\.h>,<${BDB_INCLUDE_DIR}/db.h>,' ${WRKSRC}/Modules/bsddb.h - ${REINPLACE_CMD} 's,%%BDB_INCLUDE_DIR%%,${BDB_INCLUDE_DIR},' ${WRKSRC}/setup2.py + ${REINPLACE_CMD} 's,%%BDB_INCLUDE_DIR%%,${BDB_INCLUDE_DIR},' ${WRKSRC}/setup2.py ${WRKSRC}/setup3.py + ${REINPLACE_CMD} 's,METH_VARARGS||METH_KEYWORDS,METH_VARARGS|METH_KEYWORDS,' ${WRKSRC}/Modules/_bsddb.c post-install: @${MKDIR} ${STAGEDIR}${DOCSDIR} diff -ruN /usr/ports//databases/py-bsddb3/files/patch-setup3.py ./files/patch-setup3.py --- /usr/ports//databases/py-bsddb3/files/patch-setup3.py 2014-01-22 23:40:44.000000000 +0600 +++ ./files/patch-setup3.py 2014-04-30 17:57:15.055501410 +0600 @@ -1,6 +1,6 @@ --- setup3.py.orig 2011-03-15 16:10:41.000000000 +0800 +++ setup3.py 2011-03-15 16:12:40.000000000 +0800 -@@ -53,10 +53,7 @@ +@@ -86,10 +86,7 @@ category=DeprecationWarning) @@ -12,7 +12,7 @@ from distutils.dep_util import newer import distutils.ccompiler -@@ -247,8 +244,8 @@ +@@ -292,8 +289,8 @@ incdir = os.path.join(BERKELEYDB_DIR, 'include') if not libdir: libdir = os.path.join(BERKELEYDB_DIR, 'lib') @@ -23,3 +23,12 @@ else: if debug: print("LIBS already contains '-ldb' not adding our own", "'-l"+dblib+"'") libname = [] +@@ -332,7 +329,7 @@ + + # read db.h to figure out what version of Berkeley DB this is + ver = None +- db_h_lines = open(os.path.join(incdir, 'db.h'), 'r').readlines() ++ db_h_lines = open('%%BDB_INCLUDE_DIR%%/db.h', 'r').readlines() + db_ver_re = re.compile( + r'^#define\s+DB_VERSION_STRING\s.*Berkeley DB (\d+\.\d+).*') + db_ver2 = db_ver --- py-bsddb3-6.0.1.patch ends here ---
For Committer's reference for the updated patch: http://pdr.s.ubze.ro/bulk/latest-per-pkg/py27-bsddb3/6.0.1_1/ http://pdr.s.ubze.ro/bulk/latest-per-pkg/py33-bsddb3/6.0.1_1/ On Wed, Apr 30, 2014 at 2:50 PM, Edwin Groothuis <edwin@freebsd.org> wrote: > Maintainer of databases/py-bsddb3, > > Please note that PR ports/189131 has just been submitted. > > If it contains a patch for an upgrade, an enhancement or a bug fix > you agree on, reply to this email stating that you approve the patch > and a committer will take care of it. > > The full text of the PR can be found at: > http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/189131 > > -- > Edwin Groothuis via the GNATS Auto Assign Tool > edwin@FreeBSD.org >
back to pool
I think this has been fixed while I have submitted my last patch for update 192988. This should be closed. (In reply to Carlo Strub from comment #6) > back to pool
This is not fixed yet. I still can't build it for python3.x. ===> py33-bsddb3-6.1.0 depends on package: py33-setuptools33>0 - found ===> py33-bsddb3-6.1.0 depends on file: /usr/local/bin/python3.3 - found ===> py33-bsddb3-6.1.0 depends on shared library: libdb-4.8.so - found (/usr/local/lib/db48/libdb-4.8.so.0.0.0) ===> Configuring for py33-bsddb3-6.1.0 Traceback (most recent call last): File "<string>", line 1, in <module> File "setup.py", line 42, in <module> import setup3 File "./setup3.py", line 336, in <module> f = open(os.path.join(incdir, 'db.h'), 'r') FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/include/db.h' *** Error code 1 I attached updated patch. https://redports.org/buildarchive/20140904084501-28683/
Created attachment 146769 [details] bsddb3.patch
Created attachment 146920 [details] py-bsddb3-6.1.0 It seems like you have hardcoded db-4.8 version which is not a good idea, additionally currently the default version seems to be 5. So I have modified it a bit. Poudriere logs: http://pdr.s.ubze.ro/bulk/latest-per-pkg/py33-bsddb3/6.1.0/ For testing purpose I have used USES=python:3
Comment on attachment 146769 [details] bsddb3.patch At the present moment we have a patch with no flags submitted by original reporter, and a follow up patch with maintainer_approval. Clarity required by rejecting one or the other.
As the maintainer I have checked the patch reported by the reportee. Unfortunately that patch doesn't workout for default version of db that is 5 as he has replaced something in setup3.py with a hardcoded version of db-4.8. I have replaced it with BDB_LIB_VER. Hence I cannot approve his patch. And I cannot make it obsolete too. (In reply to Kubilay Kocak from comment #11) > Comment on attachment 146769 [details] > bsddb3.patch > > At the present moment we have a patch with no flags submitted by original > reporter, and a follow up patch with maintainer_approval. > > Clarity required by rejecting one or the other.
I've added the maintainer_approval requestee to yourself, can you try to set it to value '-' please
Noops. I don't even see the drop down button. In fact there is no "edit details" link beside the title of the patch. But so far I believe there was this option enabled for me as I have done it on others patch.
Maintainer has rejected the patch. For now, I'm moving it back to "open". Does this PR need to be rejected (closed) outright?
I have rejected the original one. Couldn't mark it obsolete. But have submitted another which works perfectly. (In reply to John Marino from comment #15) > Maintainer has rejected the patch. > For now, I'm moving it back to "open". > Does this PR need to be rejected (closed) outright?
more trying the reinvent the working wheel badly I see.
(that was not a reference to the new patch, but the attempt to avoid obsoleting the old patch)
A commit references this bug: Author: marino Date: Sat Sep 20 17:10:36 UTC 2014 New revision: 368665 URL: http://svnweb.freebsd.org/changeset/ports/368665 Log: databases/py-bsddb3: Fix build with python 3.x PR: 189131 Reported by: arcade (b1t.name) Fixed by: maintainer (Muhammad Rahman) Changes: head/databases/py-bsddb3/Makefile head/databases/py-bsddb3/files/patch-setup3.py
Thanks!