On Sat, Jun 22, 2013 at 10:27:39PM +0200, Dawe wrote:
> > >  @@ -27,7 +27,7 @@ Library
> > >                        , bytestring
> > >
> > >     GHC-Options:       -Wall
> > >  -  Extra-Libraries:   pq
> > > -+  Extra-Libraries:   pq crypto ssl com_err
> > > ++  Extra-Libraries:   pq crypto ssl com_err asn1 krb5 wind roken heimbase
> > >     -- Other-modules:
> > >     Build-tools:       hsc2hs
[...]
> aja@ asked if it's possible to make use of krb5-config to avoid the hardcoding
> of the libs.
> I think that might be doable with a patch to Setup.hs. I'll look into that, 
> but
> it will take a few days or more.
You can do this without Setup.hs. Just
Have fun reading the documentation of cabal ;-)

Basically, doing this boils down to

- patch Setup.hs to use autoconfUserHooks; as hs-postgresql-libpq
  already uses userHooks, you'll have to merge them somehow (I don't
  know the proper function for this, but I hope it's documented in
  the Cabal library documentation)

- create a simple postgresql-libpq.buildinfo.in file with

        extra-libraries: @krblibs@

  this should be done in the ports pre-configure target

- create a minmal configure script that substitutes the output of
  krb5-config for @krblibs@ in the above written file and write the
  output to postgresql-libpq.buildinfo

It may also be possible to skip postgresql-libpq.buildinfo.in and
just create a proper postgresql-libpq.buildinfo file with the proper
extra-libraries tag, but I guess you still will need some dommy
configure script.

I also wonder if it wouldn't be better to go e step further and use
pg_config instead of krb5-config. That one could be submitted to
upstream.

Ciao,
        Kili

Reply via email to