Experience with cabal-debian

So, after receiving several pointers to seereason’s cabal-debian tool I thought I’d take it for a spin. ((I did pull down autobuilder as well, but didn’t feel I had enough time to explore it tonight.))

After about 30 minutes of browsing through HackageDB and seereason’s source repos, building and installing, I had finally satisfied all dependencies and the build of cabal-debian succeeded. (Oh, BTW, seereason people, it’s really confusing that you have a package called debian among your source repos, when there already is a different debian package on HackageDB. Please consider renaming it!) I decided to take the tool for a spin on my own package, dataenc.

The result was fairly good. It seems the generated files depend on some packages that either aren’t in Debian or that the people at seereason have modified. With the following changes to the generated files I was happy with the contents of ./debian and I successfully built an (almost) autogenerated Debian package:

  1. Download hlibrary.mk into ./debian.
  2. Modify ./debian/rules so that hlibrary.mk is loaded from $(CURDIR)/debian/hlibrary.mk.
  3. Delete ./debian/libghc6-dataenc-doc.post*.
  4. Remove cabal-debian and haskell-devscripts-cdbs from the build dependencies in ./debian/control.

I’ll try to find the time to put those changes into cabal-debian itself. Then I’d have a rather nice tool for building Debian packages automatically.

David Fox

There are a few nice things about haskell-devscripts-cdbs that I should mention. It contains a modified version of hlibrary.mk with a number of improvements, and it also has some related features outside of hlibrary.mk:

  • First of all, having hlibrary.mk in a package means you don’t have copies of it in every package you build, avoiding synchronization problems.
  • It handles ^M characters which occur in some .cabal files, these can otherwise get captured in the version number.
  • It integrates the documentation package into the shared tree in /usr/share/doc/ghc6-doc with postinst and prerm scripts to call gen_contents index.
  • It augments the substvar support so that ${haskell:Depends} expands to the correct list of library packages for each binary package.
  • If cabal-debian is installed during the build, hlibrary.mk will use it to verify that all the libraries mentioned in the cabal file are indeed installed, and if one isn’t it will figure out which deb needs to be installed and throw an error.

Jeremy Shaw

The debian package on hackageDB is from seereason.com as far as I know? But I think I need to update it.

haskell-devscripts-cdbs provides hlibrary.mk as well as some bug fixes to haskell-devscripts that fix various issues building documentation using haddock 2.x and other stuff.

The build dependency on cabal-debian is there because the version of hlibrary.mk in haskell-devscripts-cdbs calls cabal-debian during the build to generate the correct install dependencies.

I am not sure why you removed the -doc.post files. If you apt-get remove the -doc package, then you will want to rebuild the haddock index and cross-references so that they no longer refer to non-existent documentation files. (the packages built by cabal-debian properly register so that they show up in /usr/share/doc/ghc6-doc/index.html and friends).

So, in summary, none of the changes you made are normally required (or advised). Clearly, making cabal-debian easier to install correctly is the first step. It works fine when you apt-get it from the seereason.com repositories, but building from source leaves something to be desired. (Namely, knowing what to build and were to find it).

I will make some time to ensure that everything is up-to-date on hackage, and to see if I we can get the required changes into haskell-devscripts. That way you can just get all the source from hackageDB and not have to fish around our darcs repo.

David is currently in the process of making sure that everything works with GHC 6.10. One of the changes is to patch haskell-devscripts directly instead having the modifications in haskell-devscripts-cdbs (which replaced the files in haskell-devscripts).

There is a quilt target for patching haskell-devscripts here: http://src.seereason.com/ghc610/quilt/haskell-devscripts-quilt/

If you are interested, I can privately send you information on how to join our chatroom so you can ask us question directly instead of reverse engine what you need.

Leave a comment