
Is there a version of HDirect available for GHC 5.04? Ideally a binary distribution, but if source is available with step-by-step instructions on building and installing it (I'm most definitely *not* an expert in such things!), then that would do as well. My reason for wanting this is to be able to try driving COM components from Haskell, as described in the "Calling Hell From Heaven And Heaven
From Hell" document. I assume HDirect is the best way of doing this?
I looked through recent posts on the list, and couldn't see any information on this... Thanks for any help, Paul Moore. PS A long while back, I played with HaskellScript. Looking at the site, it hasn't been updated in a long while. Is HaskellScript dead, and if so is there anything which covers the same functionality for GHC (particularly the COM libraries etc - I'm not that bothered about the WSH support). Or is that what HDirect covers?

Hi there,
sorry about the delay in replying, but
http://galois.com/~sof/hdirect-0.19-src.tar.gz
contains a source snapshot that works with 5.04.
Building it isn't hard...if it turns out to be, please
let me know.
Re: HDirect vs HaskellScript's libraries -- the HDirect
COM support libraries covers the functionality of
the old HaskellScript ones (and more), but by default,
no object model-specific modules are included with
HDirect (e.g., IE, Word, Excel etc.) They're easy
enough to either generate from type libraries or write
out by hand though.
--sigbjorn
----- Original Message -----
From: "Paul Moore"
Is there a version of HDirect available for GHC 5.04? Ideally a binary distribution, but if source is available with step-by-step instructions on building and installing it (I'm most definitely *not* an expert in such things!), then that would do as well.
My reason for wanting this is to be able to try driving COM components from Haskell, as described in the "Calling Hell From Heaven And Heaven
From Hell" document. I assume HDirect is the best way of doing this?
I looked through recent posts on the list, and couldn't see any information on this...
Thanks for any help, Paul Moore.
PS A long while back, I played with HaskellScript. Looking at the site, it hasn't been updated in a long while. Is HaskellScript dead, and if so is there anything which covers the same functionality for GHC (particularly the COM libraries etc - I'm not that bothered about the WSH support). Or is that what HDirect covers?

"Sigbjorn Finne"
sorry about the delay in replying, but
http://galois.com/~sof/hdirect-0.19-src.tar.gz
contains a source snapshot that works with 5.04. Building it isn't hard...if it turns out to be, please let me know.
Thanks for the snapshot. I struggled at first until I realised that the build was supposed to be run under Cygwin... After that it went fine.
Re: HDirect vs HaskellScript's libraries -- the HDirect COM support libraries covers the functionality of the old HaskellScript ones (and more), but by default, no object model-specific modules are included with HDirect (e.g., IE, Word, Excel etc.) They're easy enough to either generate from type libraries or write out by hand though.
Great. I'll look into that. Thanks a lot, Paul.

"Sigbjorn Finne"
http://galois.com/~sof/hdirect-0.19-src.tar.gz
contains a source snapshot that works with 5.04. Building it isn't hard...if it turns out to be, please let me know.
Spoke too soon. The build went fine, but when I tried installing the packages, I got the following error: bash-2.05$ cd lib bash-2.05$ make install-pkg Reading package info from stdin... done. Expanding embedded variables...done. `' doesn't exist or isn't a directory Unable to install 'hdirect' package for GHC - perhaps GHC isn't installed. Try running ghc-pkg utility "ghc-pkg -a < /HDirect.pkg" when GHC is installed. I have GHC installed (from the Windows installer). Running the ghc-pkg command manually didn't help. (Nor did using "HDirect.pkg" rather than "/HDirect.pkg" - isn't the initial slash wrong?) I'm not sure where to go next - I don't understand ghc-pkg, so if there's any information I can provide which might help, let me know. Thanks, Paul. PS In case it helps, here's HDirect.pkg: Package { name = "hdirect", import_dirs = [""], source_dirs = [], library_dirs = [""], hs_libraries = ["HShdirect"], extra_libraries = ["kernel32"], include_dirs = [""], c_includes = [], package_deps = ["base","lang"], extra_ghc_opts = [], extra_cc_opts = [], extra_ld_opts = []}

Thanks, fixed in the current sources. To make it
work for you, you need supply defns of libdir
and datadir when doing 'install-pkg', e.g.,
foo$ make install-pkg libdir=`pwd` datadir=`pwd`
(make sure you remove HDirect.pkg first.)
This is all somewhat academic to you though, as you're
really just interested in the COM version of the libraries
in comlib/ (for which 'make install-pkg' does the right thing.)
--sigbjorn
----- Original Message -----
From: "Paul Moore"
"Sigbjorn Finne"
writes: http://galois.com/~sof/hdirect-0.19-src.tar.gz
contains a source snapshot that works with 5.04. Building it isn't hard...if it turns out to be, please let me know.
Spoke too soon. The build went fine, but when I tried installing the packages, I got the following error:
bash-2.05$ cd lib bash-2.05$ make install-pkg Reading package info from stdin... done. Expanding embedded variables...done. `' doesn't exist or isn't a directory Unable to install 'hdirect' package for GHC - perhaps GHC isn't installed. Try running ghc-pkg utility "ghc-pkg -a < /HDirect.pkg" when GHC is installed.
I have GHC installed (from the Windows installer). Running the ghc-pkg command manually didn't help. (Nor did using "HDirect.pkg" rather than "/HDirect.pkg" - isn't the initial slash wrong?)
I'm not sure where to go next - I don't understand ghc-pkg, so if there's any information I can provide which might help, let me know.
Thanks, Paul.
PS In case it helps, here's HDirect.pkg:
Package { name = "hdirect", import_dirs = [""], source_dirs = [], library_dirs = [""], hs_libraries = ["HShdirect"], extra_libraries = ["kernel32"], include_dirs = [""], c_includes = [], package_deps = ["base","lang"], extra_ghc_opts = [], extra_cc_opts = [], extra_ld_opts = []}

"Sigbjorn Finne"
Thanks, fixed in the current sources. To make it work for you, you need supply defns of libdir and datadir when doing 'install-pkg', e.g.,
foo$ make install-pkg libdir=`pwd` datadir=`pwd`
(make sure you remove HDirect.pkg first.)
Hm. This actually puts Cygwin-format pathnames in HDirect.pkg (/cygdrive/c/...) which (the Windows native) GHC doesn't recognise.
This is all somewhat academic to you though, as you're really just interested in the COM version of the libraries in comlib/ (for which 'make install-pkg' does the right thing.)
The comlib version also ends up with Cygwin-format pathnames, so has the same problem. [Why do you say I'm not going to be interested in the "lib" stuff? I've not really fully understood the difference between the two parts yet...] On a not-really-related note, this leaves the GHC installation pointing at where I unpacked HDirect (ie, "install-pkg" doesn't install the package, in the sense of copying it into a central location, it just sets up pointers). A note in the documentation would be useful here, as I unpacked the tarball into a temporary directory and built there - if I hadn't noticed this issue from investigating the above problem, I'd have deleted my temporary directory after the install, and posted lots more "it doesn't work" messages... :-) Is it possible to "install" HDirect, possibly even under the GHC directory tree? Which files are needed for this? Just the .hi files? Thanks once again for all the support with this. Paul.

"Paul Moore"
foo$ make install-pkg libdir=`pwd` datadir=`pwd`
(make sure you remove HDirect.pkg first.)
Hm. This actually puts Cygwin-format pathnames in HDirect.pkg (/cygdrive/c/...) which (the Windows native) GHC doesn't recognise.
.... You normally just sidestep that bash 'pwd' bug/idiosyncracy by issuing a "cd" command of the form "cd c:/your/hdirect/directory" to have it switch over to reporting paths in non-cygdrive form (== likeable to GHC and other mingw apps.) --sigbjorn
participants (2)
-
Paul Moore
-
Sigbjorn Finne