Hi!

On Wed, Jul 01, 2009 at 07:55:41PM -0400, Joey Hess wrote:
> 
> Could you include a minimal copyright/license notice?
> 

added.

> > sub check_auto_buildable {
> >   my ($this, $step) = @_;
> 
> Could you please use tabs for indentation?
> 

ran perltidy.

> >   return(-e $this->get_sourcepath("waf"));
> 
> In the original bug, Trent suggested also checking for
> wscript, is there any reason not to do so? Maybe ./waf should be tested
> to be executable too?
> 

ok, fixed.

> waf would also need to be added to the @BUILDSYSTEMS list in
> Dh_Buildsystems.pm. Safest is to add it to the end, although that would
> mean you'd need --buildsystem=waf if a source package also had a stub
> autoconf or Makefile.
>  

yes, I know. my patch doesn't include this because I'm not developing
this inside the git repo. Would you mind adding this for me when you
add my build class? :)

> > sub configure {
> >   my $this=shift;
> >   $this->_do_waf("configure", "--prefix=/usr/", @_);
> > }
> 
> Should that perhaps be "/usr"? (As in autoconf.)
>  

yes, I originally had it like that, but changed it to try (and fail)
to work around a (unrelated to my build class) bug. anyway, I put
it back now.

> > sub test {
> >   my $this=shift;
> >   $this->_do_waf("check", @_);
> > }
> 
> Is this going to quietly succeed if there is no test suite?
> It needs to..
> 

it should, as long as there's a test directory with wscript in
it. I added a check for this.

> > sub clean {
> >   my $this=shift;
> >   $this->_do_waf("distclean", @_);
> >   $this->doit_in_sourcedir("rm", "-rf", "_build_");
> 
> _build_ is something distclean doesn't remove?
> 

yes it does. I wonder why I thought it needed to be removed
manually...anyways, fixed.

I've seen Luca's comment about waf being packaged, however the
packaged version completely doesn't work for my package, so my build
class continues to use ./waf. perhaps the build class shouldn't be
added until the problem with the package is resolved and /usr/bin/waf
can be used?

Cheers,
Ryan

-- 
_________________________
Ryan Niebur
[email protected]
package Debian::Debhelper::Buildsystem::waf;

# Copyright: © 2009 Ryan Niebur
# License: GPL-2+

use strict;
use base 'Debian::Debhelper::Buildsystem';

sub DESCRIPTION {
	"waf";
}

sub check_auto_buildable {
	my ( $this, $step ) = @_;
	return ( -x $this->get_sourcepath("waf")
		  && -e $this->get_sourcepath("wscript") );
}

sub new {
	my $class = shift;
	my $this  = $class->SUPER::new(@_);
	$this->enforce_in_source_building();
	return $this;
}

sub _do_waf {
	my $this = shift;
	return $this->doit_in_sourcedir( "./waf", "--nocache", @_ );
}

sub configure {
	my $this = shift;
	$this->_do_waf( "configure", "--prefix=/usr", @_ );
}

sub test {
	my $this = shift;
	if ( -e "tests/wscript_build" ) {
		$this->_do_waf( "check", @_ );
	}
}

sub install {
	my $this    = shift;
	my $destdir = shift;
	$this->_do_waf( "install", "--destdir", $destdir, @_ );
}

sub build {
	my $this = shift;
	$this->_do_waf( "build", @_ );
}

sub clean {
	my $this = shift;
	$this->_do_waf( "distclean", @_ );
}

1;

Attachment: signature.asc
Description: Digital signature

Reply via email to