Skip to content
Commits on Source (2)
dh-haskell (0.4) experimental; urgency=low
* Use ghc-pkg to construct virtual package names instead of manual
parsing.
-- Sven Bartscher <kritzefitz@debian.org> Sun, 09 Oct 2016 13:36:21 +0200
dh-haskell (0.3.1) unstable; urgency=medium
* Take advantage of ${perl:Depends} variable, provided by dh_perl(1).
(Closes: #839020) (Thanks: Niko Tyni <ntyni@debian.org>)
-- Dmitry Bogatov <KAction@gnu.org> Wed, 28 Sep 2016 19:27:54 +0300
dh-haskell (0.3) unstable; urgency=medium
* Avoid push on scalar, which in now forbidden (Closes: #838888)
(Thanks: Chris Lamb <lamby@debian.org>)
* Replace git:// with https:// link in Vcs-Git
-- Dmitry Bogatov <KAction@gnu.org> Mon, 26 Sep 2016 10:44:07 +0300
......
......@@ -12,7 +12,7 @@ Vcs-Git: https://anonscm.debian.org/cgit/pkg-haskell/dh-haskell.git
Package: dh-haskell
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends},
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends},
debhelper (>= 9.20151220),
dh-buildinfo,
libparse-debcontrol-perl,
......
......@@ -58,6 +58,7 @@ use parent qw(Debian::Debhelper::Buildsystem);
use Readonly;
use File::Find;
use File::chdir;
use File::Copy;
use List::MoreUtils qw(any uniq);
use Carp::Assert;
......@@ -610,9 +611,17 @@ where I<SHORT_HASH> is first 5 digits of I<HASH>.
=cut
sub cabal_id_to_virtual_package {
my ( $flavor, $cabal_id ) = @_;
my ( $name, $version, $short_hash ) =
( $cabal_id =~ m/^(.*)-([.0-9]+)-([0-9a-f]{5})[0-9a-f]{27}$/ );
my ( $flavor, $cabal_id, $db ) = @_;
my $command = "ghc-pkg --simple field '$cabal_id'";
if ($db) {
$command .= " --package-db '$db'";
}
my $name = `$command name` || die $!;
print "$name\n";
my $version = `$command version` || die $1;
print "$version\n";
my ($short_hash) = (`$command abi` || die $1) =~ m/^(.{5})/;
print "$short_hash\n";
$name =~ s/(.*)/\L\1/;
shouldnt( $flavor, 'doc' );
......@@ -620,11 +629,11 @@ sub cabal_id_to_virtual_package {
}
sub substitute_provides {
my ($config) = @_;
my ($config, $tmp_db) = @_;
my $id = $config->[0]->{'id'};
for_binpkg qw(dev prof), sub {
my $provides = cabal_id_to_virtual_package( $type, $id );
my $provides = cabal_id_to_virtual_package( $type, $id, $tmp_db );
addsubstvar( $binpkg, "haskell:Provides", $provides );
};
......@@ -774,13 +783,23 @@ sub manual_dh_shlibdeps {
print_and_doit( 'rm', '-f', "$probefile.c", $probefile );
}
sub create_tmp_db {
my ($pkg_config) = @_;
my $tmp_db = "debian/tmp_db";
mkdir $tmp_db;
copy $pkg_config, $tmp_db;
print_and_doit('ghc-pkg', 'recache', '--package-db', $tmp_db);
return $tmp_db
}
sub install {
run_setup( 'copy', "--destdir=$TMP_INSTALL_DIR" );
do_install( do_dispatch() );
my $pkg_config = install_pkg_config;
if ( defined $pkg_config ) {
my $config = new Parse::DebControl->parse_file($pkg_config);
substitute_provides $config;
my $tmp_db = create_tmp_db $pkg_config;
substitute_provides $config, $tmp_db;
substitute_depends $config;
if (USE_LEGACY) {
manual_dh_shlibdeps $config;
......@@ -797,6 +816,7 @@ sub clean {
print_and_doit( 'rm', '-f', $SETUP_BIN_NAME );
print_and_doit( 'rm', '-fr', $TMP_INSTALL_DIR );
print_and_doit( 'rm', '-fr', $HC_BUILD_DIR );
print_and_doit( 'rm', '-fr', 'debian/tmp_db');
for my $binpkg ( @{ $dh{DOPACKAGES} } ) {
print_and_doit( 'rm', '-fr', "debian/$binpkg" );
}
......