[Pkg-haskell-commits] r939 - in /packages/haskell-devscripts/trunk: Dh_Haskell.pm debian/changelog dh_haskell_build dh_haskell_configure dh_haskell_install

arjan at users.alioth.debian.org arjan at users.alioth.debian.org
Sun Jan 13 05:39:58 UTC 2008


Author: arjan
Date: Sun Jan 13 05:39:58 2008
New Revision: 939

URL: http://svn.debian.org/wsvn/pkg-haskell/?sc=1&rev=939
Log:
 r2401 at nebula:  arjan | 2008-01-13 06:32:39 +0100
 * dh_haskell_build:
   - With Cabal version >= 1.2 dh_haskell_builds accepts the command line
     arguments 'PROG-option=OPT', 'PROG-options=OPTS',
     'html-location=URL', 'executables', 'css=PATH', 'hyperlink-source'
     and 'hscolour-css=PATH' which are passed as options to the calls to
     ./setup build and ./setup haddock
 * dh_haskell_configure:
   - With Cabal version >= 1.2 dh_haskell_configure accepts the command
     line arguments 'configure-option=OPT', 'PROG-option=OPT' and
     'PROG-options=OPTS' which are passed as options to the call to
    ./setup configure
 * haskell_install:
   - Rewrite the code handling the package description file. Now it
     should work with Cabal version >= 1.2 / GHC 6.8.2. (Closes: #460138)
   - Remove LICENSE files installed by Cabal and empty documentation
     directories.
   - For Cabal >= 1.2 adjust the paths to the generated documentation
     in some regelur expressions.

Modified:
    packages/haskell-devscripts/trunk/Dh_Haskell.pm
    packages/haskell-devscripts/trunk/debian/changelog
    packages/haskell-devscripts/trunk/dh_haskell_build
    packages/haskell-devscripts/trunk/dh_haskell_configure
    packages/haskell-devscripts/trunk/dh_haskell_install

Modified: packages/haskell-devscripts/trunk/Dh_Haskell.pm
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/Dh_Haskell.pm?rev=939&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/Dh_Haskell.pm (original)
+++ packages/haskell-devscripts/trunk/Dh_Haskell.pm Sun Jan 13 05:39:58 2008
@@ -25,10 +25,10 @@
 use Exporter;
 use vars qw(@ISA @EXPORT %dh);
 @ISA=qw(Exporter);
- at EXPORT = qw(&builddir &build_setup &is_handled_package
+ at EXPORT = qw(&builddir &build_setup &cabal_version_ge &is_handled_package
 	     &dev_name &type_of_package
 	     &version_of_debpkg &version_of_type &upstream_version
-	     &profiling_name &getcabalname &getcabalversion
+	     &profiling_name &getcabalname &getcabalversion &getcabalnameversion
 	     &getcabalbasepath &getcabalpkglibpath &getcabalpkgsharepath
 	     );
 
@@ -48,6 +48,17 @@
 	die unless -e $setup;
 	doit("ghc6 -package Cabal $setup -o setup");
     }
+}
+
+sub cabal_version_ge {
+    my $requested_version = shift;
+    my $version = `ghc-pkg field Cabal version`;
+    chomp $version;
+    $version =~ s/version: // ;
+    system("dpkg --compare-versions $version ge $requested_version");
+    if ($? == -1) { die "Failed to execute: $!\n"; }
+    my $exitcode = $? >> 8;
+    return ! $exitcode;
 }
 
 sub is_handled_package {

Modified: packages/haskell-devscripts/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/debian/changelog?rev=939&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/debian/changelog (original)
+++ packages/haskell-devscripts/trunk/debian/changelog Sun Jan 13 05:39:58 2008
@@ -1,3 +1,26 @@
+haskell-devscripts (0.6.4~pre1) unstable; urgency=low
+
+  * dh_haskell_build:
+    - With Cabal version >= 1.2 dh_haskell_builds accepts the command line
+      arguments 'PROG-option=OPT', 'PROG-options=OPTS',
+      'html-location=URL', 'executables', 'css=PATH', 'hyperlink-source'
+      and 'hscolour-css=PATH' which are passed as options to the calls to
+      ./setup build and ./setup haddock
+  * dh_haskell_configure:
+    - With Cabal version >= 1.2 dh_haskell_configure accepts the command
+      line arguments 'configure-option=OPT', 'PROG-option=OPT' and
+      'PROG-options=OPTS' which are passed as options to the call to
+     ./setup configure
+  * haskell_install:
+    - Rewrite the code handling the package description file. Now it
+      should work with Cabal version >= 1.2 / GHC 6.8.2. (Closes: #460138)
+    - Remove LICENSE files installed by Cabal and empty documentation
+      directories.
+    - For Cabal >= 1.2 adjust the paths to the generated documentation
+      in some regelur expressions.
+
+ -- Arjan Oosting <arjan at debian.org>  Sun, 13 Jan 2008 04:49:34 +0100
+
 haskell-devscripts (0.6.3) unstable; urgency=low
 
   * dh_haskell_install:

Modified: packages/haskell-devscripts/trunk/dh_haskell_build
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/dh_haskell_build?rev=939&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/dh_haskell_build (original)
+++ packages/haskell-devscripts/trunk/dh_haskell_build Sun Jan 13 05:39:58 2008
@@ -118,19 +118,43 @@
 
 =cut
 
-my @flags;
+my @buildflags;
+my @haddockflags;
 my @savedargv = @ARGV;
 
 init();
 
 foreach (@ARGV) {
+    if (cabal_version_ge("1.2")) {
+	if (m/^\w*-option=.*$/) {
+	    push @buildflags , "--$_";
+	    next;
+	} elsif (m/^\w*-options=.*$/) {
+	    push @buildflags , "--$_";
+	    next;
+	} elsif (m/^html-location=.*$/){
+	    push @haddockflags , "--$_";
+	    next;
+	} elsif (m/^executables$/) {
+	    push @haddockflags , "--$_";
+	    next;
+	} elsif (m/^css=.*$/) {
+	    push @haddockflags , "--$_";
+	    next;
+	} elsif (m/^hyperlink-source$/) {
+	    push @haddockflags , "--$_";
+	    next;
+	} elsif (m/^hscolour-css=.*$/) {
+	    push @haddockflags , "--$_";
+	    next;
+	}
+    }
     if (m/^hoogle$/) {
-	push @flags , "--$_";
+	push @haddockflags , "--$_";
     } else {
 	error("Unrecognized argument: $_\n");
     }
 }
-
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
     my $tmp = tmpdir($package);
@@ -154,9 +178,9 @@
 	my $olddir = getcwd();
 	chdir($builddir);
 	if ( $pkgtype eq "haddock" ) {
-	    doit("./setup", "haddock", @flags);
+	    doit("./setup", "haddock", @haddockflags);
 	} else {
-	    doit("./setup", "build");
+	    doit("./setup", "build", @buildflags);
 	}
 	chdir($olddir);
     }

Modified: packages/haskell-devscripts/trunk/dh_haskell_configure
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/dh_haskell_configure?rev=939&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/dh_haskell_configure (original)
+++ packages/haskell-devscripts/trunk/dh_haskell_configure Sun Jan 13 05:39:58 2008
@@ -86,12 +86,26 @@
 init();
 
 foreach (@ARGV) {
+    if (cabal_version_ge("1.2")) {
+	if (m/^configure-option=.*$/) {
+	    push @flags , "--$_";
+	    next;
+	} elsif (m/^\w*-option=.*$/) {
+	    push @flags , "--$_";
+	    next;
+	} elsif (m/^\w*-options=.*$/) {
+	    push @flags , "--$_";
+	    next;
+	}
+    }
     if (m/^with-compiler=(.*)$/) {
 	error("Compiler '$1' not found.\n") if (! -x $1 );
 	$compiler = $1;
-    } elsif (m/^with-(|hc-pkg|happy|alex|hsc2hs|c2hs|cpphs|greencard|ar|haddock|pfesetup|ranlib|runghc|runhugs)=.*$/) {
+    } elsif (m/^with-.*=.*$/) {
 	push @flags , "--$_";
-    } elsif (m/^(ar|haddock|pfesetup|ranlib|runghc|runhugs)-args=.*$/) {
+    } elsif (m/^.*-args=.*$/) {
+	push @flags , "--$_";
+    } elsif (m/^(enable|disable)-split-objs$/){
 	push @flags , "--$_";
     } else {
 	error("Unrecognized argument: $_\n");

Modified: packages/haskell-devscripts/trunk/dh_haskell_install
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/dh_haskell_install?rev=939&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/dh_haskell_install (original)
+++ packages/haskell-devscripts/trunk/dh_haskell_install Sun Jan 13 05:39:58 2008
@@ -26,12 +26,12 @@
 use Debian::Debhelper::Dh_Lib;
 
 use lib '/usr/share/haskell-devscripts/';
-#use lib '/home/arjan/checkout/haskell-devscripts/';
+# use lib '/home/arjan/debian/haskell-devscripts/';
 use Dh_Haskell;
 
-init();
-
-build_setup();
+my $haddockpkg;
+my $cabalname = getcabalname();
+my $cabalnameversion = getcabalnameversion();
 
 sub remove_emptydir {
     my $dir = $_;
@@ -47,15 +47,25 @@
     }
 }
 
-
-my $haddockpkg;
-foreach my $package (&getpackages("indep")) {
-    if (&is_handled_package($package) &&
-	&type_of_package($package) eq "haddock") {
-	$haddockpkg = $package
+sub package_description {
+    if (cabal_version_ge("1.2")) {
+	doit("./setup", "register" , "--gen-pkg-config");
+	return $cabalnameversion . ".conf";
+    } else {
+	return ".installed-pkg-config" ;
     }
 }
 
+init();
+
+build_setup();
+
+foreach my $pkg (&getpackages("indep")) {
+    if (&is_handled_package($pkg) &&
+	&type_of_package($pkg) eq "haddock") {
+	$haddockpkg = $pkg
+    }
+}
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
     my $tmp = getcwd() ."/" . tmpdir($package);
@@ -71,22 +81,21 @@
 	chdir($builddir);
 
 	if ($pkgtype eq "hugs") {
-	    mkpath("$tmp/usr/lib/hugs/packages/" . getcabalname());
+	    mkpath("$tmp/usr/lib/hugs/packages/$cabalname");
 	    doit("./setup", "copy", "--destdir=$tmp");
+	    # remove LICENSE file and empty directories
+	    doit("rm", "-f", "$tmp/usr/share/doc/$cabalnameversion/LICENSE");
+	    finddepth({wanted => \&remove_emptydir}, "$tmp/usr/share/doc");
 	} elsif ($pkgtype eq "ghc6") {
 	    mkpath("$tmp" . getcabalbasepath($pkgtype));
 	    doit("./setup", "copy", "--destdir=$tmp");
-# Remove installed docs as the go into a separete package
-	    rmtree("$tmp" . getcabalpkgsharepath($pkgtype) . "/doc");
-# Remove empty directories from package
+	    # Remove installed docs as the go into a separete package
+	    rmtree("$tmp/usr/lib/haskell-packages/ghc6/share/$cabalnameversion/doc/");
+	    rmtree("$tmp/usr/lib/haskell-packages/ghc6/share/doc/$cabalnameversion/");
+	    # Remove empty directories from package
 	    finddepth({wanted => \&remove_emptydir}, "$tmp/usr/lib");
 
-	    my $inconfig;
-	    if ( -e "dist/installed-pkg-config" ) {
-		$inconfig = "dist/installed-pkg-config" ;
-	    } else {
-		$inconfig = ".installed-pkg-config" ;
-	    }
+	    my $inconfig = package_description();
 
 	    open INCONFIG , "<", $inconfig or
 		die "Cannot read $inconfig: $!";
@@ -107,8 +116,13 @@
 		    }
 		}
 		if (defined($haddockpkg)) {
-		    s%(haddock-interfaces:).*/doc(/html/.*\.haddock)%$1 /usr/share/doc/$haddockpkg$2%;
-		    s%(haddock-html:).*/doc(/html)%$1 /usr/share/doc/$haddockpkg$2%;
+		    if(cabal_version_ge(1.2)) {
+			s%(haddock-interfaces:).*/doc/$cabalnameversion/html/(.*\.haddock)%$1 /usr/share/doc/$haddockpkg/$cabalname/$2%;
+			s%(haddock-html:).*/doc/$cabalnameversion/html%$1 /usr/share/doc/$haddockpkg/$cabalname%;
+		    } else {
+			s%(haddock-interfaces:).*/doc(/html/.*\.haddock)%$1 /usr/share/doc/$haddockpkg$2%;
+			s%(haddock-html:).*/doc(/html)%$1 /usr/share/doc/$haddockpkg$2%;
+		    }
 		} else {
 		    s%(haddock-interfaces:).*%$1%;
 		    s%(haddock-html:).*%$1%;
@@ -120,13 +134,13 @@
 	} elsif ($pkgtype eq "ghc6-prof") {
 	    mkpath("$tmp" . getcabalbasepath($pkgtype));
 	    doit("./setup", "copy", "--destdir=$tmp");
-# Remove empty directories from package
+	    # Remove LICENSE file and empty directories from package
+	    doit("rm", "-f", "$tmp/usr/lib/haskell-packages/ghc6/share/doc/$cabalnameversion/LICENSE");
 	    finddepth({wanted => \&remove_emptydir}, "$tmp/usr/lib");
 	} elsif ($pkgtype eq "haddock" ) {
 	    mkpath("$tmp" . "/usr/share/doc/$package");
 	    doit("cp", "-ar", "dist/doc/html", "$tmp/usr/share/doc/$package");
 	}
-
 	chdir($olddir);
     }
 }




More information about the Pkg-haskell-commits mailing list