Re: [wxhaskell-devel] The 'making wxC build on all platforms thread
-- Forwarded message -- From: Paulo Pocinho poci...@gmail.com Date: 1 February 2012 16:02 Subject: Re: [wxhaskell-devel] The 'making wxC build on all platforms thread To: Jeremy O'Donoghue jeremy.odonog...@gmail.com Trying to follow up with the latest stable version of wxHaskell 0.13.2 (based on wxWidgets 2.8.12). I run straight into trouble using the wx-config tool, preventing me to update the package - it does not work. Then I found out about the latest development. Pulled the sources from http://darcsden.com/kowey/wxhaskell - packed and installed that wx-config with cabal and still no luck. As last resort, I checked out from Dave Tapley. Patched it with Jeremy's diff and tried to build that version against wxWidgets 2.9 (compiled from svn sources). Now, I am lost in a circular dependency: E:\Dev\Repo\wxhaskell-dev-darcs\wxhaskell-dev-v14patch\wxcorecabal configure Resolving dependencies... Configuring wxcore-0.14... setup.exe: At least the following dependencies are missing: wxc -any E:\Dev\Repo\wxhaskell-dev-darcs\wxhaskell-dev-v14patch\wxcorecd ..\wxc E:\Dev\Repo\wxhaskell-dev-darcs\wxhaskell-dev-v14patch\wxccabal configure Resolving dependencies... Configuring wxc-0.1... setup.exe: This version of wxcore requires wx 2.9 to be available E:\Dev\Repo\wxhaskell-dev-darcs\wxhaskell-dev-v14patch\wxccd ..\wx E:\Dev\Repo\wxhaskell-dev-darcs\wxhaskell-dev-v14patch\wxcabal configure Resolving dependencies... Configuring wx-0.14... cabal: At least the following dependencies are missing: wxcore =0.14 It's been a great adventure though. Thanks for everyone working on this! On 31 January 2012 16:32, Jeremy O'Donoghue jeremy.odonog...@gmail.com wrote: Hi all, Attached are patches which enable me to build and Dave's repo on Windows. I have built and run most of the samples and test cases (including OpenGL, STC and PropertyGrid) I also included Nicholas Tung's patch from a couple of days back to support GHC 7.2.2 by adding some FlexibleInstances pragmas. The remaining issue on Windows is that GHCi is not working as it should. I will look at this next. On 25 January 2012 15:33, Dave Tapley duked...@gmail.com wrote: On 22 January 2012 00:37, Jeremy O'Donoghue jeremy.odonog...@gmail.com wrote: I now have wxC building on Windows. Details below and patches attached. Excellent! I'll take a look. I am now failing to build wxcore. This is faling to find the wxc header files on Windows (it is looking for them in ./include/wxc). I notice that Dave has already marked the wxcInstallDir function as dubious, so I'll start looking there when it isn't past midnight (a bad time to start anything, IME). Mmm, I'm sorry about that. I actually went for this solution because I'm using cabal-dev to work on wxHaskell (so I can keep the hackage wxHaskell in my system cabal pkg conf): I needed a way to find the wxC headers (which obviously should be part of the wxC package) during the wxcore configure (because wxdirect (called by wxcore) needs them to generate some Haskell source (the FFI bindings)). The solution turned out to be simpler than I expected: the working code for Linux was using System.Directory.Posix, when System.Directory will get you the same thing, but internally select between System.Directory.Posix and System.Directory.Windows. No prizes for guessing which you need on Windows :-) Whilst I did mark wxcInstallDir as dubious, I do quite like the idea of having cabal work out which version of wxC it is using to satisfy wxcore's dependency, and then linking against exactly that version's header files. The only alternatives I can think of are: 1. Enforce that wxC is installed as a system or user shared library and find/version it up as we would any other external library (this would be required if we stopped using cabal). 2. Provide some other (auto-guesswork-or-specify-on-command-line) mechanism to tell wxcore: can you configure yourself with the wxC headers here, and link against this shared library. Actually, after some reflection, I don't think wxcInstallDir is dubious at all. It is, I think, using a documented Cabal API, and it works on all Cabal platforms. One area where we do have an issue is that wxc.dll gets installed somewhere no sane human being would evenr look to find it. I think the solution will be to do a skeleton wxHaskell project Cabal file which pulls all of the dlls from their install directory and copies them to dist/build, or something similar. Regards Jeremy -- 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 ___ wxhaskell-devel
Re: [wxhaskell-devel] The 'making wxC build on all platforms thread
Hi Paulo [Replying to all] First, apologies that it has taken so long for you to fail to get going. I am going to try to cover both wxWidgets 2.8.12 and 2.9.x approaches in the same mail. Please feel free to choose whichever you prefer. I assume that you are working on Windows, based on the output you have pasted. On 1 February 2012 16:03, Paulo Pocinho poci...@gmail.com wrote: Trying to follow up with the latest stable version of wxHaskell 0.13.2 (based on wxWidgets 2.8.12). I run straight into trouble using the wx-config tool, preventing me to update the package - it does not work. On Windows there is no wx-config supplied with wxWidgets. There is a workaround, which is to use wx-config-win (found at http://code.google.com/p/wx-config-win/). This is a C++ implementation of wx-config for Windows targets. The version on Google Code is OK for use with wxHaskell 0.13.2, but does not work for the latest code. You need to make sure that the WXWIN environment variable is pointing to your wxWidgets install and that WXCFG points to the directory containing your build.cfg. In my case (i.e. what I have tested) this is gcc_dll\mswu. If you have the above configuration with wx-config.exe from the Google code site, cabal install wx should work. Then I found out about the latest development. Pulled the sources from http://darcsden.com/kowey/wxhaskell - packed and installed that wx-config with cabal and still no luck. This one won't work - it has only been tested for wxWidgets 2.9.x - and we probably won't use it moving forward, as it needs quite a bit of work to make it function completely correctly. As last resort, I checked out from Dave Tapley. Patched it with Jeremy's diff and tried to build that version against wxWidgets 2.9 (compiled from svn sources). Now, I am lost in a circular dependency: E:\Dev\Repo\wxhaskell-dev-darcs\wxhaskell-dev-v14patch\wxcorecabal configure Resolving dependencies... Configuring wxcore-0.14... setup.exe: At least the following dependencies are missing: wxc -any E:\Dev\Repo\wxhaskell-dev-darcs\wxhaskell-dev-v14patch\wxcorecd ..\wxc E:\Dev\Repo\wxhaskell-dev-darcs\wxhaskell-dev-v14patch\wxccabal configure Resolving dependencies... Configuring wxc-0.1... setup.exe: This version of wxcore requires wx 2.9 to be available This is the root of your problem. A couple of possibilities: 1. You may have WXWIN and WXCFG environment variables pointing to your wxWidgets 2.8.x install (or not pointing anywhere at all) 2. You need the updated version of wx-config-win I put together to get all of the correct configuration data for a wxWidgets 2.9 configuration.If you don't have it, it was attached to the following message: http://article.gmane.org/gmane.comp.lang.haskell.wxhaskell.devel/807 . You will need to compile(*) the CPP file. If you don't have a C++ compiler, I can also send you an executable - assuming that none of the mail tools block it, that is. (*) Nothing very difficult. I think gcc -o wx-config.exe wx-config-win.cpp should do it. E:\Dev\Repo\wxhaskell-dev-darcs\wxhaskell-dev-v14patch\wxccd ..\wx E:\Dev\Repo\wxhaskell-dev-darcs\wxhaskell-dev-v14patch\wxcabal configure Resolving dependencies... Configuring wx-0.14... cabal: At least the following dependencies are missing: wxcore =0.14 It's been a great adventure though. Thanks for everyone working on this! On 31 January 2012 16:32, Jeremy O'Donoghue jeremy.odonog...@gmail.com wrote: Hi all, Attached are patches which enable me to build and Dave's repo on Windows. I have built and run most of the samples and test cases (including OpenGL, STC and PropertyGrid) I also included Nicholas Tung's patch from a couple of days back to support GHC 7.2.2 by adding some FlexibleInstances pragmas. The remaining issue on Windows is that GHCi is not working as it should. I will look at this next. On 25 January 2012 15:33, Dave Tapley duked...@gmail.com wrote: On 22 January 2012 00:37, Jeremy O'Donoghue jeremy.odonog...@gmail.com wrote: I now have wxC building on Windows. Details below and patches attached. Excellent! I'll take a look. I am now failing to build wxcore. This is faling to find the wxc header files on Windows (it is looking for them in ./include/wxc). I notice that Dave has already marked the wxcInstallDir function as dubious, so I'll start looking there when it isn't past midnight (a bad time to start anything, IME). Mmm, I'm sorry about that. I actually went for this solution because I'm using cabal-dev to work on wxHaskell (so I can keep the hackage wxHaskell in my system cabal pkg conf): I needed a way to find the wxC headers (which obviously should be part of the wxC package) during the wxcore configure (because wxdirect (called by wxcore) needs them to generate some Haskell source (the FFI bindings)). The solution turned out to be simpler than I expected: the
Re: [wxhaskell-devel] The 'making wxC build on all platforms thread
Hi all, Sorry I've been a little quiet the last week or two, rest assured I have lurking all along. On 22 January 2012 00:37, Jeremy O'Donoghue jeremy.odonog...@gmail.comwrote: I now have wxC building on Windows. Details below and patches attached. Excellent! I'll take a look. Jeremy On 18 January 2012 23:34, Jeremy O'Donoghue jeremy.odonog...@gmail.comwrote: On 17 January 2012 22:40, Jeremy O'Donoghue jeremy.odonog...@gmail.comwrote: On 17 January 2012 21:38, Jeremy O'Donoghue jeremy.odonog...@gmail.comwrote: Hi all, I have collected together all of the people who I know are making the effort to build Dave's latest code on different platforms. I'd also like to introduce Andrej, who is testing wxC in the context of D (so could we go easy on the Zygohistomorphic Premorphisms and other deep Haskell-ism in this thread :-) I'd suggest that we try to pull together all of the experiences into a single thread - makes it easier for people to keep up. For the moment, I'd like to bring up my experience with wxC on Windows: First, you need at least a patch to wx-config-win32 which sorts out library names (msys libraries are incorrectly named due to a 2.8/2.9 change) At line 948 of wx-config-win.cpp, you need: if (cfg[BUILD] == “debug” cfg[DEBUG_FLAG] == “default”) po[WXDEBUGFLAG] = “”; if (cfg[DEBUG_FLAG] == “1″) po[WXDEBUGFLAG] = “”; Second, in wxc/Setup.hs you need to change line 82 (just after output readProcess “wx-config” [--libs, std,gl,stc,xrc,richtext,aui,media, --cppflags] “” This is needed because wx-config-win does not support the new ‘all’ flag, and I haven’t had time to fix wx-config-win properly. Third, the library then builds for me, but fails to link (link errors in StyledTextCtrl). I hope to work out why tonight or tomorrow. I've worked out why, but haven't fixed it. wx-config-win doesn't know about some of the new libraries, and is giving incorrect results in other cases. I don't have time to fix this tonight, but: C:\usr\local\src\haskell\wxhaskell-dev\wxhaskell-2.9\wxcwx-config --libs base,gl,xrc,richtext,aui,media returns -mthreads -LD:\Builds\wxWidgets-2.9.3\lib\gcc_dll -lwxmsw29u_richtext -lwxmsw29u_gl -lopengl32 -lglu32 -lwxmsw29u_media -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 C:\usr\local\src\haskell\wxhaskell-dev\wxhaskell-2.9\wxcwx-config --libs returns -mthreads -LD:\Builds\wxWidgets-2.9.3\lib\gcc_dll -lwxmsw29u_html -lwxmsw29u_adv -lwxmsw29u_core -lwxbase29u_xml -lwxbase29u_net -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lw xregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 Missing base libraries in red. I'll try to fix this tomorrow. I have managed to make wx-config-win work, at least for my configuration. There is a known bug which I lack the will to fix right now - the command line parser in wx-config-win is very rudimentary and thinks that wx-config --libs all --cppflags is looking for the additional library --cppflags. The work-around is to call wx-config --cppflags --libs all - I have changed wxc\Setup.hs to call wx-config this way. Changes to wx-config-win are quite numerous. The most notable is that the Unix wx-config has the set of libraries available (e.g. for all) hard-coded into it (when wx-config.in is turned into wx-config by configure). On Windows this is not possible, so I have written a function which goes to the library directory of the selected wxWidgets install and enumerates all of the wx-related libraries. This is a bit fragile really, since it assumes that future wxWidgets libraries follow the current naming convention, but it works for now. I don't have access to the wx-config-win svn repo, so the updated file is attached. Oh, and it also builds under VS2010 now (I wanted a decent debugger!). A couple of minor patches were needed to wxc to make it build. These are: - Reversed the order of libraries, to correctly permit static linking (because MinGW GCC actually statically links the implibs). - Don't specify wxWidgets version for Windows (wx-config-win doesn't support). We do show the detected version, however. - Work-around for the wx-config-win --cppflags bug noted above. - Add the -Wl,enable-auto-import link flag on Windows, which gets rid of a lot of spurious link warnings. - Made wxc.a and wxc.dll build in the dist\build directory, so install succeeds. - Added undef cases for wxAUI event wrappers I am now failing to build wxcore. This is faling to find the wxc header files on Windows (it is looking for them in ./include/wxc). I notice that Dave has already marked the wxcInstallDir function as dubious, so I'll
Re: [wxhaskell-devel] The 'making wxC build on all platforms thread
On 17 January 2012 22:40, Jeremy O'Donoghue jeremy.odonog...@gmail.comwrote: On 17 January 2012 21:38, Jeremy O'Donoghue jeremy.odonog...@gmail.comwrote: Hi all, I have collected together all of the people who I know are making the effort to build Dave's latest code on different platforms. I'd also like to introduce Andrej, who is testing wxC in the context of D (so could we go easy on the Zygohistomorphic Premorphisms and other deep Haskell-ism in this thread :-) I'd suggest that we try to pull together all of the experiences into a single thread - makes it easier for people to keep up. For the moment, I'd like to bring up my experience with wxC on Windows: First, you need at least a patch to wx-config-win32 which sorts out library names (msys libraries are incorrectly named due to a 2.8/2.9 change) At line 948 of wx-config-win.cpp, you need: if (cfg[BUILD] == “debug” cfg[DEBUG_FLAG] == “default”) po[WXDEBUGFLAG] = “”; if (cfg[DEBUG_FLAG] == “1″) po[WXDEBUGFLAG] = “”; Second, in wxc/Setup.hs you need to change line 82 (just after output readProcess “wx-config” [--libs, std,gl,stc,xrc,richtext,aui,media, --cppflags] “” This is needed because wx-config-win does not support the new ‘all’ flag, and I haven’t had time to fix wx-config-win properly. Third, the library then builds for me, but fails to link (link errors in StyledTextCtrl). I hope to work out why tonight or tomorrow. I've worked out why, but haven't fixed it. wx-config-win doesn't know about some of the new libraries, and is giving incorrect results in other cases. I don't have time to fix this tonight, but: C:\usr\local\src\haskell\wxhaskell-dev\wxhaskell-2.9\wxcwx-config --libs base,gl,xrc,richtext,aui,media returns -mthreads -LD:\Builds\wxWidgets-2.9.3\lib\gcc_dll -lwxmsw29u_richtext -lwxmsw29u_gl -lopengl32 -lglu32 -lwxmsw29u_media -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 C:\usr\local\src\haskell\wxhaskell-dev\wxhaskell-2.9\wxcwx-config --libs returns -mthreads -LD:\Builds\wxWidgets-2.9.3\lib\gcc_dll -lwxmsw29u_html -lwxmsw29u_adv -lwxmsw29u_core -lwxbase29u_xml -lwxbase29u_net -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lw xregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 Missing base libraries in red. I'll try to fix this tomorrow. Quick status update - it's a bit more involved than I thought. I have coded most of the changes needed to wx-config-win, but need to get them working. C++ isn't like Haskell where things work first time once they compile, you know :-) ETA for wx-config-win update is now Friday night (GMT) - I have several commitments tomorrow, so I won't do very much, I suspect. Jeremy -- 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___ wxhaskell-devel mailing list wxhaskell-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel
Re: [wxhaskell-devel] The 'making wxC build on all platforms thread
On 17 January 2012 21:38, Jeremy O'Donoghue jeremy.odonog...@gmail.comwrote: Hi all, I have collected together all of the people who I know are making the effort to build Dave's latest code on different platforms. I'd also like to introduce Andrej, who is testing wxC in the context of D (so could we go easy on the Zygohistomorphic Premorphisms and other deep Haskell-ism in this thread :-) I'd suggest that we try to pull together all of the experiences into a single thread - makes it easier for people to keep up. For the moment, I'd like to bring up my experience with wxC on Windows: First, you need at least a patch to wx-config-win32 which sorts out library names (msys libraries are incorrectly named due to a 2.8/2.9 change) At line 948 of wx-config-win.cpp, you need: if (cfg[BUILD] == “debug” cfg[DEBUG_FLAG] == “default”) po[WXDEBUGFLAG] = “”; if (cfg[DEBUG_FLAG] == “1″) po[WXDEBUGFLAG] = “”; Second, in wxc/Setup.hs you need to change line 82 (just after output readProcess “wx-config” [--libs, std,gl,stc,xrc,richtext,aui,media, --cppflags] “” This is needed because wx-config-win does not support the new ‘all’ flag, and I haven’t had time to fix wx-config-win properly. Third, the library then builds for me, but fails to link (link errors in StyledTextCtrl). I hope to work out why tonight or tomorrow. I've worked out why, but haven't fixed it. wx-config-win doesn't know about some of the new libraries, and is giving incorrect results in other cases. I don't have time to fix this tonight, but: C:\usr\local\src\haskell\wxhaskell-dev\wxhaskell-2.9\wxcwx-config --libs base,gl,xrc,richtext,aui,media returns -mthreads -LD:\Builds\wxWidgets-2.9.3\lib\gcc_dll -lwxmsw29u_richtext -lwxmsw29u_gl -lopengl32 -lglu32 -lwxmsw29u_media -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 C:\usr\local\src\haskell\wxhaskell-dev\wxhaskell-2.9\wxcwx-config --libs returns -mthreads -LD:\Builds\wxWidgets-2.9.3\lib\gcc_dll -lwxmsw29u_html -lwxmsw29u_adv -lwxmsw29u_core -lwxbase29u_xml -lwxbase29u_net -lwxbase29u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lw xregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 Missing base libraries in red. I'll try to fix this tomorrow. Regards Jeremy -- 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___ wxhaskell-devel mailing list wxhaskell-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel