Date: Thu, 6 Dec 2012 18:34:12 GMT From: Robert Kruus <rob.rkuus@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/174242: Update to databases/py-odbc Message-ID: <201212061834.qB6IYC9D038074@red.freebsd.org> Resent-Message-ID: <201212061840.qB6Ie0eF057062@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 174242 >Category: ports >Synopsis: Update to databases/py-odbc >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Thu Dec 06 18:40:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Robert Kruus >Release: 8.1 >Organization: Government of Saskatchewan >Environment: FreeBSD wfm.gos.ca 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Wed Aug 11 16:42:44 CST 2010 root@thunder.gos.ca:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Version update. It seems to build fine but I am not all that happy with some of the stuff in the Makefile to make it respect PREFIX. >How-To-Repeat: >Fix: Patch attached with submission follows: diff -Nur py-odbc.orig/Makefile py-odbc/Makefile --- py-odbc.orig/Makefile 2012-12-06 12:20:34.455665137 -0600 +++ py-odbc/Makefile 2012-12-06 12:16:59.753854589 -0600 @@ -18,8 +18,7 @@ # PORTNAME= pyodbc -PORTVERSION= 2.1.5 -PORTREVISION= 2 +PORTVERSION= 3.0.6 CATEGORIES= databases python MASTER_SITES= GOOGLE_CODE PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -50,18 +49,7 @@ @(cd ${WRKSRC}; ${PYTHON_CMD} setup.py build) do-install: - @(cd ${WRKSRC}; ${PYTHON_CMD} setup.py install) - -DOCSDIR= ${PREFIX}/share/doc/py-odbc - -DOCS= docs.html index.html license.html styles.css tutorial.html - -post-install: -.if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} -.for f in ${DOCS} - @${INSTALL_DATA} ${WRKSRC}/web/${f} ${DOCSDIR} -.endfor -.endif + ${MKDIR} ${PYTHONPREFIX_SITELIBDIR} + @(cd ${WRKSRC}; ${SETENV} PYTHONPATH=${PYTHONPREFIX_SITELIBDIR} ${PYTHON_CMD} setup.py install --prefix=${PREFIX}) .include <bsd.port.mk> diff -Nur py-odbc.orig/distinfo py-odbc/distinfo --- py-odbc.orig/distinfo 2012-12-06 12:20:34.455665137 -0600 +++ py-odbc/distinfo 2012-12-06 12:02:26.428323381 -0600 @@ -1,2 +1,2 @@ -SHA256 (pyodbc-2.1.5.zip) = 0e47fbe829e2295ea43c00ddcb268c274dc37a8a5a7963fb6f64080203278793 -SIZE (pyodbc-2.1.5.zip) = 147862 +SHA256 (pyodbc-3.0.6.zip) = e5a7f12deddf4b258bed904b5a071dd43c40c78de8e24c9228f8174e69f5366d +SIZE (pyodbc-3.0.6.zip) = 85518 diff -Nur py-odbc.orig/files/patch-setup-libs py-odbc/files/patch-setup-libs --- py-odbc.orig/files/patch-setup-libs 2012-12-06 12:20:34.455665137 -0600 +++ py-odbc/files/patch-setup-libs 2012-12-06 11:47:06.052870093 -0600 @@ -1,22 +1,18 @@ ---- setup.py.orig 2009-04-15 14:10:36.000000000 -0600 -+++ setup.py 2009-06-24 09:15:04.203757061 -0600 -@@ -54,8 +54,16 @@ - else: - # Other posix-like: Linux, Solaris, etc. +--- setup.py.orig 2012-06-24 17:49:34.000000000 -0600 ++++ setup.py 2012-12-06 11:47:02.121782861 -0600 +@@ -156,6 +156,15 @@ + # What is the proper way to detect iODBC, MyODBC, unixODBC, etc.? + settings['libraries'].append('odbc') -+ try: -+ include = '-I'+os.environ['PREFIX']+'/include' -+ lib = '-L'+os.environ['PREFIX']+'/lib' -+ except: -+ include = '-I/usr/local/include' -+ lib = '-L/usr/local/lib' ++ if sys.platform.startswith('freebsd'): ++ settings['library_dirs'] = ['/usr/local/lib/'] ++ settings['include_dirs'] = ['/usr/local/include/'] ++ freebsd_prefix = '/usr/local' ++ if 'PREFIX' in os.environ: ++ freebsd_prefix = os.environ['PREFIX'] ++ if 'PYTHONPREFIX_SITELIBDIR' in os.environ: ++ sys.path.append('/'.join(freebsd_prefix, os.environ['PYTHONPREFIX_SITELIBDIR'])) + - # Python functions take a lot of 'char *' that really should be const. gcc complains about this *a lot* -- extra_compile_args = ['-Wno-write-strings'] -+ extra_compile_args = ['-Wno-write-strings', include, lib] -+ extra_link_args = [ lib ] + return settings + - # What is the proper way to detect iODBC, MyODBC, unixODBC, etc.? - libraries.append('odbc') - - diff -Nur py-odbc.orig/files/patch-src_pyodbc.h py-odbc/files/patch-src_pyodbc.h --- py-odbc.orig/files/patch-src_pyodbc.h 1969-12-31 18:00:00.000000000 -0600 +++ py-odbc/files/patch-src_pyodbc.h 2012-12-06 10:22:06.238855478 -0600 @@ -0,0 +1,12 @@ +--- src/pyodbc.h.orig 2012-01-13 13:10:48.000000000 -0600 ++++ src/pyodbc.h 2012-12-06 10:21:36.527165345 -0600 +@@ -76,7 +76,9 @@ + #include <stdarg.h> + + #if defined(__SUNPRO_CC) || defined(__SUNPRO_C) || (defined(__GNUC__) && !defined(__MINGW32__)) ++#ifndef __FreeBSD__ + #include <alloca.h> ++#endif + #define CDECL cdecl + #define min(X,Y) ((X) < (Y) ? (X) : (Y)) + #define max(X,Y) ((X) > (Y) ? (X) : (Y)) diff -Nur py-odbc.orig/pkg-plist py-odbc/pkg-plist --- py-odbc.orig/pkg-plist 2012-12-06 12:20:34.456665007 -0600 +++ py-odbc/pkg-plist 2012-12-06 12:00:28.146692957 -0600 @@ -1,7 +1,3 @@ -%%PYTHON_SITELIBDIR%%/pyodbc.so -%%PORTDOCS%%%%DOCSDIR%%/docs.html -%%PORTDOCS%%%%DOCSDIR%%/index.html -%%PORTDOCS%%%%DOCSDIR%%/license.html -%%PORTDOCS%%%%DOCSDIR%%/styles.css -%%PORTDOCS%%%%DOCSDIR%%/tutorial.html -%%PORTDOCS%%@dirrm %%DOCSDIR%% +%%PYTHON_SITELIBDIR%%/pyodbc-3.0.6-py2.7-freebsd-8.1-RELEASE-amd64.egg +@dirrm lib/python2.7/site-packages +@dirrm lib/python2.7 >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212061834.qB6IYC9D038074>