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

Re: Packaging non-library Haskell



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Somebody signing messages as Joachim Breitner wrote:
>> *-doc by the existing logic, README and similar docs seem to be put in the
>> main package, which seems correct to me.  Binaries are copied by the logic
>> I'm prototyping.  So that leaves "everything else".  I should experiment
>> with a more complex Haskell application, like maybe darcs.
>
>haskell-hledger-web is an example for a package that needs extra data
>(and that is broken in that regard right now):
>http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668622
>
>hlint also requires data files, and so does threadscope.

hlint seems to install ghc libraries as well.  Is this intentional?  It 
seems that if the libraries are wanted, they should go in a libghc-hlint-dev 
package, seperate from the utility package containing the binary.

If this is the case, then the following builds hlint:

#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/hlibrary.mk

# If no threaded RTS is found, disable it
DEB_SETUP_GHC_CONFIGURE_ARGS := $(shell test -e /usr/lib/ghc-$(GHC_VERSION)/libHSrts_thr.a || echo --flags=-threaded)

build/$(CABAL_PACKAGE):: build-ghc-stamp

install/$(CABAL_PACKAGE):: debian/tmp-inst-ghc
	cd debian/tmp-inst-ghc ; find usr/bin/ \
		-exec install -Dm 755 '{}' ../$(notdir $@)/'{}' ';'
	cd debian/tmp-inst-ghc ; find usr/share/$(notdir $@)* \
		-exec install -Dm 644 '{}' ../$(notdir $@)/'{}' ';'
	mkdir -p debian/$(notdir $@)/usr/share/emacs/site-lisp
	mv debian/$(notdir $@)/usr/share/$(notdir $@)*/hs-lint.el debian/$(notdir $@)/usr/share/emacs/site-lisp
	install -Dm 644 hlint.htm debian/$(CABAL_PACKAGE)/usr/share/doc/$(CABAL_PACKAGE)/hlint.html

The DEB_SETUP_GHC_CONFIGURE_ARGS thing is sort of more general, but I'm not 
sure what the right way to handle that is.  Maybe a DEB_GHC_TRY_THREADED=1 
sort of thing?

You'll note that the only addition over my usr/bin/ copyer from before is an 
alsmost identical command for user/share/$(notdir $@)*

After that comes two lines to install an emacs lisp file to the correct 
location.  I'm not sure if there's a way to make that more general.

Finally, a line to install an extra documentation file.  Since the *.cabal 
does not know that this file is documentation, and it does not have a name 
that immidiately identifies it as documentation (like README), I think 
something custom is going to be required for that case no matter what.

Replacing the threadscope debian/rules with the above (minus the emacs and 
docs line) allows all the lines except the *.xpm and *.desktop lines to be 
removed from the threadscope *.install

So, little bits of custom install remain in both, but this seems to be to be 
the right sort of direction.

- -- 
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJPkDnkAAoJENEcKRHOUZzesOYP/iAyR4ek7GRnU17l95wqN6QP
vyVi3qRBDGF62q6cc4+EJmyMhZRoZ7A/CU9G9rVMLByPFWwA7xNNIahjERZ6/wZm
nBoHDL6eIiLvqe5Ptkn7f0Ca9fdvY2JpcayijQKgG3uP3eTZYDJWBK6BTYvZdQrn
lqYmz9btEjcDmw+7k3Gyd1KAMA6jhW/EUPmVLrxemuypngrJLnLFx2OONk42GuBY
W4dcIwn2jP3qnOxZ7BA7RzAhVe74GPJGSDHPSdjA/JDqH6tq24KtoSAa4WKWdvNQ
sHXNcu2w5zamfBO+TyxJGxJ+WrhAqps5ikg5ZKAk4UuV5pzWuhw21y+LUSjmPz/A
5bQq+vqf5YHhybfznbI6yPYOpGZjNh75guqRIB1fejS+bw4NFIeYw79EL7ti3syj
Ml6W0ZVPhyxWTND3OqCqooGA6yR2dR3FtE9fu/CEPLIQLXgUSUSu7MLHOL1Nqnfp
VVGRQBalRtiBxY5QMuqnAcDRZPNbvvylBf9YlEdtZAx6h3xc0x0IRYpI7GNwMdwN
Tjc0zwuxVxMMiw7co0ed3+AyHUy2rhEIHt8Nxe86jlMDHVYpDUYSSx8lUXv9gZ+X
w9NmwB4Xn+j8ou8j4O8gXEzeYstP0b63gSZDzd+meMYAKIcR6MpCPVYpOzXBZt/Z
PS0TF2Q4NhnLNIqCy2LI
=W7eA
-----END PGP SIGNATURE-----


Reply to: