pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pygresql build/install problems: use setup.py?
5+ messages / 4 participants
[nested] [flat]

* pygresql build/install problems: use setup.py?
@ 2003-05-14 19:24  george young <gry@ll.mit.edu>
  0 siblings, 4 replies; 5+ messages in thread

From: george young @ 2003-05-14 19:24 UTC (permalink / raw)
  To: pgsql-interfaces

[python 2.3a1 & 2.2, postgresql 7.3.2 & 7.2.1, x86 linux]

As you note from the above line, I'm wrangling multiple versions
of python and postgres[ql].  I use the PyGreSQL interface from the
postgres source dist.  But I need to install PyGreSQL for other
than the default python.  I know I could hack it by hand, but it
seems like there could be an optional arg to configure like:

  ./configure --with-python=python2.3

to specify a binary (and include files and lib install destination)
other than the default.  Maybe it needs a separate option:

  --python-include=/usr/local/include/python-2.3 

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 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?

-- 
 I cannot think why the whole bed of the ocean is
 not one solid mass of oysters, so prolific they seem. Ah,
 I am wandering! Strange how the brain controls the brain!
	-- Sherlock Holmes in "The Dying Detective"



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pygresql build/install problems: use setup.py?
@ 2003-05-15 08:28  Gerhard Häring <lists@ghaering.de>
  parent: george young <gry@ll.mit.edu>
  3 siblings, 0 replies; 5+ messages in thread

From: Gerhard Häring @ 2003-05-15 08:28 UTC (permalink / raw)
  To: pgsql-interfaces

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





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pygresql build/install problems: use setup.py?
@ 2003-05-15 15:53  Peter Eisentraut <peter_e@gmx.net>
  parent: george young <gry@ll.mit.edu>
  3 siblings, 0 replies; 5+ messages in thread

From: Peter Eisentraut @ 2003-05-15 15:53 UTC (permalink / raw)
  To: george young <gry@ll.mit.edu>; +Cc: pgsql-interfaces

george young writes:

> As you note from the above line, I'm wrangling multiple versions
> of python and postgres[ql].  I use the PyGreSQL interface from the
> postgres source dist.  But I need to install PyGreSQL for other
> than the default python.  I know I could hack it by hand, but it
> seems like there could be an optional arg to configure like:
>
>   ./configure --with-python=python2.3

./configure --with-python PYTHON=python2.3

This works for any program that is detected in configure.

-- 
Peter Eisentraut   peter_e@gmx.net




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [INTERFACES] pygresql build/install problems: use setup.py?
@ 2003-06-02 16:52  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: george young <gry@ll.mit.edu>
  3 siblings, 0 replies; 5+ messages in thread

From: Bruce Momjian @ 2003-06-02 16:52 UTC (permalink / raw)
  To: gry@ll.mit.edu; +Cc: PostgreSQL-patches <pgsql-patches@postgresql.org>


Your patch has been added to the PostgreSQL unapplied patches list at:

	http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


george young wrote:
> 
> 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 = []
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pygresql build/install problems: use setup.py?
@ 2003-06-12 02:15  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: george young <gry@ll.mit.edu>
  3 siblings, 0 replies; 5+ messages in thread

From: Bruce Momjian @ 2003-06-12 02:15 UTC (permalink / raw)
  To: gry@ll.mit.edu; +Cc: pgsql-interfaces


I have applied the setup.py part of this patch.  Thanks.

---------------------------------------------------------------------------

george young wrote:
> [python 2.3a1 & 2.2, postgresql 7.3.2 & 7.2.1, x86 linux]
> 
> As you note from the above line, I'm wrangling multiple versions
> of python and postgres[ql].  I use the PyGreSQL interface from the
> postgres source dist.  But I need to install PyGreSQL for other
> than the default python.  I know I could hack it by hand, but it
> seems like there could be an optional arg to configure like:
> 
>   ./configure --with-python=python2.3
> 
> to specify a binary (and include files and lib install destination)
> other than the default.  Maybe it needs a separate option:
> 
>   --python-include=/usr/local/include/python-2.3 
> 
> 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 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?
> 
> -- 
>  I cannot think why the whole bed of the ocean is
>  not one solid mass of oysters, so prolific they seem. Ah,
>  I am wandering! Strange how the brain controls the brain!
> 	-- Sherlock Holmes in "The Dying Detective"
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/docs/faqs/FAQ.html
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-06-12 02:15 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-05-14 19:24 pygresql build/install problems: use setup.py? george young <gry@ll.mit.edu>
2003-05-15 08:28 ` Gerhard Häring <lists@ghaering.de>
2003-05-15 15:53 ` Peter Eisentraut <peter_e@gmx.net>
2003-06-02 16:52 ` Bruce Momjian <pgman@candle.pha.pa.us>
2003-06-12 02:15 ` Bruce Momjian <pgman@candle.pha.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox