[Pkg-haskell-commits] darcs: haskell-devscripts: * Simplify dh_haskell_shlibdeps Instead of building a haskell program and
Joachim Breitner
mail at joachim-breitner.de
Sun Feb 9 20:46:13 UTC 2014
Sun Feb 9 20:45:46 UTC 2014 Joachim Breitner <mail at joachim-breitner.de>
* * Simplify dh_haskell_shlibdeps Instead of building a haskell program and
running dpkg-shlibdeps (which picks up shared library dependencies of
dependencies of this module) instead parse the ghc-pkg information of this
package and use the information from the "extra-libraries" field. Then build
a probe C program linking against these libraries and run dpkg-shlibdeps on
them. (This also removes special handling of libffi and libgmp, and makes it
compatible with ghc-7.8.)
* Prevent dh_shlibdeps to look at libHS* libraries.
M ./debian/changelog +14
M ./dh_haskell_shlibdeps -40 +13
M ./hlibrary.mk +9
Sun Feb 9 20:45:46 UTC 2014 Joachim Breitner <mail at joachim-breitner.de>
* * Simplify dh_haskell_shlibdeps Instead of building a haskell program and
running dpkg-shlibdeps (which picks up shared library dependencies of
dependencies of this module) instead parse the ghc-pkg information of this
package and use the information from the "extra-libraries" field. Then build
a probe C program linking against these libraries and run dpkg-shlibdeps on
them. (This also removes special handling of libffi and libgmp, and makes it
compatible with ghc-7.8.)
* Prevent dh_shlibdeps to look at libHS* libraries.
diff -rN -u old-haskell-devscripts/debian/changelog new-haskell-devscripts/debian/changelog
--- old-haskell-devscripts/debian/changelog 2014-02-09 20:46:13.366362497 +0000
+++ new-haskell-devscripts/debian/changelog 2014-02-09 20:46:13.370362495 +0000
@@ -1,3 +1,17 @@
+haskell-devscripts (0.8.19.4) UNRELEASED; urgency=medium
+
+ * Simplify dh_haskell_shlibdeps
+ Instead of building a haskell program and running dpkg-shlibdeps (which
+ picks up shared library dependencies of dependencies of this module)
+ instead parse the ghc-pkg information of this package and use the
+ information from the "extra-libraries" field. Then build a probe
+ C program linking against these libraries and run dpkg-shlibdeps on them.
+ (This also removes special handling of libffi and libgmp, and makes it
+ compatible with ghc-7.8.)
+ * Prevent dh_shlibdeps to look at libHS* libraries.
+
+ -- Joachim Breitner <nomeata at debian.org> Sun, 09 Feb 2014 20:27:45 +0000
+
haskell-devscripts (0.8.19.3) unstable; urgency=medium
* Run dh_haskell_blurbs on all packages (Closes: #721461)
diff -rN -u old-haskell-devscripts/dh_haskell_shlibdeps new-haskell-devscripts/dh_haskell_shlibdeps
--- old-haskell-devscripts/dh_haskell_shlibdeps 2014-02-09 20:46:13.366362497 +0000
+++ new-haskell-devscripts/dh_haskell_shlibdeps 2014-02-09 20:46:13.378362491 +0000
@@ -2,6 +2,8 @@
# arch-tag: Debhelper script for Haskell
#
# Copyright (C) 2009 Marco Túlio Gontijo e Silva <marcot at debian.org>
+# Copyright (C) 2014 Joachim Breitner <nomeata at debian.org>
+#
# Based on mk-haskell-depends by Martin Sjögren <sjogren at debian.org>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -46,53 +48,24 @@
T_DIR=debian/dh_haskell_shlibdeps
mkdir $T_DIR 2> /dev/null || true
-echo '[]' > $T_DIR/package.conf
+
+args=""
for file in $files
do
- pkg=`echo $file | cut -d/ -f2 | cut -d- -f2- | sed -e 's/-[^-]\+$//'`
- pkgconflocal=$T_DIR/$pkg.package.conf
- cat $file | sed -e \
- "/^\(import\|library\|include\)-dirs: / { \
- s#/usr/lib/haskell-packages#$PWD/debian/libghc-$pkg-dev/usr/lib/haskell-packages#g }" \
- > $pkgconflocal
- ghc-pkg -f $T_DIR/package.conf register $pkgconflocal --force \
- 2>&1 > /dev/null || true
+ for lib in $(grep-dctrl -s extra-libraries -n . < $file)
+ do
+ args="$args -l$lib"
+ done
done
+
+echo 'main () {}' > $T_DIR/probe.c
+gcc $args $T_DIR/probe.c -o $T_DIR/probe
+
for pkg in $pkgs
do
case "$pkg" in
libghc-*-dev)
- sfile=debian/$pkg.substvars
- pkgname=`basename debian/$pkg/usr/lib/haskell-packages/ghc/lib/* | sed -e 's/-[^-]\+$//'`
- touch $sfile
- echo "{-# LANGUAGE NoImplicitPrelude #-}" >$T_DIR/a.hs
- echo "{-# LANGUAGE PackageImports #-}" >>$T_DIR/a.hs
- echo "module Main where" >> $T_DIR/a.hs
- echo "import \"base\" Prelude" >> $T_DIR/a.hs
- echo "main = return ()" >> $T_DIR/a.hs
-
- # We do not want this package to depend on libffi* and libgmp*, as this dependency
- # most likely comes from the RTS, see http://bugs.debian.org/639015
- ghc --make $T_DIR/a.hs -o $T_DIR/a.out
- plain_depends=$(dpkg-shlibdeps -Tdebian/$pkg.substvars $T_DIR/a.out -O)
- libffi=$(echo $plain_depends | sed -n '/^shlibs:Depends/s/.*\(libffi[0-9][0-9]*\).*/\1/p')
- rm -f a.out
-
- if [ -z "$libffi" ]
- then
- echo "libffi not used any more?"
- exit 1
- fi
- libgmp=$(echo $plain_depends | sed -n '/^shlibs:Depends/s/.*\(libgmp[0-9][0-9]*\).*/\1/p')
- if [ -z "$libgmp" ]
- then
- echo "libgmp not used any more?"
- exit 1
- fi
-
- ghc --make $T_DIR/a.hs -o $T_DIR/a.out\
- -package-db $T_DIR/package.conf -package $pkgname
- dpkg-shlibdeps -x$libffi -x$libgmp -Tdebian/$pkg.substvars $T_DIR/a.out
+ dpkg-shlibdeps --warnings=1 -Tdebian/$pkg.substvars $T_DIR/probe
;;
esac
done
diff -rN -u old-haskell-devscripts/hlibrary.mk new-haskell-devscripts/hlibrary.mk
--- old-haskell-devscripts/hlibrary.mk 2014-02-09 20:46:13.366362497 +0000
+++ new-haskell-devscripts/hlibrary.mk 2014-02-09 20:46:13.378362491 +0000
@@ -43,6 +43,15 @@
DEB_COMPRESS_EXCLUDE += .haddock .hs .txt
+# We do not want to take dependency information
+# from libHS*.so files, because
+# * dh_haskell_shlibs takes care of that and
+# * it would introduced unwanted dependencies on libgmp
+# If the latter can be avoided, this could be changed to
+# DEB_DH_SHLIBDEPS_ARGS_ALL += -- --ignore-missing-info
+# (because we do not (yet) have shlibs files for libHS libraries)
+DEB_DH_SHLIBDEPS_ARGS_ALL += -XlibHS
+
# TODO:
# - some of this would probably be useful for generic Haskell programs,
# not just libraries
More information about the Pkg-haskell-commits
mailing list