[Pkg-haskell-commits] r827 - in /packages/haskell-devscripts/trunk: dh_haskell_build dh_haskell_install
arjan at users.alioth.debian.org
arjan at users.alioth.debian.org
Sun Dec 30 18:09:34 UTC 2007
Author: arjan
Date: Sun Dec 30 18:09:34 2007
New Revision: 827
URL: http://svn.debian.org/wsvn/pkg-haskell/?sc=1&rev=827
Log:
[project @ add profiling support to dh_haskell_build and dh_haskell_install scripts]
Original author: jeremy.shaw at linspireinc.com
Date: 2006-08-11 22:49:27+00:00
Modified:
packages/haskell-devscripts/trunk/dh_haskell_build
packages/haskell-devscripts/trunk/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=827&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/dh_haskell_build (original)
+++ packages/haskell-devscripts/trunk/dh_haskell_build Sun Dec 30 18:09:34 2007
@@ -104,7 +104,7 @@
sub is_handled_package {
my $pkgname = shift;
- if ($pkgname =~ m/^lib(ghc5|ghc6|nhc98|hugs)-.+-(dev|prof)$/) {
+ if ($pkgname =~ m/^lib(ghc5|ghc6|nhc98|hugs)-.+-dev$/) {
return 1;
} elsif ($pkgname =~ m/libhugs-.+$/) {
return 1;
@@ -168,6 +168,25 @@
sub getcabalpkglibpath {
my $pkgtype = shift;
return getcabalbasepath($pkgtype) . "/lib/" . getcabalnameversion();
+}
+
+sub profiling_name {
+ my $package = shift;
+ my @pn = ($package =~ m/^lib(ghc5|ghc6|nhc98|hugs)-(.+)-dev$/);
+ return "lib$pn[0]-$pn[1]-prof";
+}
+
+sub is_profiling_enabled {
+ my $package = shift;
+ my $packages = shift;
+ my $profname = profiling_name($package);
+
+ foreach my $p (@{$packages}) {
+ if ($p =~ m/^$profname$/) {
+ return 1;
+ }
+ }
+ return 0;
}
sub safesystem {
@@ -205,7 +224,11 @@
print "Running: ./setup build\n";
system("./setup build");
} else {
- safesystem("./setup configure --prefix=" . getcabalbasepath($pkgtype)
+ my $profiling_option = "";
+ if (is_profiling_enabled($package,$dh{DOPACKAGES})) {
+ $profiling_option = " --enable-library-profiling ";
+ }
+ safesystem("./setup configure " . $profiling_option . " --prefix=" . getcabalbasepath($pkgtype)
. " --with-compiler=/usr/bin/$pkgtype");
safesystem("./setup build");
}
Modified: packages/haskell-devscripts/trunk/dh_haskell_install
URL: http://svn.debian.org/wsvn/pkg-haskell/packages/haskell-devscripts/trunk/dh_haskell_install?rev=827&op=diff
==============================================================================
--- packages/haskell-devscripts/trunk/dh_haskell_install (original)
+++ packages/haskell-devscripts/trunk/dh_haskell_install Sun Dec 30 18:09:34 2007
@@ -168,6 +168,25 @@
sub getcabalpkglibpath {
my $pkgtype = shift;
return getcabalbasepath($pkgtype) . "/lib/" . getcabalnameversion();
+}
+
+sub profiling_name {
+ my $package = shift;
+ my @pn = ($package =~ m/^lib(ghc5|ghc6|nhc98|hugs)-(.+)-dev$/);
+ return "lib$pn[0]-$pn[1]-prof";
+}
+
+sub is_profiling_enabled {
+ my $package = shift;
+ my $packages = shift;
+ my $profname = profiling_name($package);
+
+ foreach my $p (@{$packages}) {
+ if ($p =~ m/^$profname$/) {
+ return 1;
+ }
+ }
+ return 0;
}
sub safesystem {
@@ -196,6 +215,17 @@
safesystem("mkdir -p $tmp/usr/share/doc/$package");
safesystem("mkdir -p $tmp" . getcabalbasepath($pkgtype));
safesystem("./setup copy --copy-prefix=$tmp" . getcabalbasepath($pkgtype));
+ if (is_profiling_enabled($package, $dh{DOPACKAGES})) {
+ # Have to move all the profiling libraries into a
+ # seperate package. This seems a bit hackish though.
+ my $proftmp=tmpdir(profiling_name($package));
+ safesystem("mkdir -p $proftmp");
+ # NOTE: you might think you can using the -C option to
+ # tar instead using 'cd', but the --null disables -C
+ safesystem("find $tmp \\( -name \"*_p.a\" -o -name \"*.p_hi\" -o -name \"*.p_o\" \\) -printf \"%P\\0\" | " .
+ "(cd $tmp ; tar -c --null --preserve --remove-files -T - ) | " .
+ "tar -C $proftmp -x");
+ }
safesystem("cp .installed-pkg-config $tmp" . getcabalpkglibpath($pkgtype) . "/installed-pkg-config");
}
}
More information about the Pkg-haskell-commits
mailing list