Applied, thanks!
~d

Quoting Duncan Coutts <duncan.cou...@googlemail.com>:

> Hi folks,
>
> With current Gtk+ windows bundles we have the problem that the cairo
> binding fails to load in ghci, though it works fine for compiling
> standalone .exes.
>
> The source of the problem is that the ghc-pkg package registration
> information is wrong, it ends up containing:
>
>         extra-libraries: z cairo
>         extra-ghci-libraries: libcairo-script-interpreter-2
>
> when it should be:
>
>         extra-libraries: z cairo
>         extra-ghci-libraries: libcairo-2
>
> Background: when the extra-ghci-libraries field is present then ghci
> will use it instead of the extra-libraries field. This lets ghci cope
> with the fact that the static lib is called libcairo.a while the dynamic
> lib is called libcairo-2.dll.
>
> The extra-ghci-libraries field is set in by a bit of code in the
> Gtk2HsSetup.hs file which looks for a .dll file corresponding to the
> main lib that is needed. It's pure guesswork based on file names. The
> code currently falls over in the case that there's more than one .dll
> file with the pattern libcairo-*.dll and with recent Gtk+ builds there's
> actually 3. So that's why it's picking libcairo-script-interpreter-2
> rather than libcairo-2.
>
> The attached patch changes this heuristic so that if there's several
> choices then we pick the one with the shortest file name. I don't claim
> that's fool proof (obviously it isn't) but it's a lot better than just
> picking randomly based on directory ordering as it does now.
>
> BTW: I've only adjusted the cairo/Gtk2HsSetup.hs, and it's preferably to
> keep them all in sync. Also, I've not actually tested the patch on
> Windows but it looks "Obviously Correct"(tm) :-)
>
> Duncan
>



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to