> One more observation: it looks like a problem in recent libglade file header. > I have disabled creation of precomp file: > Main.hs: -- putBinFileWithDict preCompFile (WithNameSupply cheader) > and have dumped something called header: > > Main.hs:process: (header, strippedCHSMod, warnmsgs) <- genHeader chsMod > Usually header is an empty list. But now it contains (already serialized!) > garbage: > "#if __GLASGOW_HASKELL__>=704" > "\n" > "struct " > "C2HS_COND_SENTRY_1" > ";\n" > "#else\n" > "#endif\n" > > Does it look valid? What should I provide?
Now I see. Running ./setup configure in glade's repo *patches* .chs file:
diff --git a/Graphics/UI/Gtk/Glade/Types.chs b/Graphics/UI/Gtk/Glade/Types.chs
index 38574d4..4075fea 100644
--- a/Graphics/UI/Gtk/Glade/Types.chs
+++ b/Graphics/UI/Gtk/Glade/Types.chs
@@ -42,7 +42,11 @@ module Graphics.UI.Gtk.Glade.Types (
) where
import Foreign.ForeignPtr (ForeignPtr, castForeignPtr, unsafeForeignPtrToPtr)
+#if __GLASGOW_HASKELL__>=704
+import Foreign.C.Types (CULong(..), CUInt(..))
+#else
import Foreign.C.Types (CULong, CUInt)
+#endif
import System.Glib.GType (GType, typeInstanceIsA)
{#import Graphics.UI.GtkInternals#}
and then gtk2hs-c2hs can't parse it as it does not get
passed -D__GLASGOW_HASKELL__= define. easy to fix:
diff --git a/Gtk2HsSetup.hs b/Gtk2HsSetup.hs
index 7aad542..05b2a61 100644
--- a/Gtk2HsSetup.hs
+++ b/Gtk2HsSetup.hs
@@ -225,6 +225,7 @@ getCppOptions bi lbi
= nub $
["-I" ++ dir | dir <- PD.includeDirs bi]
++ [opt | opt@('-':c:_) <- PD.cppOptions bi ++ PD.ccOptions bi, c `elem`
"DIU"]
+ ++ ["-D__GLASGOW_HASKELL__=" ++ show __GLASGOW_HASKELL__]
installCHI :: PackageDescription -- ^information from the .cabal file
-> LocalBuildInfo -- ^information from the configure step
But even if it is it does not help and things break the same way:
/usr/bin/gtk2hsC2hs --include=dist/build
--include=/usr/lib64/ghc-7.0.4/base-4.3.1.0
--include=/usr/lib64/glib-0.12.3/ghc-7.0.4
--include=/usr/lib64/gtk-0.12.3/ghc-7.0.4 --cpp=/usr/bin/gcc --cppopts=-E
--cppopts=-Idist/build/autogen --cppopts=-Idist/build
--cppopts=-I/usr/include/libglade-2.0 --cppopts=-I/usr/include/gtk-2.0
--cppopts=-I/usr/include/libxml2 --cppopts=-I/usr/lib64/gtk-2.0/include
--cppopts=-I/usr/include/atk-1.0 --cppopts=-I/usr/include/cairo
--cppopts=-I/usr/include/gdk-pixbuf-2.0 --cppopts=-I/usr/include/pango-1.0
--cppopts=-I/usr/include/glib-2.0 --cppopts=-I/usr/lib64/glib-2.0/include
--cppopts=-I/usr/include/pixman-1 --cppopts=-I/usr/include/freetype2
--cppopts=-I/usr/include/libpng15 --cppopts=-I/usr/include/libdrm
--cppopts=-D__GLASGOW_HASKELL__=700
--output-dir=dist/build/Graphics/UI/Gtk/Glade/ --output=Types.hs
--precomp=dist/build/precompchs.bin glade/glade.h
./Graphics/UI/Gtk/Glade/Types.chs
gtk2hsC2hs: UName: root name supply used after saving
--
Sergei
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________ Gtk2hs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel
