summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Bartscher <kritzefitz@debian.org>2016-07-19 19:24:34 +0200
committerSven Bartscher <kritzefitz@debian.org>2016-07-19 19:24:34 +0200
commit3c05328440040b0bf04cdd6ed0aaa258ae5b4f00 (patch)
tree97e1f31ad50181e8fed340b503b3a08bbcd6c975
parent7487e76be2d00c54af0e840d7d15526a776bd900 (diff)
parent2c7b40731f687286c9f266d2d4b15a27d6c99017 (diff)
Merge branch 'short-ids'
-rw-r--r--Dh_Haskell.sh83
-rw-r--r--debian/changelog12
-rw-r--r--debian/control34
-rw-r--r--debian/haskell-devscripts-minimal.install (renamed from debian/install)0
4 files changed, 114 insertions, 15 deletions
diff --git a/Dh_Haskell.sh b/Dh_Haskell.sh
index 824e8be..fde9fd7 100644
--- a/Dh_Haskell.sh
+++ b/Dh_Haskell.sh
@@ -26,7 +26,10 @@ package_prefix(){
}
package_hc(){
- echo $1 | sed -n -e 's|^lib\([^-]*\)-.*-[^-]*$|\1|p'
+ case $1 in
+ ghc|ghc-prof) echo "ghc";;
+ *) echo $1 | sed -n -e 's|^lib\([^-]*\)-.*-[^-]*$|\1|p';;
+ esac
}
package_ext(){
@@ -139,8 +142,14 @@ providing_package_for_ghc(){
local dirs
local lib
local hc
+ local ghcversion=`dpkg-query --showformat '${Version}' --show ghc`
hc=$1
- dep=`strip_hash $2`
+ if dpkg --compare-versions "${ghcversion}" '>=' 8
+ then
+ dep=$2
+ else
+ dep=`strip-hash $2`
+ fi
dirs=`ghc_pkg_field $hc $dep library-dirs | grep -i ^library-dirs | cut -d':' -f 2`
lib=`ghc_pkg_field $hc $dep hs-libraries | grep -i ^hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' `
for dir in $dirs ; do
@@ -159,8 +168,14 @@ providing_package_for_ghc_prof(){
local dirs
local lib
local hc
+ local ghcversion=`dpkg-query --showformat '${Version}' --show ghc`
hc=$1
- dep=`strip_hash $2`
+ if dpkg --compare-versions "${ghcversion}" '>=' 8
+ then
+ dep=$2
+ else
+ dep=`strip-hash $2`
+ fi
dirs=`ghc_pkg_field $hc $dep library-dirs | grep -i ^library-dirs | cut -d':' -f 2`
lib=`ghc_pkg_field $hc $dep hs-libraries | grep -i ^hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' `
for dir in $dirs ; do
@@ -212,10 +227,12 @@ hashed_dependency(){
local type
local pkgid
local virpkg
+ local ghcpkg
hc=$1
type=$2
pkgid=$3
- virtual_pkg=`package_id_to_virtual_package "${hc}" "$type" $pkgid`
+ ghcpkg="`usable_ghc_pkg`"
+ virtual_pkg=`package_id_to_virtual_package "${hc}" "$type" $pkgid "${ghcpkg}"`
# As a transition measure, check if dpkg knows about this virtual package
if dpkg-query -W $virtual_pkg >/dev/null 2>/dev/null;
then
@@ -277,14 +294,49 @@ depends_for_ghc_prof(){
echo $packages | sed -e 's/^,[ ]*//'
}
+usable_ghc_pkg() {
+ local ghcpkg
+ local version
+ if [ -x inplace/bin/ghc-pkg ]
+ then
+ # We are building ghc and need to use the new ghc-pkg
+ ghcpkg="inplace/bin/ghc-pkg"
+ version="`dpkg-parsechangelog -S Version`"
+ else
+ ghcpkg="ghc-pkg"
+ version="`dpkg-query --showformat '${Version}' --show ghc`"
+ fi
+ # ghc-pkg prior to version 8 is unusable for our purposes.
+ if dpkg --compare-versions "$version" '>=' 8
+ then
+ echo "${ghcpkg}"
+ fi
+}
+
+tmp_package_db() {
+ local ghcpkg
+ ghcpkg="`usable_ghc_pkg`"
+ if [ -n "${ghcpkg}" ]
+ then
+ if [ ! -f debian/tmp-db/package.cache ]
+ then
+ mkdir debian/tmp-db
+ cp $@ debian/tmp-db/
+ $ghcpkg --package-db debian/tmp-db/ recache
+ fi
+ echo "${ghcpkg} --package-db debian/tmp-db"
+ fi
+}
+
provides_for_ghc(){
local hc
local dep
local packages
hc=$1
shift
+ ghcpkg="`tmp_package_db $@`"
for package_id in `cabal_package_ids $@` ; do
- packages="$packages, `package_id_to_virtual_package "${hc}" dev $package_id`"
+ packages="$packages, `package_id_to_virtual_package "${hc}" dev $package_id "${ghcpkg}"`"
done
echo $packages | sed -e 's/^,[ ]*//'
}
@@ -295,8 +347,9 @@ provides_for_ghc_prof(){
local packages
hc=$1
shift
+ ghcpkg="`tmp_package_db $@`"
for package_id in `cabal_package_ids $@` ; do
- packages="$packages, `package_id_to_virtual_package "${hc}" prof $package_id`"
+ packages="$packages, `package_id_to_virtual_package "${hc}" prof $package_id "${ghcpkg}"`"
done
echo $packages | sed -e 's/^,[ ]*//'
}
@@ -305,12 +358,23 @@ package_id_to_virtual_package(){
local hc
local type
local pkgid
+ local ghcpkg
hc="$1"
type="$2"
pkgid="$3"
- echo ${pkgid} | tr A-Z a-z | \
- grep '[a-z0-9]\+-[0-9\.]\+-................................' | \
+ ghcpkg="$4"
+ if [ -n "$ghcpkg" ]
+ then
+ name=`${ghcpkg} --simple-output field "${pkgid}" name`
+ version=`${ghcpkg} --simple-output field "${pkgid}" version`
+ abi=`${ghcpkg} --simple-output field "${pkgid}" abi | cut -c1-5`
+ echo "lib${hc}-${name}-${version}-${type}-${abi}" | tr A-Z a-z
+ else
+ # We don't have a usable ghc-pkg, so we fall back to parsing the package id.
+ echo ${pkgid} | tr A-Z a-z | \
+ grep '[a-z0-9]\+-[0-9\.]\+-................................' | \
perl -pe 's/([a-z0-9-]+)-([0-9\.]+)-(.....).........................../lib'${hc}'-\1-'$type'-\2-\3/'
+ fi
}
depends_for_hugs(){
@@ -358,6 +422,7 @@ clean_recipe(){
run rm -f ${MAKEFILE}
run rm -rf debian/dh_haskell_shlibdeps
+ run rm -rf debian/tmp-db
# PS4=$PS5
}
@@ -368,7 +433,7 @@ make_setup_recipe(){
if test -e $setup
then
run ghc --make $setup -o ${DEB_SETUP_BIN_NAME}
- exit 0
+ exit 0
fi
done
# PS4=$PS5
diff --git a/debian/changelog b/debian/changelog
index 5114516..c28c211 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-haskell-devscripts (0.10.3) UNRELEASED; urgency=medium
+haskell-devscripts (0.11.0) experimental; urgency=medium
[ James McCoy ]
* Fix “Unescaped left brace in regex” warnings in dh_haskell_blurbs.
@@ -12,7 +12,15 @@ haskell-devscripts (0.10.3) UNRELEASED; urgency=medium
(Closes: #826501)
* Use secure Vcs-* URIs.
- -- James McCoy <jamessan@debian.org> Sun, 01 May 2016 11:01:02 -0400
+ [ Sven Bartscher ]
+ * Use ghc-pkg to determine tha package ABI instead of parsing package
+ IDs, but still fall back to parsing if GHC is older than version 8.
+ * Split into haskell-devscripts and haskell-devscripts-minimal. The
+ latter is more convenient for bootstrapping a new architecture as it
+ doesn't depend on hscolour.
+ * Conformance with Debian Policy 3.9.8.
+
+ -- Sven Bartscher <kritzefitz@debian.org> Tue, 19 Jul 2016 19:20:22 +0200
haskell-devscripts (0.10.2.3) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index 4b4ccb6..3ae8ccb 100644
--- a/debian/control
+++ b/debian/control
@@ -4,15 +4,15 @@ Priority: extra
Maintainer: Debian Haskell Group <pkg-haskell-maintainers@lists.alioth.debian.org>
Uploaders: Marco Silva <marcot@debian.org>, Joachim Breitner <nomeata@debian.org>
, Louis Bettens <louis@bettens.info>
- , Dmitry Bogatov <KAction@gnu.org>
+ , Dmitry Bogatov <KAction@gnu.org>
Build-Depends: debhelper (>= 9)
Build-Depends-Indep: perl
-Standards-Version: 3.9.5
+Standards-Version: 3.9.8
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-haskell/haskell-devscripts.git
Vcs-Git: https://anonscm.debian.org/git/pkg-haskell/haskell-devscripts.git
-Package: haskell-devscripts
+Package: haskell-devscripts-minimal
Architecture: all
Depends: dctrl-tools
, debhelper
@@ -21,8 +21,31 @@ Depends: dctrl-tools
, cdbs
, ${misc:Depends}
, html-xml-utils
- , hscolour
, ghc-haddock
+Breaks: haskell-devscripts (<= 0.10.2.3)
+Replaces: haskell-devscripts (<= 0.10.2.3)
+Suggests: haskell-devscripts
+Description: Tools to help Debian developers build Haskell packages
+ This package provides a collection of scripts to help build Haskell
+ packages for Debian. Unlike haskell-utils, this package is not
+ expected to be installed on the machines of end users.
+ .
+ This package is designed to support Cabalized Haskell libraries. It
+ is designed to build a library for each supported Debian compiler or
+ interpreter, generate appropriate postinst/prerm files for each one,
+ generate appropriate substvars entries for each one, and install the
+ package in the Debian temporary area as part of the build process.
+ .
+ This package doesn't provide functionality for generating coloured
+ documentation and is mostly intended for bootstrapping a new
+ architecture. If you want coloured documentation, use
+ haskell-devscripts.
+
+Package: haskell-devscripts
+Architecture: all
+Depends: ${misc:Depends}
+ , haskell-devscripts-minimal
+ , hscolour
Description: Tools to help Debian developers build Haskell packages
This package provides a collection of scripts to help build Haskell
packages for Debian. Unlike haskell-utils, this package is not
@@ -33,3 +56,6 @@ Description: Tools to help Debian developers build Haskell packages
interpreter, generate appropriate postinst/prerm files for each one,
generate appropriate substvars entries for each one, and install the
package in the Debian temporary area as part of the build process.
+ .
+ This package is actually an empty package and is only useful for its
+ dependency on hscolour.
diff --git a/debian/install b/debian/haskell-devscripts-minimal.install
index 6e92180..6e92180 100644
--- a/debian/install
+++ b/debian/haskell-devscripts-minimal.install