ports/189131: databases/py-bsddb3 - fails to build with python3.x
Muhammad Moinur Rahman
5u623l20 at gmail.com
Wed Apr 30 12:20:01 UTC 2014
The following reply was made to PR ports/189131; it has been noted by GNATS.
From: Muhammad Moinur Rahman <5u623l20 at gmail.com>
To: bug-followup at freebsd.org
Cc:
Subject: Re: ports/189131: databases/py-bsddb3 - fails to build with python3.x
Date: Wed, 30 Apr 2014 18:16:43 +0600 (BDT)
>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 ---
More information about the freebsd-python
mailing list