
I'm in the process of moving the X11 libraries over from hslibs into fptools/libraries and thought I'd better check I'm doing it the approved way before I commit.
At present, I'm modelling my infrastructure (Makefiles, directory structure, etc) on the HOpenGL infrastructure so, naturally, I'm putting it in fptools/libraries/X11 and have the following modules:
module X11 -- reexports X11.Types and X11.Xlib module X11.StdDIS module X11.Types module X11.Xlib
The X11 module lives in fptools/libraries/X11.hs. The X11 library is only built if GhcLibsWithX11 is set.
The X11 library is covered by the same license as GHC, Hugs, etc.
1) Is this the right place to put X11 in the directory tree or should I put it under libraries/base or some other existing directory?
fptools/libraries/X11 is fine. This will mean that X11 becomes a separate package in GHC-speak, but that's what we want.
2) Is this the right place to put the X11 module in the hierarchial namespace?
According to the current hierarchy document[1] we have these libraries under Graphics.X11.Xlib. Perhaps these names would be correct: Graphics.X11.Xlib Graphics.X11.Xlib.Types Graphics.X11.X1ib.StdDIS The reason for separating Xlib into its own hierarchy is that there are other APIs under X11 (Xt, Xaw, Xmu). We could follow the convention of having the parent export the children though, and have Graphics.X11 export the contents of Graphics.X11.Xlib.
I'm hoping to get round to moving the Win32 and HGL libraries over pretty soon as well so whatever answer you give should apply to them too.
Win32 is currently listed as being under System.Win32. However, since we've just put Dotnet at the top of the hierarchy, and Win32 contains a range of both systems and graphics stuff, I'd be happy for it to be at the top of the hierarchy too. HGL is assigned Graphics.HGL, which seems like the right thing.
ps The makefiles seem to be entirely for GHC usage but we will want to build X11 and Win32 for Hugs and NHC as well. Since we already have makefiles and other scripts for doing this (Hugs only at present), the easy way to do this would be to copy over the existing scripts and completely ignore the fptools Makefile infrastructure - but it would perhaps be nicer if we could easily exploit the existing infrastructure.
Not sure what you mean here. Can't you use the existing mechanisms that Hugs uses to get access to the rest of the libraries? That way we can have fptools Makefiles too, and the X11 lib will build for GHC. The NHC folks seem to be using their own Makefiles, called Makefile.nhc98.
(This applies to all the existing stuff in fptools/libraries/base too - the Hugs distro contains stuff to compile all the files that contain ffi code but this largely replicates the instructions from the fptools makefile.)
pps Should I continue the unsavoury practice of committing GreenCard generated code to the repository? (Currently done for Win32, I'd do it for Xlib too for the sake of consistency.)
I think the reason for this was that we could avoid a greencard dependency in a GHC build. I'm agnostic really, since we probably won't be including X11 in the default GHC build (see previous discussions about why we want to tighten up the set of libraries that GHC is shipped with). Cheers, Simon [1] fptools/libraries/doc/lib-hierarchy.html, and http://www.haskell.org/~simonmar/lib-hierarchy.html

According to the current hierarchy document[1] we have these libraries under Graphics.X11.Xlib. Perhaps these names would be correct:
Graphics.X11.Xlib Graphics.X11.Xlib.Types Graphics.X11.X1ib.StdDIS
The reason for separating Xlib into its own hierarchy is that there are other APIs under X11 (Xt, Xaw, Xmu).
That makes sense except that I didn't tell you enough about Types and StdDIS. Types contains generic X11 types (which would be used by Xt, Xaw, etc). StdDIS contains generic GreenCard definitions and would also be used by Xt, etc. So I see things developing as follows: Graphics.X11 -- reexports all children except StdDIS Graphics.X11.StdDIS -- should be shared by all GC'd files Graphics.X11.Types -- shared by all X11 impls Graphics.X11.Xlib Graphics.X11.Xt Graphics.X11.Xaw Graphics.X11.Xmu [StdDIS is just a copy of the file included in GreenCard distributions and would go away if we were to do the sensible thing and have a single StdDIS somewhere in the libraries tree.]
We could follow the convention of having the parent export the children though, and have Graphics.X11 export the contents of Graphics.X11.Xlib.
That's the plan. The only one not reexported is StdDIS since that provides definitions which are internal to the other modules.
I'm hoping to get round to moving the Win32 and HGL libraries over pretty soon as well so whatever answer you give should apply to them too.
Win32 is currently listed as being under System.Win32. However, since we've just put Dotnet at the top of the hierarchy, and Win32 contains a range of both systems and graphics stuff, I'd be happy for it to be at the top of the hierarchy too.
I think I'd prefer both to be under System.
HGL is assigned Graphics.HGL, which seems like the right thing.
Ok, I'll put it there.
The NHC folks seem to be using their own Makefiles, called Makefile.nhc98.
I'll probably do the same. Hmmm, I wonder if the existing scriptMakefile used by Hugs to convert and compile the libraries should be moved into libraries/base ?
pps Should I continue the unsavoury practice of committing GreenCard generated code to the repository? (Currently done for Win32, I'd do it for Xlib too for the sake of consistency.)
I think the reason for this was that we could avoid a greencard dependency in a GHC build. I'm agnostic really, since we probably won't be including X11 in the default GHC build (see previous discussions about why we want to tighten up the set of libraries that GHC is shipped with).
I gather that the Win32 library is needed for windows version of GHC so it's a bit moer of an issue there... I'll avoid doing it for X11 for now. -- Alastair
participants (2)
-
Alastair Reid
-
Simon Marlow