delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/06/07/10:47:42

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Thu, 7 Jun 2001 10:47:06 -0400
From: Jason Tishler <Jason DOT Tishler AT dothill DOT com>
To: Sherwood Robinson <srobinson AT fredericksburg DOT com>
Cc: cygwin AT cygwin DOT com
Subject: Re: PoPy python module
Message-ID: <20010607104706.N524@dothill.com>
Mail-Followup-To: Sherwood Robinson <srobinson AT fredericksburg DOT com>,
cygwin AT cygwin DOT com
Mime-Version: 1.0
In-Reply-To: <5.1.0.14.2.20010607091520.03b7c348@mail.fredericksburg.com>
User-Agent: Mutt/1.3.18i
Organization: Dot Hill Systems Corp.

--CV6W/mrvpom2x6YP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Sherwood,

On Thu, Jun 07, 2001 at 09:19:02AM -0400, Sherwood Robinson wrote:
> Anyone experienced compiling the PoPy 
> (http://sourceforge.net/projects/popy) python module for PostgreSQL DB API 
> 2.0 compliant.
> 
> It is giving me  quite the time trying to get this to compile.
> 
> any help would be appreciated.

I just tried it and I was successful building and running PoPy-3.0-beta1:

    $ python
    Python 2.1 (#1, Apr 17 2001, 09:45:01) 
    [GCC 2.95.3-2 (cygwin special)] on cygwin_nt-4.01
    Type "copyright", "credits" or "license" for more information.
    >>> import PoPy
    >>> c = PoPy.connect('user=jt dbname=sanman', 1)
    >>> cursor = c.cursor()
    >>> cursor.execute('select * from pg_user')
    >>> cursor.fetchall()
    [('jt', 1004, 1, 1, 1, 1, '********', None), ('postgres', 1005, 1, 0, 1, 1, '********', None)]

Unfortunately, this process uncovered some issues:

1. The attached patch needs to be applied in order for PoPy to build
cleanly under Cygwin (and Win32 if appropriate).  Note that the essence
of this patch is very common -- I have submitted numerous ones that are
now part of Python CVS and to other projects such as python-ldap.

I recommend that you submit this patch to PoPy for consideration to be
included in PoPy CVS.

The procedure to apply the patch is as follows:

    $ # save the attachment to /tmp
    $ cd PoPy-3.0-beta1
    $ patch -p1 </tmp/PoPy-3.0-beta1.patch

2. It appears that PoPy is attempting to include files that are not
part of the Cygwin PostgreSQL distribution.  Note that I produced this
distribution using the typical "make install".  Hence, I am currently
at a loss as to why these files are missing.  I am going to attempt to
find out whether or not these files are truly missing or that PoPy is
incorrectly including files that are really only part of the source tree.
If files are missing from the Cygwin PostgreSQL distribution, then I
re-release the distribution with the missing files included.

Nevertheless, if you download and unpack PostgreSQL 7.1.2 and create the
following symlinks, then you should be able to build PoPy yourself:

    $ ln -s ~/src/postgresql-7.1.2/src/include/utils /usr/include/postgresql/utils
    $ ln -s ~/src/postgresql-7.1.2/src/include/catalog /usr/include/postgresql/catalog
    $ ln -s ~/src/postgresql-7.1.2/src/include/postgres.h /usr/include/postgresql/postgres.h

Note that the above assumes that PostgreSQL 7.1.2 is unpacked in ~/src -- you
may need to adjust the above commands to match your environment.

Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: 732.264.8770 x235
Dot Hill Systems Corp.               Fax:   732.264.8798
82 Bethany Road, Suite 7             Email: Jason DOT Tishler AT dothill DOT com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

--CV6W/mrvpom2x6YP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="PoPy-3.0-beta1.patch"

diff -rup PoPy-3.0-beta1.orig/PoPy.c PoPy-3.0-beta1/PoPy.c
--- PoPy-3.0-beta1.orig/PoPy.c	Mon Mar  5 10:05:21 2001
+++ PoPy-3.0-beta1/PoPy.c	Thu Jun  7 09:51:25 2001
@@ -266,11 +266,14 @@ static PyMethodDef PoPy_methods[] = {
 /*    PoPy MODULE INITIALIZATION    */
 /***************************************/
 
-void
+DL_EXPORT(void)
 initPoPy(void)
 {
 	PyObject *dict, *module;
 
+	PoPy_CursorObject_Type.ob_type = &PyType_Type;
+	PoPy_BinaryObject_Type.ob_type = &PyType_Type;
+	PoPy_ConnectionObject_Type.ob_type = &PyType_Type;
 	module = Py_InitModule3("PoPy", PoPy_methods, "");
 	dict = PyModule_GetDict(module);
 
diff -rup PoPy-3.0-beta1.orig/PoPybinary.c PoPy-3.0-beta1/PoPybinary.c
--- PoPy-3.0-beta1.orig/PoPybinary.c	Mon Mar  5 10:05:21 2001
+++ PoPy-3.0-beta1/PoPybinary.c	Thu Jun  7 09:49:28 2001
@@ -156,7 +156,7 @@ PoPy_binary_object_NEW(PyObject * self, 
 
 
 PyTypeObject PoPy_BinaryObject_Type = {
-	PyObject_HEAD_INIT(&PyType_Type) 0,
+	PyObject_HEAD_INIT(NULL) 0,
 	"binary",
 	sizeof(PoPy_BinaryObject),
 	0,
diff -rup PoPy-3.0-beta1.orig/PoPyconnection.c PoPy-3.0-beta1/PoPyconnection.c
--- PoPy-3.0-beta1.orig/PoPyconnection.c	Mon Mar  5 10:05:21 2001
+++ PoPy-3.0-beta1/PoPyconnection.c	Thu Jun  7 09:50:35 2001
@@ -322,7 +322,7 @@ PoPy_connection_object_getattr(PoPy_Conn
 
 
 PyTypeObject PoPy_ConnectionObject_Type = {
-	PyObject_HEAD_INIT(&PyType_Type) 0,
+	PyObject_HEAD_INIT(NULL) 0,
 	"ConnectionObject",
 	sizeof(PoPy_ConnectionObject),
 	0,
diff -rup PoPy-3.0-beta1.orig/PoPycursor.c PoPy-3.0-beta1/PoPycursor.c
--- PoPy-3.0-beta1.orig/PoPycursor.c	Mon Mar  5 10:05:21 2001
+++ PoPy-3.0-beta1/PoPycursor.c	Thu Jun  7 09:48:48 2001
@@ -722,7 +722,7 @@ PoPy_cursor_object_getattr(PoPy_CursorOb
 
 
 PyTypeObject PoPy_CursorObject_Type = {
-	PyObject_HEAD_INIT(&PyType_Type) 0,
+	PyObject_HEAD_INIT(NULL) 0,
 	"PoPy_CursorObject",
 	sizeof(PoPy_CursorObject),
 	0,


--CV6W/mrvpom2x6YP
Content-Type: text/plain; charset=us-ascii

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
--CV6W/mrvpom2x6YP--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019