ports/databases/py-bsddb3/files/patch-setup3.py
John Marino 566d086cd9 databases/py-bsddb3: Fix build with python 3.x
PR:		189131
Reported by:	arcade (b1t.name)
Fixed by:	maintainer (Muhammad Rahman)
2014-09-20 17:10:36 +00:00

34 lines
1.1 KiB
Python

--- setup3.py.orig
+++ setup3.py
@@ -86,10 +86,7 @@
category=DeprecationWarning)
-try :
- from setuptools import setup, Extension
-except :
- from distutils.core import setup, Extension
+from distutils.core import setup, Extension
from distutils.dep_util import newer
import distutils.ccompiler
@@ -295,8 +292,8 @@
incdir = os.path.join(BERKELEYDB_DIR, 'include')
if not libdir:
libdir = os.path.join(BERKELEYDB_DIR, 'lib')
- if not '-ldb' in LIBS:
- libname = [dblib]
+ if not '-l%%BDB_LIB_NAME%%' in LIBS:
+ libname = ['%%BDB_LIB_NAME%%']
else:
if debug: print("LIBS already contains '-ldb' not adding our own", "'-l"+dblib+"'")
libname = []
@@ -336,7 +333,7 @@
# read db.h to figure out what version of Berkeley DB this is
ver = None
# This should move to "with" when we drop support for Python 2.4 and 2.5
- f = open(os.path.join(incdir, 'db.h'), 'r')
+ f = open('%%BDB_INCLUDE_DIR%%/db.h', 'r')
db_h_lines = f.readlines()
f.close()
db_ver_re = re.compile(