From: Daniel W. <dm...@lu...> - 2012-09-03 19:25:21
|
diffing dir... Sun Sep 2 17:51:31 BST 2012 Duncan Coutts <du...@co...> * Fix for finding the .dll names for ghci Ignore-this: f2ca3b6959a1355ca708e8b7c091a50d Should fix the problem that the cairo package fails to load in ghci on Windows hunk ./cairo/Gtk2HsSetup.hs 59 -import Data.List (isPrefixOf, isSuffixOf, nub) +import Data.List (isPrefixOf, isSuffixOf, nub, minimumBy) +import Data.Ord as Ord (comparing) hunk ./cairo/Gtk2HsSetup.hs 104 - dll:_ -> [dropExtension dll] - _ -> if lib == "z" then [] else [lib] + dlls@(_:_) -> [dropExtension (pickDll dlls)] + _ -> if lib == "z" then [] else [lib] + where + -- If there are several .dll files matching the one we're after then we + -- just have to guess. For example for recent Windows cairo builds we get + -- libcairo-2.dll libcairo-gobject-2.dll libcairo-script-interpreter-2.dll + -- Our heuristic is to pick the one with the shortest name. + -- Yes this is a hack but the proper solution is hard: we would need to + -- parse the .a file and see which .dll file(s) it needed to link to. + pickDll = minimumBy (Ord.comparing length) |