
Ross Paterson
There's an opportunity here to make another small extension to the simple build infrastructure, namely to preprocess package descriptions with cpp, possibly using header files generated by the configure step. That would be enough for the simple build to handle packages like X11, HGL, GLUT, OpenGL and OpenAL, where building is system-dependent. Indeed almost all of the packages in fptools/libraries could be handled this way.
Using cpp does not help with many packages, using e.g. programs like foo-config. This is true for at least gtk, fltk, and so on. Also to include the headers containing the definitions on needs system dependent -I options for cpp... Currently I am using a Setup.description.in from which a dummy Makefile creates the real Setup.description: LFL=`fltk-config --libs | xargs dirname` Setup.description: Setup.description.in cp Setup.description.in Setup.description sh -c "[ $(LFL) = /usr/lib ] || echo Extra-Lib-Dirs: $(LFL) >> Setup.description" I don't think there is a really elegant way of doing this. Preprocessing could be done in Setup.lhs too, but isn't that even more dirty?
It would help if (at least) the name, version and maintainer fields allowed optional quotes as Sven suggests, so one could use the PACKAGE_* defines straight from configure. Also, the package description would need a few more fields (extra-ld-opts, extra-cc-opts and extra-frameworks) and a flag to say whether all Haskell sources should be preprocessed with cpp. It would also need to ignore blank lines (as GHC does), because #if's tend to generate quite a few of them, and these are even useful inside fields (e.g. module lists). I realize that this conflicts with the current stanza idea.
There is currently a pending patch to add support for Extra-Lib-Dirs. - Einar Karttunen