Re: pygresql build/install problems: use setup.py?

From: Gerhard Häring <lists(at)ghaering(dot)de>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: pygresql build/install problems: use setup.py?
Date: 2003-05-15 08:28:00
Message-ID: 3EC34F90.5060804@ghaering.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-patches

george young wrote:
> [...] I'm hoping some autoconf wiz will take this in hand -- auto* stuff
> scares me...
>
> I succeeded by fixing up setup.py:
> vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> --- setup.py~ Tue Mar 19 08:21:14 2002
> +++ setup.py Wed May 14 15:10:30 2003
> @@ -30,8 +30,8 @@
> optional_libs=[ 'libpqdll', 'wsock32', 'advapi32' ]
> data_files = [ 'libpq.dll' ]
> else:
> - include_dirs=['/usr/include/pgsql']
> - library_dirs=['usr/lib/pgsql']
> + include_dirs=['../../include','../libpq','/usr/include/pgsql']
> + library_dirs=['../libpq','/usr/lib/pgsql']
> optional_libs=['pq']
> data_files = []
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Isn't this the right thing to do? It should use the .. lib and include
> dirs if they exist, since these are sure to be correct, as opposed
> to hard coded /usr/lib/pgsql and /usr/include/pgsql which might
> not exist until an install has been done, and worse, might be from
> an older postgres version.

It's the right thing to do. And it is also what it does in the win32
case. And pyPgSQL does the same as well on win32, because it's setup.py
evolved from the PyGreSQL one :-)

> It seems like the makefiles should just run
> $PYTHON setup.py build
> and
> $PYTHON setup.py install
>
> since setup.py has a much better chance of installing in the right
> directories, or am I missing something?

That's a feasible approach. But the PostgreSQL developers probably
aren't very familiar with distutils. Also distutils doesn't support
cross-compiling, which the auto* build process for PostgreSQL might
support otherwise.

-- Gerhard

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Eisentraut 2003-05-15 15:53:03 Re: pygresql build/install problems: use setup.py?
Previous Message george young 2003-05-14 19:24:32 pygresql build/install problems: use setup.py?

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2003-05-15 15:53:03 Re: pygresql build/install problems: use setup.py?
Previous Message Tom Lane 2003-05-15 05:10:20 Re: contrib/tablefunc bugfix