From: Jeremy O'D. <jer...@gm...> - 2007-08-20 15:02:59
|
Hi all, I'm tearing my hair out trying to think of the best way forward for modularizing parts of wxHaskell. The problem currently shows itself mainly with STC, although over time I'd expect to see this more often. Currently, the build system works (hand-wavingly) as follows: 1) Build wxC wrapper for wxWidgets. Building this is really quite dependent on how wxWidgets itself was built, which is OK on Unix (wx-config tells you), but subject to much pain and guesswork on Windows. STC support is built at this time. If STC is not present in the wxWidgets build, the wxSTC functions are all empty (but present). 2) Build wxdirect 3) Run wxdirect over wxC to generate Haskell bindings. This means that empty Haskell bindings are produced for the empty functions wrapping wxSTC (if it isn't built on wxWidgets). 4) Build and install wxcore 5) Build and install wx. This, again, contains hooks for the (possibly not functional) STC. This sort-of hangs together while we only have one 'contrib' module to worry about, but it would become a maintenance nightmare if there were ever to be more (of them (e.g. if I ever finish the build system, I'd like to take a look at XRC support). I'd prefer that there be an 'approved' way for people to add support for additional wx functionalities without deep build system hacking. The problem is that everything I think will mean considerable changes to the way contributed modules are supported. This is what I'm thinking: Add a new 'contrib' directory for optional wxHaskell functionality. This would contain one directory per contributed module. Each contrib module would look something like the following: module_name |- Makefile |--- wxc | |- Makefile | |- src | |- include | |--- wxcore | |- Makefile | |- src - Graphics - UI - WxCore | |--- wx |- Setup.hs |- module_name.cabal |- src - Graphics - UI - Wx In the end, each contributed module would need to provide three things: a C language wrapper for the wxWidgets functionality in question (wxc); support for a basic Haskell wrapper over the C (wxcore), and (optionally) a higher-level Haskell functional wrapper (wx). The build system would be more or less a plug-in template in each case, with the contributor only needing to change the names of the provided files. The contributed module would appear as two Haskell modules, e.g. WxSTCCore and WxSTC after installation. I'd like to invite comments before I do all of this, as it's quite a lot of work, and it will change a lot about the way STC (as the first contrib module) is compiled. It will, however, mean that future contributions will be easier as people would need only to work in a single directory structure. I think the only viable alternative is to very carefully and explicitly state how wxWidgets must be built to support wxHaskell (this would realistically mean only one supported configuration per platform), and make *very* sure we provide binary installers for wxWidgets with such a configuration as part of our distribution (note that this would probably preclude Linux users from using the wxWidgets provided by their package manager as the chances would be pretty high that it would be incorrectly configured). Regards Jeremy |
From: shelarcy <she...@gm...> - 2007-08-21 04:10:37
|
Hi Jeremy, On Mon, 20 Aug 2007 23:48:38 +0900, Jeremy O'Donoghue <jer...@gm...> wrote: > 1) Build wxC wrapper for wxWidgets. Building this is really quite > dependent on how > wxWidgets itself was built, which is OK on Unix (wx-config tells > you), but subject > to much pain and guesswork on Windows. > STC support is built at this time. If STC is not present in the > wxWidgets build, > the wxSTC functions are all empty (but present). I think we can solve this problem by modifying wxc-*.dsw. If we write "Project Dependency" on dsw file, Visual C++ build dependency before build wxc. (But we must use "Unicode **" instead of "**". See attached wxcu-2.6.4.dsw and doc-fix.dpatch.) It look fine for me, so I planed to remove --with-contrib and requiring to install contrib library as 2. option in this thread. http://thread.gmane.org/gmane.comp.lang.haskell.wxhaskell.general/199/focus=249 The problem is that we can't use nmake, because building on Windows deeply depends on Visual C++ project files. But we can generate Visual C++ project (.dsp) file instead of make.nmake. I also attached GenVCProject.hs that is Visual C++ project file generator. (That code is messy now, but we can refactor it. And It is easier to modifying .dsp file by using that.) > (note > that this would probably preclude Linux users from using the wxWidgets > provided by their package manager as the chances would be pretty high > that it would be incorrectly configured). I have a question about that, so I send previous mail. Best Regards, -- shelarcy <shelarcy hotmail.co.jp> http://page.freett.com/shelarcy/ |
From: Jeremy O'D. <jer...@gm...> - 2007-08-21 08:32:40
|
HI Shelarcy, On 21/08/07, shelarcy <she...@gm...> wrote: > > The problem is that we can't use nmake, because building on Windows > deeply depends on Visual C++ project files. I've actually already almost solved this. I've factored out the wxc build from the top level makefile(*) and made it compatible with Visual Studio 2005 command line tools as well as GCC. This will enable a single makefile to be used for building wxC on all hosts OS. The Visual Studio project files are awkward to maintain because they require editing depending on the file locations chosen on build machine, and require irritating small changes whenever the underlying wxWidgets version changes. It has required a lot of work to get this working for all cases (I haven't rolled out the patch as I don't consider it fully tested as yet), but I do think that it represents a more easily maintainable way forward. What I'm trying to get to is a top level build system where all the user needs to do (once wxWidgets installed) is: runghc Setup.hs configure runghc Setup.hs build runghc Setup.hs install i.e. it will look just like a Cabal build even though large parts of the build are actually Makefiles. This should make things much simpler for newcomers as it's the same set of build commands as used on most Haskell projects these days. I'm more than 90% finished with this, and when it comes along it will represent a pretty large patch (so maybe Eric will be glad not to have to do a detailed review :-) on the build system. Regards Jeremy (*) There's a secondary reason for factoring out the wxc build from the wxHaskell build: a number of other languages (most of them in the FP church, if you define it reasonably broadly) use wxC as the basis for their wxWidgets bindings. In pretty much every case, the original Eiffel wxC implementation was forked, and then no-one has really maintained the C bindings. The wxHaskell implementation of wxC is far and away the most mature and best maintained C binding to wxWidgets (I checked the others - looking to see if we could bring in any code). By making wxC buildable separately from wxHaskell, maintainers of other wxWidgets bindings can make use of wxC more readily, and hopefully we can encourage maintainers of the other language bindings to contribute improvements to the C bindings in a single place... to the benefit of wxHaskell. |
From: Eric K. <eri...@gm...> - 2007-08-21 08:38:40
|
SGkgSmVyZW15LAoKPiAoKikgVGhlcmUncyBhIHNlY29uZGFyeSByZWFzb24gZm9yIGZhY3Rvcmlu ZyBvdXQgdGhlIHd4YyBidWlsZCBmcm9tCj4gdGhlIHd4SGFza2VsbCBidWlsZDogYSBudW1iZXIg b2Ygb3RoZXIgbGFuZ3VhZ2VzIChtb3N0IG9mIHRoZW0gaW4gdGhlCj4gRlAgY2h1cmNoLCBpZiB5 b3UgZGVmaW5lIGl0IHJlYXNvbmFibHkgYnJvYWRseSkgdXNlIHd4QyBhcyB0aGUgYmFzaXMKPiBm b3IgdGhlaXIgd3hXaWRnZXRzIGJpbmRpbmdzLgoKQXJlIHlvdSBhd2FyZSBvZiB0aGUgd3hjIHBy b2plY3QgYnkgYW55IGNoYW5jZT8KCmh0dHA6Ly93eGMuc291cmNlZm9yZ2UubmV0LwoKV2UgaGFk IGRpc2N1c3NlZCBwb29saW5nIG91ciByZXNvdXJjZXMgYXQgc29tZSBwb2ludCwgYnV0IGRlY2lk ZWQgdGhlCmJlc3QgdGhpbmcgd2FzIHRvIHByaW9yaXRpc2UgYSB3eGhhc2tlbGwgcmVsZWFzZSBh bmQgdGhlbiB0YWxrIGFib3V0CndvcmtpbmcgdG9nZXRoZXIuCgotLSAKRXJpYyBLb3cgICAgICAg ICAgICAgICAgICAgICBodHRwOi8vd3d3LmxvcmlhLmZyL35rb3cKUEdQIEtleSBJRDogMDhBQzA0 RjkgICAgICAgICBNZXJjaSBkZSBjb3JyaWdlciBtb24gZnJhbsOnYWlzLgo= |
From: Jeremy O'D. <jer...@gm...> - 2007-08-21 09:17:17
|
Hi Eric, On 21/08/07, Eric Kow <eri...@gm...> wrote: > Hi Jeremy, > > > (*) There's a secondary reason for factoring out the wxc build from > > the wxHaskell build: a number of other languages (most of them in the > > FP church, if you define it reasonably broadly) use wxC as the basis > > for their wxWidgets bindings. > > Are you aware of the wxc project by any chance? > > http://wxc.sourceforge.net/ I'm aware of it, and at least the following others: wxCL (Common Lisp), wxCaml (Ocaml) > We had discussed pooling our resources at some point, but decided the > best thing was to prioritise a wxhaskell release and then talk about > working together. I looked at what has been done on wxC. The main thing they seem to have done is to replace the build system with Ant, which seems like a retrograde step to me (Ant is great in the Java world, but it's just another dependency to everyone else). I understand the build system frustration for them, but wanted to stick with GNU make as it's present (or trivial to install) on pretty much any Free Software development system. ... and yes, we need to prioritize a release. Regards Jeremy |