unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Debian guile-1.8 and ttn guile-pg
@ 2008-03-29 16:34 Sebastian Tennant
       [not found] ` <20080329135511.68737330@altosw.be>
  0 siblings, 1 reply; 13+ messages in thread
From: Sebastian Tennant @ 2008-03-29 16:34 UTC (permalink / raw
  To: guile-user

Hi list,

Has anyone successfully built ttn's guile-pg (0.36) using Debian's
guile-1.8?

Needless to say I haven't been able to get it to work.

I can run configure successfully once I tell it where Debian's
libpq-dev package puts the libpq includes:

  ./configure --with-libpq-includes=/usr/include/postgresql

but make fails, complaining about two files not found:

 ac_nonexistent.h
 guile/modsup.h

Any help much appreciated.

Sebastian





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

* Re: Debian guile-1.8 and ttn guile-pg
       [not found] ` <20080329135511.68737330@altosw.be>
@ 2008-03-30 12:11   ` Sebastian Tennant
  2008-03-30 15:34     ` David Pirotte
  0 siblings, 1 reply; 13+ messages in thread
From: Sebastian Tennant @ 2008-03-30 12:11 UTC (permalink / raw
  To: David Pirotte; +Cc: guile-user

Quoth David Pirotte <david@altosw.be>:
> Here is a package for debian that Dale Smith produced for me a month
> or so ago. 

Many thanks David.

I did see your list posting and I was considering writing to you
directly, but I though I'd enquire about ttn's version first because it
seems much further advanced.

Seb





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

* Re: Debian guile-1.8 and ttn guile-pg
  2008-03-30 12:11   ` Sebastian Tennant
@ 2008-03-30 15:34     ` David Pirotte
  2008-03-30 16:17       ` Sebastian Tennant
  0 siblings, 1 reply; 13+ messages in thread
From: David Pirotte @ 2008-03-30 15:34 UTC (permalink / raw
  To: Sebastian Tennant; +Cc: guile-user

Le Sun, 30 Mar 2008 15:11:58 +0300,
Sebastian Tennant <sebyte@smolny.plus.com> a écrit :

> Quoth David Pirotte <david@altosw.be>:
> > Here is a package for debian that Dale Smith produced for me a month
> > or so ago. 
> 
> Many thanks David.
> 
> I did see your list posting and I was considering writing to you
> directly, but I though I'd enquire about ttn's version first because it
> seems much further advanced.

Yes, but for some reasons, ttn's modules/packages are 'only' running under
guile-1.4.x, rarely under guile-1.6.x and i've never seen any of his work being
ported on guile-1.8, which is very sad indeed. But he wrote recently that he
might consider changing this in the future, let's hope!

You're welcome!
TC
David




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

* Re: Debian guile-1.8 and ttn guile-pg
  2008-03-30 15:34     ` David Pirotte
@ 2008-03-30 16:17       ` Sebastian Tennant
  2008-03-31 19:04         ` Greg Troxel
  0 siblings, 1 reply; 13+ messages in thread
From: Sebastian Tennant @ 2008-03-30 16:17 UTC (permalink / raw
  To: guile-user

David Pirotte <david@altosw.be> writes:
> Le Sun, 30 Mar 2008 15:11:58 +0300,
> Sebastian Tennant <sebyte@smolny.plus.com> a écrit :
>
>> Quoth David Pirotte <david@altosw.be>:
>> > Here is a package for debian that Dale Smith produced for me a month
>> > or so ago. 
>> 
>> Many thanks David.
>> 
>> I did see your list posting and I was considering writing to you
>> directly, but I though I'd enquire about ttn's version first because it
>> seems much further advanced.
>
> Yes, but for some reasons, ttn's modules/packages are 'only' running
> under guile-1.4.x, rarely under guile-1.6.x and i've never seen any
> of his work being ported on guile-1.8, which is very sad indeed.

I agree.  It's a great shame.

I can confirm his guile-www works under 1.8.

I was hoping his guile-pg would work because it doesn't explicity
state that a 1.4.x guile is required like some of his other packages
do.

> But he wrote recently that he might consider changing this in the
> future, let's hope!

Indeed.

Sebastian





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

* Re: Debian guile-1.8 and ttn guile-pg
  2008-03-30 16:17       ` Sebastian Tennant
@ 2008-03-31 19:04         ` Greg Troxel
  2008-05-25 18:08           ` Thien-Thi Nguyen
  0 siblings, 1 reply; 13+ messages in thread
From: Greg Troxel @ 2008-03-31 19:04 UTC (permalink / raw
  To: Sebastian Tennant; +Cc: guile-user

  [guile-pg and guile 1.8]

  I was hoping his guile-pg would work because it doesn't explicity
  state that a 1.4.x guile is required like some of his other packages
  do.

It works fine under 1.6.  What it needs is the feature, deprecated in
1.6 and removed in 1.8, of looking for a shlib when a module is used,
and loading it and running the init function.  The 1.8 way is to have a
scheme stub that dynlinks the module and exports the symbols.  So
guile-pg needs a new .scm file that does this, and I suspect that's all
that's required but I'm not sure.




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

* Re: Debian guile-1.8 and ttn guile-pg
@ 2008-03-31 20:18 dsmich
  2008-03-31 20:38 ` Sebastian Tennant
  0 siblings, 1 reply; 13+ messages in thread
From: dsmich @ 2008-03-31 20:18 UTC (permalink / raw
  To: Greg Troxel; +Cc: guile-user, Sebastian Tennant


---- Greg Troxel <gdt@ir.bbn.com> wrote: 
>   [guile-pg and guile 1.8]
> 
>   I was hoping his guile-pg would work because it doesn't explicity
>   state that a 1.4.x guile is required like some of his other packages
>   do.
> 
> It works fine under 1.6.  What it needs is the feature, deprecated in
> 1.6 and removed in 1.8, of looking for a shlib when a module is used,
> and loading it and running the init function.  The 1.8 way is to have a
> scheme stub that dynlinks the module and exports the symbols.  So
> guile-pg needs a new .scm file that does this, and I suspect that's all
> that's required but I'm not sure.

That is one issue but not all.  There are other apis that were deprecated in 1.6 and finally removed in 1.8.  I'm pretty sure it's not possible to wite a C Guile extension that works without change on 1.4 *and* 1.8.

-Dale





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

* Re: Debian guile-1.8 and ttn guile-pg
  2008-03-31 20:18 dsmich
@ 2008-03-31 20:38 ` Sebastian Tennant
  0 siblings, 0 replies; 13+ messages in thread
From: Sebastian Tennant @ 2008-03-31 20:38 UTC (permalink / raw
  To: guile-user

Quoth <dsmich@adelphia.net>:
> ---- Greg Troxel <gdt@ir.bbn.com> wrote: 
>>   [guile-pg and guile 1.8]
>> 
>>   I was hoping his guile-pg would work because it doesn't explicity
>>   state that a 1.4.x guile is required like some of his other packages
>>   do.
>> 
>> It works fine under 1.6.  What it needs is the feature, deprecated in
>> 1.6 and removed in 1.8, of looking for a shlib when a module is used,
>> and loading it and running the init function.  The 1.8 way is to have a
>> scheme stub that dynlinks the module and exports the symbols.  So
>> guile-pg needs a new .scm file that does this, and I suspect that's all
>> that's required but I'm not sure.
>
> That is one issue but not all.  There are other apis that were
> deprecated in 1.6 and finally removed in 1.8.  I'm pretty sure it's
> not possible to wite a C Guile extension that works without change on
> 1.4 *and* 1.8.

Thanks for the clarifications.

Sebastian





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

* Re: Debian guile-1.8 and ttn guile-pg
  2008-03-31 19:04         ` Greg Troxel
@ 2008-05-25 18:08           ` Thien-Thi Nguyen
  2008-05-27 12:46             ` Greg Troxel
  0 siblings, 1 reply; 13+ messages in thread
From: Thien-Thi Nguyen @ 2008-05-25 18:08 UTC (permalink / raw
  To: Greg Troxel; +Cc: guile-user, Sebastian Tennant

() Greg Troxel <gdt@ir.bbn.com>
() Mon, 31 Mar 2008 15:04:16 -0400

   So guile-pg needs a new .scm file that does this, and
   I suspect that's all that's required but I'm not sure.

Would something like this be sufficient?

(define-module (database postgres))
(load-extension "/ABS/PATH/TO/libpostgres.so.0.0.0"
                "scm_init_database_postgres_module")

thi




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

* Re: Debian guile-1.8 and ttn guile-pg
  2008-05-25 18:08           ` Thien-Thi Nguyen
@ 2008-05-27 12:46             ` Greg Troxel
  2008-05-27 13:04               ` Thien-Thi Nguyen
  0 siblings, 1 reply; 13+ messages in thread
From: Greg Troxel @ 2008-05-27 12:46 UTC (permalink / raw
  To: Thien-Thi Nguyen; +Cc: guile-user, Sebastian Tennant

Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> () Greg Troxel <gdt@ir.bbn.com>
> () Mon, 31 Mar 2008 15:04:16 -0400
>
>    So guile-pg needs a new .scm file that does this, and
>    I suspect that's all that's required but I'm not sure.
>
> Would something like this be sufficient?
>
> (define-module (database postgres))
> (load-extension "/ABS/PATH/TO/libpostgres.so.0.0.0"
>                 "scm_init_database_postgres_module")

(I presume you are either consing up the path or substituting it with
autoconf.)

My understanding is slightly fuzzy, but I think that defines the
guile-pg symbols in the (database postgres) module, but will not
necessarily export them.  The 1.4-style module loading seems to do the
equivalent of define-public.  I did make guile-pg work with a scheme
load file as you write above once, and I also had a number of export
statements.




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

* Re: Debian guile-1.8 and ttn guile-pg
  2008-05-27 12:46             ` Greg Troxel
@ 2008-05-27 13:04               ` Thien-Thi Nguyen
  2008-05-27 16:17                 ` David Pirotte
  0 siblings, 1 reply; 13+ messages in thread
From: Thien-Thi Nguyen @ 2008-05-27 13:04 UTC (permalink / raw
  To: Greg Troxel; +Cc: guile-user, Sebastian Tennant

⎛⎞ Greg Troxel <gdt@ir.bbn.com>
⎝⎠ Tue, 27 May 2008 08:46:04 -0400

   > (define-module (database postgres))
   > (load-extension "/ABS/PATH/TO/libpostgres.so.0.0.0"
   >                 "scm_init_database_postgres_module")

   (I presume you are either consing up the path or substituting
   it with autoconf.)

Yes, either way or even both (whatever will work).

   My understanding is slightly fuzzy, but I think that defines
   the guile-pg symbols in the (database postgres) module, but
   will not necessarily export them.

OK.

   The 1.4-style module loading seems to do the equivalent of
   define-public.

Yes.

   I did make guile-pg work with a scheme load file as you write
   above once, and I also had a number of export statements.

So in addition to the above, there needs to be `define-public'
for each proc?  Can that be phrased as an `#:export' clause in
the `define-module' form (prior to the `load-extension' call)?

thi




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

* Re: Debian guile-1.8 and ttn guile-pg
  2008-05-27 13:04               ` Thien-Thi Nguyen
@ 2008-05-27 16:17                 ` David Pirotte
  2008-05-28 12:29                   ` Thien-Thi Nguyen
  0 siblings, 1 reply; 13+ messages in thread
From: David Pirotte @ 2008-05-27 16:17 UTC (permalink / raw
  To: Thien-Thi Nguyen; +Cc: guile-user, Sebastian Tennant, Greg Troxel

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

Hi Thien,

Symbols need to be exported.

Here is [attached] an exemple of the actual guile-pg 0.16-4 
postgres.scm file from the latest debian package.

The exports are done after the load-extension, but I am convinced it 
could be done in the define-module #:export clause, could it not?

David

Le Tue, 27 May 2008 15:04:27 +0200,
Thien-Thi Nguyen <ttn@gnuvola.org> a écrit :

> ⎛⎞ Greg Troxel <gdt@ir.bbn.com>
> ⎝⎠ Tue, 27 May 2008 08:46:04 -0400
> 
>    > (define-module (database postgres))
>    > (load-extension "/ABS/PATH/TO/libpostgres.so.0.0.0"
>    >                 "scm_init_database_postgres_module")
> 
>    (I presume you are either consing up the path or substituting
>    it with autoconf.)
> 
> Yes, either way or even both (whatever will work).
> 
>    My understanding is slightly fuzzy, but I think that defines
>    the guile-pg symbols in the (database postgres) module, but
>    will not necessarily export them.
> 
> OK.
> 
>    The 1.4-style module loading seems to do the equivalent of
>    define-public.
> 
> Yes.
> 
>    I did make guile-pg work with a scheme load file as you write
>    above once, and I also had a number of export statements.
> 
> So in addition to the above, there needs to be `define-public'
> for each proc?  Can that be phrased as an `#:export' clause in
> the `define-module' form (prior to the `load-extension' call)?
> 
> thi
> 
> 

[-- Attachment #2: postgres.scm --]
[-- Type: text/x-scheme, Size: 3594 bytes --]

;;; postgres.scm --- wrap PostgreSQL libpq

;;    Guile-pg - A Guile interface to PostgreSQL
;;    Copyright (C) 1999,2000,2002,2003 Free Software Foundation, Inc.
;;
;;    This program is free software; you can redistribute it and/or modify
;;    it under the terms of the GNU General Public License as published by
;;    the Free Software Foundation; either version 2 of the License, or
;;    (at your option) any later version.
;;
;;    This program is distributed in the hope that it will be useful,
;;    but WITHOUT ANY WARRANTY; without even the implied warranty of
;;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;    GNU General Public License for more details.
;;
;;    You should have received a copy of the GNU General Public License
;;    along with this program; if not, write to the Free Software
;;    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

;;    Author: Ian Grant <Ian.Grant@cl.cam.ac.uk>

;; Load the C interface functions

(define-module (database postgres))

(cond
 ;; maybe this is already done
 ((and (defined? 'pg-guile-pg-loaded) pg-guile-pg-loaded))
 ;; use app-module loader if there
 ((defined? 'make-app-module-loader)
  ((make-app-module-loader
    (lambda (name)
      (car (list
            `("~A/guile-pg/0.16" ,(assq-ref %guile-build-info 'libdir)))))
    (lambda (name)
      `("lib~A" ,name))
    (lambda (name)
      `("init_~A" ,name)))
   "postgres"))
 ;; primitive way
 (else (dynamic-call
        "init_postgres"
        (dynamic-link
         (car (list
               (format #f "~A/guile-pg/0.16/libpostgres.so"
                       (assq-ref %guile-build-info 'libdir))))))))

(export pg-guile-pg-loaded)             ; ugh

(export pg-connectdb)
(export pg-connection?)
(export pg-setdb)
(export pg-reset)
(export pg-get-client-data)
(export pg-set-client-data!)
(export pg-exec)
(export pg-result?)
(export pg-error-message)
(export pg-get-db)
(export pg-get-user)
(export pg-get-pass)
(export pg-get-host)
(export pg-get-port)
(export pg-get-tty)
(export pg-get-options)
(export pg-get-connection)
(export pg-backend-pid)
(export pg-result-status)
(export pg-ntuples)
(export pg-nfields)
(export pg-cmdtuples)
(export pg-oid-status)
(export pg-oid-value)
(export pg-fname)
(export pg-fnumber)
(export pg-ftype)
(export pg-fsize)
(export pg-getvalue)
(export pg-getlength)
(export pg-getisnull)
(export pg-binary-tuples?)
(export pg-fmod)
(export pg-guile-pg-version)
(export pg-getline)
(export pg-putline)
(export pg-endcopy)
(export pg-trace)
(export pg-untrace)

(export pg-make-print-options)
(export pg-print)

(export pg-lo-creat)
(export pg-lo-open)
(export pg-lo-unlink)
(export pg-lo-get-connection)
(export pg-lo-get-oid)
(export pg-lo-tell)
(export pg-lo-seek)
(export pg-lo-read)
(export pg-lo-import)
(export pg-lo-export)

(define-public (pg-guile-pg-module-config-stamp) "Mon Feb 25 11:12:05 EST 2008")
(define-public (pg-guile-pg-module-version) "0.16")

;; backward compatibility (not documented to encourage
;;                         usage of symbols in new code)
;;
;; WARNING: these will go away!

(define-public PGRES_EMPTY_QUERY    'PGRES_EMPTY_QUERY)
(define-public PGRES_COMMAND_OK     'PGRES_COMMAND_OK)
(define-public PGRES_TUPLES_OK      'PGRES_TUPLES_OK)
(define-public PGRES_COPY_OUT       'PGRES_COPY_OUT)
(define-public PGRES_COPY_IN        'PGRES_COPY_IN)
(define-public PGRES_BAD_RESPONSE   'PGRES_BAD_RESPONSE)
(define-public PGRES_NONFATAL_ERROR 'PGRES_NONFATAL_ERROR)
(define-public PGRES_FATAL_ERROR    'PGRES_FATAL_ERROR)

;;; postgres.scm ends here

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

* Re: Debian guile-1.8 and ttn guile-pg
  2008-05-27 16:17                 ` David Pirotte
@ 2008-05-28 12:29                   ` Thien-Thi Nguyen
  2008-05-28 19:18                     ` Greg Troxel
  0 siblings, 1 reply; 13+ messages in thread
From: Thien-Thi Nguyen @ 2008-05-28 12:29 UTC (permalink / raw
  To: David Pirotte; +Cc: guile-user, Sebastian Tennant, Greg Troxel

⎛⎞ David Pirotte <david@altosw.be>
⎝⎠ Tue, 27 May 2008 13:17:18 -0300

   Here is [attached] an exemple of the actual guile-pg 0.16-4 
   postgres.scm file from the latest debian package.

I remember that file, but unfortunately...

   The exports are done after the load-extension, but I am convinced it 
   could be done in the define-module #:export clause, could it not?

... my uncertainty is w/ Guile 1.8.x and later, and not w/ 1.6.x (and
1.4.x which have similar capabilities re loading .so files as modules).

thi




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

* Re: Debian guile-1.8 and ttn guile-pg
  2008-05-28 12:29                   ` Thien-Thi Nguyen
@ 2008-05-28 19:18                     ` Greg Troxel
  0 siblings, 0 replies; 13+ messages in thread
From: Greg Troxel @ 2008-05-28 19:18 UTC (permalink / raw
  To: Thien-Thi Nguyen; +Cc: guile-user, Sebastian Tennant, David Pirotte

I ma pretty sure that 1.6 and 1.8 behave the same way when one loads a
.so when in a module context.  It's just that 1.8 no longer has the code
that satisfies a require by loading a .so.

So the export statements that David posted from debian look fine to me,
and the least confusing way to do things.  define-public isn't right,
because the symbol is defined after loading the .so, just not exported.




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

end of thread, other threads:[~2008-05-28 19:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-29 16:34 Debian guile-1.8 and ttn guile-pg Sebastian Tennant
     [not found] ` <20080329135511.68737330@altosw.be>
2008-03-30 12:11   ` Sebastian Tennant
2008-03-30 15:34     ` David Pirotte
2008-03-30 16:17       ` Sebastian Tennant
2008-03-31 19:04         ` Greg Troxel
2008-05-25 18:08           ` Thien-Thi Nguyen
2008-05-27 12:46             ` Greg Troxel
2008-05-27 13:04               ` Thien-Thi Nguyen
2008-05-27 16:17                 ` David Pirotte
2008-05-28 12:29                   ` Thien-Thi Nguyen
2008-05-28 19:18                     ` Greg Troxel
  -- strict thread matches above, loose matches on Subject: below --
2008-03-31 20:18 dsmich
2008-03-31 20:38 ` Sebastian Tennant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).