[DHG_packages] 01/02: Change build-system to use the new haskell-devscripts-nocolour packages instead of duplicating its functionality
Sven Bartscher
kritzefitz at moszumanska.debian.org
Sat Jul 9 18:15:54 UTC 2016
This is an automated email from the git hooks/post-receive script.
kritzefitz pushed a commit to branch experimental
in repository DHG_packages.
commit 877ec36a7777932a81d638bd48f739c0ed4462ed
Author: Sven Bartscher <kritzefitz at debian.org>
Date: Sat Jul 9 20:14:00 2016 +0200
Change build-system to use the new haskell-devscripts-nocolour
packages instead of duplicating its functionality
---
p/ghc/debian/Dh_Haskell.sh | 239 ---------------------------------------
p/ghc/debian/control | 1 +
p/ghc/debian/dh_haskell_provides | 99 ----------------
p/ghc/debian/rules | 4 +-
4 files changed, 3 insertions(+), 340 deletions(-)
diff --git a/p/ghc/debian/Dh_Haskell.sh b/p/ghc/debian/Dh_Haskell.sh
deleted file mode 100644
index a90d4d6..0000000
--- a/p/ghc/debian/Dh_Haskell.sh
+++ /dev/null
@@ -1,239 +0,0 @@
-strip_hash(){
- echo "$1" | sed 's/-................................$//'
-}
-
-sort_uniq(){
- {
- for i in "$@" ; do
- echo $i
- done
- } | sort -u | tr "\n" " "
-}
-
-dependency(){
- local package
- local version
- local next_upstream_version
- package=$1
- version=`dpkg-query --showformat='${Version}' -W $package`
- next_upstream_version=`echo $version | sed -e 's/-[^-]*$//' -e 's/$/+/'`
- echo "$package (>= $version), $package (<< $next_upstream_version)"
-}
-
-providing_package_for_ghc(){
- local package
- local dep
- local dir
- local dirs
- local lib
- dep=`strip_hash $1`
- dirs=`ghc-pkg field $dep library-dirs | grep -i ^library-dirs | cut -d':' -f 2`
- lib=`ghc-pkg field $dep hs-libraries | grep -i ^hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' `
- for dir in $dirs ; do
- if [ -e "${dir}/lib${lib}.a" ] ; then
- package=`dpkg-query -S ${dir}/lib${lib}.a | cut -d':' -f 1` || exit $?
- continue
- fi
- done
- echo $package
-}
-
-providing_package_for_ghc_prof(){
- local package
- local dep
- local dir
- local dirs
- local lib
- dep=`strip_hash $1`
- dirs=`ghc-pkg field $dep library-dirs | grep -i ^library-dirs | cut -d':' -f 2`
- lib=`ghc-pkg field $dep hs-libraries | grep -i ^hs-libraries | sed -e 's|hs-libraries: *\([^ ]*\).*|\1|' `
- for dir in $dirs ; do
- if [ -e "${dir}/lib${lib}_p.a" ] ; then
- package=`dpkg-query -S ${dir}/lib${lib}_p.a | cut -d':' -f 1` || exit $?
- continue
- fi
- done
- echo $package
-}
-
-cabal_package_ids(){
- local config
- local package_ids
- until [ -z "$1" ]
- do
- config=$1
- package_ids="$package_ids `grep-dctrl -n -i -s Id "" $config`"
- shift
- done
- echo $package_ids
-}
-
-cabal_depends(){
- local config
- local dep
- local depends
- local final_depends
- until [ -z "$1" ]
- do
- config=$1
- depends="$depends `grep-dctrl -n -i -s Depends "" $config | tr "," " "`"
- shift
- done
- for dep in `sort_uniq $depends` ; do
- # The package is not mentioned in the ignored package list with the same version
- # or mentioned without any version in the ignored package list?
- if echo " $ignores " | grep -qv " $dep " &&
- echo " $ignores " | grep -qv " `echo $dep | sed s%-[0-9][.0-9a-zA-Z]*$%%` " ;
- then
- final_depends="$final_depends $dep"
- fi
- done
- echo $final_depends
-}
-
-hashed_dependency(){
- local type
- local pkgid
- local virpkg
- type=$1
- pkgid=$2
- virtual_pkg=`package_id_to_virtual_package $type $pkgid`
- # As a transition measure, check if dpkg knows about this virtual package
- if dpkg-query -W $virtual_pkg >/dev/null 2>/dev/null;
- then
- echo $virtual_pkg
- fi
-}
-
-depends_for_ghc(){
- local dep
- local packages
- local pkgid
- for pkgid in `cabal_depends $@` ; do
- dep=`hashed_dependency dev $pkgid`
- if [ -z "$dep" ]
- then
- pkg=`providing_package_for_ghc $pkgid`
- if [ -n "$pkg" ]
- then
- dep=`dependency $pkg`
- packages="$packages, $dep"
- fi
- else
- packages="$packages, $dep"
- fi
- done
-
- echo $packages | sed -e 's/^,[ ]*//'
-}
-
-depends_for_ghc_prof(){
- local dep
- local packages
- local pkgid
- for pkgid in `cabal_depends $@` ; do
- dep=`hashed_dependency prof $pkgid`
- if [ -z "$dep" ]
- then
- pkg=`providing_package_for_ghc_prof $pkgid`
- dep=`dependency $pkg`
- fi
- packages="$packages, $dep"
- done
-
- echo $packages | sed -e 's/^,[ ]*//'
-}
-
-provides_for_ghc(){
- local dep
- local packages
- for package_id in `cabal_package_ids $@` ; do
- packages="$packages, `package_id_to_virtual_package dev $package_id`"
- done
- echo $packages | sed -e 's/^,[ ]*//'
-}
-
-provides_for_ghc_prof(){
- local dep
- local packages
- for package_id in `cabal_package_ids $@` ; do
- packages="$packages, `package_id_to_virtual_package prof $package_id`"
- done
- echo $packages | sed -e 's/^,[ ]*//'
-}
-
-package_id_to_virtual_package(){
- local type
- type="$1"
- echo $2 | tr A-Z a-z | \
- grep '[a-z0-9]\+-[0-9\.]\+-................................' | \
- perl -pe 's/([a-z0-9-]+)-([0-9\.]+)-(.....).........................../libghc-\1-'$type'-\2-\3/'
-}
-
-depends_for_hugs(){
- local version
- local upstream_version
- version=`dpkg-query --showformat='${Version}' -W hugs`
- upstream_version=`echo $version | sed -e 's/-[^-]*$//'`
- echo "hugs (>= $upstream_version)"
-}
-
-find_config_for_ghc(){
- local f
- local pkg
- pkg=$1
- case "$pkg" in
- ghc-prof)
- pkg=ghc
- ;;
- libghc-*-prof)
- pkg=`echo $pkg | sed -e 's/-prof$/-dev/'`
- ;;
- *)
- ;;
- esac
- for f in debian/$pkg/var/lib/ghc/package.conf.d/*.conf ; do
- if [ -f "$f" ] ; then
- echo $f
- echo " "
- fi
- done
-}
-
-
-if ! [ `which grep-dctrl` > /dev/null ] ; then
- echo "grep-dctrl is missing" >&2
- exit 1
-fi
-
-args=
-ignores=
-files=
-until [ -z "$1" ]
-do
- case "$1" in
- -X*)
- pkg=${1##-X}
- ignores="$ignores $pkg"
- ;;
-
- --exclude=*)
- pkg=${1##--exclude=}
- ignores="$ignores $pkg"
- ;;
-
- -*)
- args="$args $1"
- ;;
- *)
- if [ -f $1 ] ; then
- files="$files $1"
- else
- echo "Installed package description file $1 can not be found" >&2
- exit 1
- fi
- ;;
- esac
- shift
-done
-
diff --git a/p/ghc/debian/control b/p/ghc/debian/control
index 1c7e462..0055aa9 100644
--- a/p/ghc/debian/control
+++ b/p/ghc/debian/control
@@ -6,6 +6,7 @@ Uploaders: Joachim Breitner <nomeata at debian.org>, Clint Adams <clint at debian.org>
Standards-Version: 3.9.8
Build-Depends:
debhelper (>= 9),
+ haskell-devscripts-nocolour,
devscripts,
dh-autoreconf,
autotools-dev,
diff --git a/p/ghc/debian/dh_haskell_provides b/p/ghc/debian/dh_haskell_provides
deleted file mode 100644
index 2df0a69..0000000
--- a/p/ghc/debian/dh_haskell_provides
+++ /dev/null
@@ -1,99 +0,0 @@
-#! /bin/sh
-#
-# Calculated provides substvars for haskell library packages.
-#
-# Copyright (C) 2006-2007 Arjan Oosting <arjan at debian.org>
-# Copyright (C) 2009 Joachim Breitner <nomeata at debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of either:
-#
-# 1) The terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# 2) BSD 3-clause license.
-#
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided
-# with the distribution.
-#
-# * The names of contributors may not be used to endorse or promote
-# products derived from this software without specific prior
-# written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-set -e
-
-if test -e debian/Dh_Haskell.sh
-then
- . debian/Dh_Haskell.sh
-else
- . /usr/share/haskell-devscripts/Dh_Haskell.sh
-fi
-
-for pkg in `dh_listpackages $args`; do
- sfile=debian/$pkg.substvars
- touch $sfile
-
- case "$pkg" in
- libghc-*-dev|libghc-*-prof|ghc|ghc-prof)
- if [ -z "$files" ] ; then
- cfiles=`find_config_for_ghc $pkg`
- else
- cfiles="$files"
- fi
- if [ -z "$cfiles" ] ; then
- echo "No installed package description files can not be found" >&2
- exit 1
- fi
- case "$pkg" in
- libghc-*-dev|ghc)
- grep -v \
- -e ^haskell:Provides \
- $sfile > $sfile.tmp || true
- echo "haskell:Provides=`provides_for_ghc $cfiles`" >> $sfile.tmp
- ;;
- libghc-*-prof|ghc-prof)
- grep -v \
- -e ^haskell:Provides \
- $sfile > $sfile.tmp || true
- echo "haskell:Provides=`provides_for_ghc_prof $cfiles`" >> $sfile.tmp
- ;;
- esac
- mv $sfile.tmp $sfile
- ;;
- *)
- ;;
- esac
-done
diff --git a/p/ghc/debian/rules b/p/ghc/debian/rules
index 3640423..0858709 100755
--- a/p/ghc/debian/rules
+++ b/p/ghc/debian/rules
@@ -86,7 +86,7 @@ endif
# We also want to build the threaded profiling-enabled debug runtime,
# because it does no harm
echo 'GhcRTSWays += $$(if $$(findstring p, $$(GhcLibWays)),thr_debug_p,)' >> mk/build.mk
-
+
# We can't do this with a configure flag in 6.8.1 as libdir is not
# defined at the point at which we := it
echo 'ghclibdir := $${libdir}/ghc' >> mk/build.mk
@@ -256,7 +256,7 @@ override_dh_compress:
dh_compress -X.haddock -X.txt
override_dh_installdeb:
- sh debian/dh_haskell_provides
+ dh_haskell_provides
dh_installdeb
override_dh_shlibdeps:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/DHG_packages.git
More information about the Pkg-haskell-commits
mailing list