3 Apr 2008 06:07
Re: building a helper binary with cabal
Evan Martin <martine <at> danga.com>
2008-04-03 04:07:32 GMT
2008-04-03 04:07:32 GMT
I got caught up in other things, so I'm also late to reply.
Here's the whole story now, so you don't have to reskim the archive.
My program has a helper executable that's built with gcc. I want to
install it alongside my Haskell binary. I can write a post-copy hook
like this:
> creplChildCopy :: Args -> CopyFlags -> PackageDescription
> -> LocalBuildInfo -> IO ()
> creplChildCopy args flags desc buildinfo = do
> print "copy hook"
> let dirs = absoluteInstallDirs desc buildinfo (copyDest flags)
> print ("copying child to ", libexecdir dirs </> creplChildName)
> copyFileVerbose (copyVerbose flags) (creplChildPath buildinfo)
> (libexecdir dirs </> creplChildName)
And then run it like this:
$ ./Setup.lhs copy -v3
directory dist/doc/html/c-repl does exist: False
Creating /home/martine/.local/share/doc/c-repl-0.1 (and its parents)
copy LICENSE to /home/martine/.local/share/doc/c-repl-0.1/LICENSE
Installing: /home/martine/.local/bin
Creating /home/martine/.local/bin (and its parents)
copy dist/build/c-repl/c-repl to /home/martine/.local/bin/c-repl
"copy hook"
("copying child to ","/home/martine/.local/libexec/c-repl-child")
copy dist/build/c-repl-child to /home/martine/.local/libexec/c-repl-child
Setup.lhs: /home/martine/.local/libexec: copyFile: does not exist (No
such file or directory)
(Continue reading)
RSS Feed