[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Data packages tracker



Hi.

This evening (@DebConf11) I finally found the time to implement in
haskell-devscript a feature that I miss since quite a few time: data
packages tracking.

The problem arises when some library package needs to ship some data
needed by the library itself: since all libraries are statically linked,
the final executable package doesn't depend on the library, so it's not
enough to put such data in the library package (or in some package on
which the library depends). Thus we need to have some infrastructure
that allows libraries to declare some packages as data packages;
moreover, it has to make executable packages automatically depending on
data packages declared by dependencies, without putting the burden of
tracking such dependencies on the maintainer.

For instance, this happens between gitit and its dependencies pandoc and
filestore. So far I had to manually add pandoc and filestore as
dependencies of gitit. Now this happens automatically. Here is how you
have to use such feature.

 * When declaring a data package (example: filestore): simply add
DEB_GHC_DATA_PACKAGES variable to debian/rules with the needed dependencies:

DEB_GHC_DATA_PACKAGES := libghc-filestore-data (>= $(CABAL_VERSION))

 * When building an application that could use data packages: add
${haskell:Data-Depends} to the Depends: field; moreover, if it doesn't
get run automatically by hlibrary.mk, you also have to call
dh_haskell_depends -p<package> (for example, this is needed for gitit,
since the name "gitit" isn't automatically detected by hlibrary.mk).

Maybe there is some way to even remove such requirements (merging
${haskell:Data-Depends} in ${haskell:Depends} and automatically calling
dh_haskell_depends for all packages), but this would require some more
work and I prefer to do just one bit a time.


Please, let me know your opinions and comments about my patches.
Unfortunately haskell-devscripts code is sometimes a bit complicated. I
tried to do as least changes as possible and keep the same style of the
existing code. Of course, all my modifications are on the relevant
repositories (for pandoc, which is on git, I created a dedicated branch).

Thanks, Giovanni.
-- 
Giovanni Mascellani <mascellani@poisson.phc.unipi.it>
Pisa, Italy

Web: http://poisson.phc.unipi.it/~mascellani
Jabber: g.mascellani@jabber.org / giovanni@elabor.homelinux.org

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: