ddssff / cabal-debian

Create a Debianization by examining a .cabal file.
Other
16 stars 10 forks source link

cabal-debian "confuses" library name and apt dependency #58

Closed ivanperez-keera closed 7 years ago

ivanperez-keera commented 7 years ago

I'm writing a program that uses sdl-mixer.

(The dependency on SDL_mixer is not explicit in sdl-mixer's cabal file. I need to add that to my program's cabal file unfortunately. But that is not the point.)

I added SDL_mixer as an extra library to my cabal file.

  extra-libraries: SDL_mixer

That's because:

$ pkg-config --list-all | grep SDL_mixer
SDL_mixer                      SDL_mixer - mixer library for Simple DirectMedia Layer

But cabal-debian generates a control file containing the following:

Source: keera-posture
Maintainer: Ivan Perez <ivan.perez@keera.co.uk>
Priority: extra
Section: haskell
Build-Depends: debhelper (>= 9),
 haskell-devscripts (>= 0.8),
 cdbs,
 ghc,
 ghc-prof,
 <bunch of dependencies>,
 libsdl_mixer-dev,
Standards-Version: 3.9.6
Homepage: http://keera.co.uk/projects/keera-posture
X-Description: Get notifications when your sitting posture is inappropriate.
 A program that notifies you when you sit in a straining position.
<and a lot more...>

I'd like to generate the debian files automatically from the package every time (I think it's better than having them in the repo.

Any clues as to how to address this issue?

Thanks in advance!

ddssff commented 7 years ago

Hi. You can alter the mapping from cabal "extra-libraries" name to debian package name using cabal-debian's --dep-map flag:

cabal-debian --dep-map SDL_mixer:mysdlmixerlib

will put mysdlmixerlib into the Depends list.

ivanperez-keera commented 7 years ago

Oh, that's great. Thanks for responding so quickly.

I think that solves my problem then. I'll close and re-open if necessary.