[Pkg-haskell-commits] r889 - 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
Wed Jan 2 06:18:06 UTC 2008
Author: arjan
Date: Wed Jan 2 06:18:06 2008
New Revision: 889
URL: http://svn.debian.org/wsvn/pkg-haskell/?sc=1&rev=889
Log:
r2307 at nebula: arjan | 2008-01-02 01:38:27 +0100
* dh_haskell_*:
- Use doit subroutine from Debian::Debhelper instead of safesystem
from Dh_Haskell. This also fixes a bug where dh_haskell_build does
not pass it's arguments to a call to dh_haskell_configure.
* dh_haskell_builds:
- Now accepts command line argument "hoogle" which is passed through
to ./setup haddock as "./setup haddock --hoogle".
* dh_haskell_configure:
- Now accepts various with-...= and arg-...= command line arguments
which are passed through to ./setup configure as options.
- Add a little pod2man documentation.
* Dh_Haskell.pm:
- Remove safesystem subroutine.
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=889&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/Dh_Haskell.pm (original)
+++ packages/haskell-devscripts/trunk/Dh_Haskell.pm Wed Jan 2 06:18:06 2008
@@ -20,6 +20,7 @@
package Dh_Haskell;
use strict;
+use Debian::Debhelper::Dh_Lib 'doit';
use Exporter;
use vars qw(@ISA @EXPORT %dh);
@@ -29,7 +30,7 @@
&version_of_debpkg &version_of_type &upstream_version
&profiling_name &getcabalname &getcabalversion
&getcabalbasepath &getcabalpkglibpath &getcabalpkgsharepath
- &safesystem);
+ );
sub builddir {
my $package = shift;
@@ -45,7 +46,7 @@
$setup = $candidate, last if -e $candidate;
}
die unless -e $setup;
- safesystem("ghc6 -package Cabal $setup -o setup");
+ doit("ghc6 -package Cabal $setup -o setup");
}
}
@@ -139,11 +140,4 @@
return getcabalbasepath($pkgtype) . "/share/" . getcabalnameversion();
}
-sub safesystem {
- my $program = shift;
- print "Running: $program\n";
- system($program) == 0
- or die "$program files: $?";
-}
-
1
Modified: packages/haskell-devscripts/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/debian/changelog?rev=889&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/debian/changelog (original)
+++ packages/haskell-devscripts/trunk/debian/changelog Wed Jan 2 06:18:06 2008
@@ -1,3 +1,21 @@
+haskell-devscripts (0.6.1~pre1) unstable; urgency=low
+
+ * dh_haskell_*:
+ - Use doit subroutine from Debian::Debhelper instead of safesystem
+ from Dh_Haskell. This also fixes a bug where dh_haskell_build does
+ not pass it's arguments to a call to dh_haskell_configure.
+ * dh_haskell_builds:
+ - Now accepts command line argument "hoogle" which is passed through
+ to ./setup haddock as "./setup haddock --hoogle".
+ * dh_haskell_configure:
+ - Now accepts various with-...= and arg-...= command line arguments
+ which are passed through to ./setup configure as options.
+ - Add a little pod2man documentation.
+ * Dh_Haskell.pm:
+ - Remove safesystem subroutine.
+
+ -- Arjan Oosting <arjan at debian.org> Tue, 01 Jan 2008 23:29:35 +0100
+
haskell-devscripts (0.6.0) unstable; urgency=low
* New version with the following features:
Modified: packages/haskell-devscripts/trunk/dh_haskell_build
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/dh_haskell_build?rev=889&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/dh_haskell_build (original)
+++ packages/haskell-devscripts/trunk/dh_haskell_build Wed Jan 2 06:18:06 2008
@@ -13,7 +13,7 @@
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -118,11 +118,19 @@
=cut
+my @flags;
my @savedargv = @ARGV;
init();
-#build_setup();
+foreach (@ARGV) {
+ if (m/^hoogle$/) {
+ push @flags , "--$_";
+ } else {
+ error("Unrecognized argument: $_\n");
+ }
+}
+
foreach my $package (@{$dh{DOPACKAGES}}) {
my $tmp = tmpdir($package);
@@ -136,7 +144,7 @@
if (! -e "$builddir/.setup-config" ) {
print "Running missing dh_haskell_configure call...\n";
- safesystem ("dh_haskell_configure", @savedargv);
+ doit ("dh_haskell_configure", @savedargv);
print "\n ****************************************** \n";
print " CONTINUE BUILDING $package FOR $pkgtype";
print "\n ****************************************** \n\n";
@@ -146,9 +154,9 @@
my $olddir = getcwd();
chdir($builddir);
if ( $pkgtype eq "haddock" ) {
- safesystem("./setup haddock");
+ doit("./setup", "haddock", @flags);
} else {
- safesystem("./setup build");
+ doit("./setup", "build");
}
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=889&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/dh_haskell_configure (original)
+++ packages/haskell-devscripts/trunk/dh_haskell_configure Wed Jan 2 06:18:06 2008
@@ -13,11 +13,17 @@
# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
+
+=head1 NAME
+
+dh_haskell_configure - prepare and configure Cabalized libraries for building
+
+=cut
use strict;
use Cwd 'getcwd','abs_path';
@@ -29,6 +35,35 @@
#use lib '/home/arjan/checkout/haskell-devscripts/';
use Dh_Haskell;
+=head1 SYNOPSIS
+
+B<dh_haskell_configure> [S<I<debhelper options>>]
+[B<with-compiler=>I<PATH>]
+[B<with-hc-pkg=>I<PATH>]
+[B<with-happy=>I<PATH>]
+[B<with-alex=>I<PATH>]
+[B<with-hsc2hs=>I<PATH>]
+[B<with-c2hs=>I<PATH>]
+[B<with-cpphs=>I<PATH>]
+[B<with-greencard=>I<PATH>]
+[B<with-ar=>I<PATH>]
+[B<with-haddock=>I<PATH>]
+[B<with-pfesetup=>I<PATH>]
+[B<with-ranlib=>I<PATH>]
+[B<with-runghc=>I<PATH>]
+[B<with-runhugs=>I<PATH>]
+[B<haddock-args=>I<args>]
+[B<pfesetup-args=I<args>]
+[B<ranlib-args=I<args>]
+[B<runghc-args=I<args>]
+[B<runhugs-args=I<args>]
+
+=head1 DESCRIPTION
+=cut
+
+my $compiler = "/usr/bin/ghc6";
+my @flags;
+
sub link_builddir {
my $package = shift;
my $builddir = builddir($package);
@@ -39,8 +74,7 @@
if ( -d $file ) {
unless ($file eq "debian" ) {
mkdir("$builddir/$file");
- safesystem("lndir $abs_path " .
- "$builddir/$file");
+ doit("lndir", $abs_path, "$builddir/$file");
}
} else {
symlink("$abs_path", "$builddir/$file");
@@ -50,6 +84,19 @@
}
init();
+
+foreach (@ARGV) {
+ 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)=.*$/) {
+ push @flags , "--$_";
+ } elsif (m/^(ar|haddock|pfesetup|ranlib|runghc|runhugs)-args=.*$/) {
+ push @flags , "--$_";
+ } else {
+ error("Unrecognized argument: $_\n");
+ }
+}
build_setup();
@@ -61,7 +108,7 @@
print " CONFIGURING $package FOR $pkgtype";
print "\n ****************************************** \n\n";
- system("./setup clean");
+ doit("./setup", "clean");
foreach my $file (glob ".*config*") {
unlink $file or die "Could not remove '$file': $1\n";
}
@@ -71,19 +118,18 @@
chdir($builddir);
if ($pkgtype eq "hugs") {
- safesystem("./setup configure --hugs " .
- "--prefix=/usr" );
+ doit("./setup", "configure", "--hugs", "--prefix=/usr", @flags );
} elsif ($pkgtype eq "ghc6" || $pkgtype eq "haddock" ) {
- safesystem("./setup configure " .
- " --prefix=" . getcabalbasepath($pkgtype) .
- " --with-compiler=/usr/bin/ghc6")
+ doit("./setup", "configure",
+ "--prefix=" . getcabalbasepath($pkgtype),
+ "--with-compiler=$compiler", @flags)
unless (-e ".setup-config");
} elsif ($pkgtype eq "ghc6-prof") {
- safesystem("./setup configure " .
- " --prefix=" . getcabalbasepath($pkgtype) .
- " --with-compiler=/usr/bin/ghc6" .
- " --disable-library-vanilla" .
- " --enable-library-profiling");
+ doit("./setup", "configure",
+ "--prefix=" . getcabalbasepath($pkgtype),
+ "--with-compiler=$compiler",
+ "--disable-library-vanilla",
+ "--enable-library-profiling", @flags);
}
chdir($olddir);
Modified: packages/haskell-devscripts/trunk/dh_haskell_install
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/dh_haskell_install?rev=889&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/dh_haskell_install (original)
+++ packages/haskell-devscripts/trunk/dh_haskell_install Wed Jan 2 06:18:06 2008
@@ -72,12 +72,10 @@
if ($pkgtype eq "hugs") {
mkpath("$tmp/usr/lib/hugs/packages/" . getcabalname());
- safesystem("./setup copy --destdir=$tmp");
+ doit("./setup", "copy", "--destdir=$tmp");
} elsif ($pkgtype eq "ghc6") {
mkpath("$tmp" . getcabalbasepath($pkgtype));
- safesystem("./setup copy --destdir=$tmp");
-# safesystem("cp .installed-pkg-config $tmp" .
-# getcabalpkglibpath($pkgtype) . "/installed-pkg-config");
+ 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
@@ -112,16 +110,14 @@
}
close INCONFIG;
close OUTCONFIG;
-# TODO: remove empty dirs from the .installed-pkg-config
} elsif ($pkgtype eq "ghc6-prof") {
mkpath("$tmp" . getcabalbasepath($pkgtype));
- safesystem("./setup copy --destdir=$tmp");
+ doit("./setup", "copy", "--destdir=$tmp");
# Remove empty directories from package
finddepth({wanted => \&remove_emptydir}, "$tmp/usr/lib");
} elsif ($pkgtype eq "haddock" ) {
mkpath("$tmp" . "/usr/share/doc/$package");
- safesystem("cp -ar dist/doc/* $tmp" .
- "/usr/share/doc/$package");
+ doit("cp", "-ar", "dist/doc/*", "$tmp", "/usr/share/doc/$package");
}
chdir($olddir);
More information about the Pkg-haskell-commits
mailing list