Debian Bug report logs - #499225
Wish for waf support in dh_auto_build, dh_auto_clean, dh_auto_configure, dh_auto_install and dh_auto_test

version graph

Package: debhelper; Maintainer for debhelper is Debhelper Maintainers <debhelper-devel@lists.alioth.debian.org>; Source for debhelper is src:debhelper.

Reported by: "Trent W. Buck" <trentbuck@gmail.com>

Date: Wed, 17 Sep 2008 03:27:02 UTC

Severity: wishlist

Tags: patch

Found in version debhelper/7.0.15

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#499225; Package debhelper. Full text and rfc822 format available.

Acknowledgement sent to "Trent W. Buck" <trentbuck@gmail.com>:
New Bug report received and forwarded. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "Trent W. Buck" <trentbuck@gmail.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Wish for waf support in dh_auto_build, dh_auto_clean, dh_auto_configure, dh_auto_install and dh_auto_test
Date: Wed, 17 Sep 2008 13:24:39 +1000
Package: debhelper
Version: 7.0.15
Severity: wishlist

waf is a configure/build infrastructure inspired by scons.  It is
currently used by the midori and xmms2 upstreams (and possibly
others).  It would be nice if the dh_auto_* scripts detected and used
the waf.  Note that Midori provides both waf and a deprecated
autotools build infrastructure, so I'd prefer dh to prioritize waf
higher than autotools when choosing which one to run.

I guess the test for "is this upstream using waf?" should be

    -f "waf" and -f "wscript"

According to ./waf --help, it has the following targets:

    configure build install clean dist distclean uninstall distcheck

The first few map straight onto dh_auto_* rules; I don't know if
distcheck = dh_auto_test.  Possibly dh_auto_test should do nothing if
it finds a ./waf file.

PS: note that unlike e.g. scons or python-setuptools, convention is
for upstreams to include enough of waf to bootstrap itself from just a
python dependency.  Therefore I don't think it should matter that
Debian has no "waf" package yet.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages debhelper depends on:
ii  binutils            2.18.1~cvs20080103-7 The GNU assembler, linker and bina
ii  dpkg-dev            1.14.22              Debian package development tools
ii  file                4.25-1               Determines file type using "magic"
ii  html2text           1.3.2a-5             advanced HTML to text converter
ii  man-db              2.5.2-2              on-line manual pager
ii  perl                5.10.0-13            Larry Wall's Practical Extraction 
ii  po-debconf          1.0.15               manage translated Debconf template

debhelper recommends no packages.

Versions of packages debhelper suggests:
pn  dh-make                       <none>     (no description available)

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#499225; Package debhelper. (Wed, 04 Feb 2009 07:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Trent W. Buck" <trentbuck@gmail.com>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Wed, 04 Feb 2009 07:33:02 GMT) Full text and rfc822 format available.

Message #10 received at 499225@bugs.debian.org (full text, mbox):

From: "Trent W. Buck" <trentbuck@gmail.com>
To: 499225@bugs.debian.org
Subject: Re: Bug#499225: Wish for waf support in dh_auto_build, dh_auto_clean, dh_auto_configure, dh_auto_install and dh_auto_test
Date: Wed, 4 Feb 2009 18:34:21 +1100
On Wed, Sep 17, 2008 at 01:24:39PM +1000, Trent W. Buck wrote:
> Package: debhelper
> Version: 7.0.15
> Severity: wishlist
> 
> waf is a configure/build infrastructure inspired by scons.  It is
> currently used by the midori and xmms2 upstreams (and possibly
> others).  It would be nice if the dh_auto_* scripts detected and used
> the waf.  Note that Midori provides both waf and a deprecated
> autotools build infrastructure, so I'd prefer dh to prioritize waf
> higher than autotools when choosing which one to run.
> 
> I guess the test for "is this upstream using waf?" should be
> 
>     -f "waf" and -f "wscript"
> 
> According to ./waf --help, it has the following targets:
> 
>     configure build install clean dist distclean uninstall distcheck
> 
> The first few map straight onto dh_auto_* rules; I don't know if
> distcheck = dh_auto_test.  Possibly dh_auto_test should do nothing if
> it finds a ./waf file.

Here's something that nearly works (for some reason,
debian/tmp/usr/bin/midori disappears or isn't created).

    #!/usr/bin/make -f
    %:
            dh $@
    clean:
            dh $@
            ./waf --nocache distclean
    build:
            dh $@ --before configure
            ./waf --nocache configure --prefix=/usr
            dh $@ --after configure --until build
            ./waf --nocache build
            dh $@ --remaining
    binary:
            dh $@ --until dh_auto_install
            ./waf --nocache install --destdir=debian/tmp
            dh $@ --remaining --before dh_strip
            dh_strip --dbg-package=midori-dbg
            dh $@ --remaining




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#499225; Package debhelper. (Wed, 25 Feb 2009 03:24:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Trent W. Buck" <trentbuck@gmail.com>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Wed, 25 Feb 2009 03:24:23 GMT) Full text and rfc822 format available.

Message #15 received at 499225@bugs.debian.org (full text, mbox):

From: "Trent W. Buck" <trentbuck@gmail.com>
To: 499225@bugs.debian.org
Cc: "Trent W. Buck" <trentbuck@gmail.com>
Subject: [PATCH 1/2] Support waf (closes: #499225).
Date: Wed, 25 Feb 2009 14:17:49 +1100
---
 dh_auto_build     |    5 ++++-
 dh_auto_clean     |    5 ++++-
 dh_auto_configure |    5 ++++-
 dh_auto_install   |    5 ++++-
 dh_auto_test      |    3 +++
 5 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/dh_auto_build b/dh_auto_build
index a3c9521..92c3a78 100755
--- a/dh_auto_build
+++ b/dh_auto_build
@@ -18,7 +18,7 @@ B<dh_auto_build> [S<I<debhelper options>>] [S<B<--> I<params>>]
 dh_auto_build is a debhelper program that tries to automatically
 build a package. If a Makefile is found, this is done by running make (or
 MAKE, if the environment variable is set).
-If there's a setup.py, or Build.PL, it is run to build the package.
+If there's a setup.py, waf, or Build.PL, it is run to build the package.
 
 This is intended to work for about 90% of packages. If it doesn't work,
 you're encouraged to skip using dh_auto_build at all, and just run the
@@ -45,6 +45,9 @@ if (-e "Makefile" || -e "makefile" || -e "GNUmakefile") {
 elsif (-e "setup.py") {
 	doit("python", "setup.py", "build", @{$dh{U_PARAMS}});
 }
+elsif (-x "waf" && -e "wscript") {
+	doit("./waf", "--nocache", "build", @{$dh{U_PARAMS}});
+}
 elsif (-e "Build.PL" && -e "Build") {
 	doit("perl", "Build", @{$dh{U_PARAMS}});
 }
diff --git a/dh_auto_clean b/dh_auto_clean
index 6c97b10..14db466 100755
--- a/dh_auto_clean
+++ b/dh_auto_clean
@@ -18,7 +18,7 @@ B<dh_auto_clean> [S<I<debhelper options>>] [S<B<--> I<params>>]
 dh_auto_clean is a debhelper program that tries to automatically clean up
 after a package build. If there's a Makefile and it contains a "distclean",
 "realclean", or "clean" target, then this is  done by running make (or MAKE,
-if the environment variable is set). If there is a setup.py or Build.PL, it
+if the environment variable is set). If there is a setup.py, waf or Build.PL, it
 is run to clean the package.
 
 This is intended to work for about 90% of packages. If it doesn't work, or
@@ -59,6 +59,9 @@ elsif (-e "setup.py") {
 	# files.
 	doit('find', '.', '-name', '*.pyc', '-exec', 'rm', '{}', ';');
 }
+elsif (-x "waf" && -e "wscript") {
+	doit("./waf", "--nocache", "distclean", @{$dh{U_PARAMS}});
+}
 elsif (-e "Build.PL" && -e "Build") {
 	doit("perl", "Build", "--allow_mb_mismatch", 1, "distclean", @{$dh{U_PARAMS}});
 }
diff --git a/dh_auto_configure b/dh_auto_configure
index 6b8adf5..b131962 100755
--- a/dh_auto_configure
+++ b/dh_auto_configure
@@ -17,7 +17,7 @@ B<dh_auto_configure> [S<I<debhelper options>>] [S<B<--> I<params>>]
 
 dh_auto_configure is a debhelper program that tries to automatically
 configure a package prior to building. It looks for and runs a ./configure
-script, Makefile.PL, or Build.PL. A standard set of parameters is
+script, waf, Makefile.PL, or Build.PL. A standard set of parameters is
 determined and passed to the program that is run. If no program to run is
 found, dh_auto_configure will exit without doing anything.
 
@@ -84,6 +84,9 @@ if (-x "configure") {
 	}
 	doit("./configure", @opts, @{$dh{U_PARAMS}});
 }
+elsif (-x "waf" && -e "wscript") {
+	doit("./waf", "--nocache", "configure", "--prefix=/usr", @{$dh{U_PARAMS}});
+}
 elsif (-e "Makefile.PL") {
 	# If set to a true value then MakeMaker's prompt function will
 	# # always return the default without waiting for user input.
diff --git a/dh_auto_install b/dh_auto_install
index 8e7ab90..515fdc3 100755
--- a/dh_auto_install
+++ b/dh_auto_install
@@ -19,7 +19,7 @@ B<dh_auto_install> [S<I<debhelper options>>] [S<B<--> I<params>>]
 dh_auto_install is a debhelper program that tries to automatically install
 built files. If there's a Makefile and it contains a "install" target,
 then this is done by running make (or MAKE, if the environment variable is
-set). If there is a setup.py or Build.PL, it is used.
+set). If there is a setup.py, waf or Build.PL, it is used.
 
 The files are installed into debian/<package>/ if there is only one binary
 package. In the multiple binary package case, the files are instead
@@ -89,6 +89,9 @@ elsif (-e "setup.py") {
 		"--no-compile", "-O0",
 		@{$dh{U_PARAMS}});
 }
+elsif (-x "waf" && -e "wscript") {
+	doit("./waf", "--nocache", "install", "--destdir=$destdir", @{$dh{U_PARAMS}});
+}
 elsif (-e "Build.PL" && -e "Build") {
 	doit("perl", "Build", "install", "destdir=$destdir",
 		"create_packlist=0", @{$dh{U_PARAMS}});
diff --git a/dh_auto_test b/dh_auto_test
index 05c11b2..03289f5 100755
--- a/dh_auto_test
+++ b/dh_auto_test
@@ -54,6 +54,9 @@ if (-e "Makefile" || -e "makefile" || -e "GNUmakefile") {
 		}
 	}
 }
+elsif (-x "waf" && -e "wscript") {
+	doit("./waf", "--nocache", "check", @{$dh{U_PARAMS}});
+}
 elsif (-e "Build.PL" && -e "Build") {
 	doit(qw/perl Build test/, @{$dh{U_PARAMS}});
 }
-- 
1.6.1.3


From 4bd5a5248a568f245b3500cbe813ab8c98edc02d Mon Sep 17 00:00:00 2001
From: Trent W. Buck <trentbuck@gmail.com>
Date: Wed, 25 Feb 2009 14:16:37 +1100
Subject: [PATCH 2/2] Support Setup.lhs (Haskell).

---
 dh_auto_build     |    7 ++++++-
 dh_auto_clean     |    8 ++++++--
 dh_auto_configure |   10 +++++++---
 dh_auto_install   |    6 +++++-
 dh_auto_test      |    4 ++++
 5 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/dh_auto_build b/dh_auto_build
index 92c3a78..80f08d6 100755
--- a/dh_auto_build
+++ b/dh_auto_build
@@ -18,7 +18,8 @@ B<dh_auto_build> [S<I<debhelper options>>] [S<B<--> I<params>>]
 dh_auto_build is a debhelper program that tries to automatically
 build a package. If a Makefile is found, this is done by running make (or
 MAKE, if the environment variable is set).
-If there's a setup.py, waf, or Build.PL, it is run to build the package.
+If there's a setup.py, Setup.lhs, Setup.hs, waf, or Build.PL, it is
+run to build the package.
 
 This is intended to work for about 90% of packages. If it doesn't work,
 you're encouraged to skip using dh_auto_build at all, and just run the
@@ -48,6 +49,10 @@ elsif (-e "setup.py") {
 elsif (-x "waf" && -e "wscript") {
 	doit("./waf", "--nocache", "build", @{$dh{U_PARAMS}});
 }
+elsif (-e "Setup.hs" || -e "Setup.lhs") {
+	doit("ghc", "--make", "Setup");
+	doit("./Setup", "build", "--prefix=/usr", @{$dh{U_PARAMS}});
+}
 elsif (-e "Build.PL" && -e "Build") {
 	doit("perl", "Build", @{$dh{U_PARAMS}});
 }
diff --git a/dh_auto_clean b/dh_auto_clean
index 14db466..263135f 100755
--- a/dh_auto_clean
+++ b/dh_auto_clean
@@ -18,8 +18,8 @@ B<dh_auto_clean> [S<I<debhelper options>>] [S<B<--> I<params>>]
 dh_auto_clean is a debhelper program that tries to automatically clean up
 after a package build. If there's a Makefile and it contains a "distclean",
 "realclean", or "clean" target, then this is  done by running make (or MAKE,
-if the environment variable is set). If there is a setup.py, waf or Build.PL, it
-is run to clean the package.
+if the environment variable is set). If there is a setup.py,
+Setup.lhs, Setup.hs, waf or Build.PL, it is run to clean the package.
 
 This is intended to work for about 90% of packages. If it doesn't work, or
 tries to use the wrong clean target, you're encouraged to skip using
@@ -62,6 +62,10 @@ elsif (-e "setup.py") {
 elsif (-x "waf" && -e "wscript") {
 	doit("./waf", "--nocache", "distclean", @{$dh{U_PARAMS}});
 }
+elsif (-e "Setup.hs" || -e "Setup.lhs") {
+	doit("ghc", "--make", "Setup");
+	doit("./Setup", "clean", @{$dh{U_PARAMS}});
+}
 elsif (-e "Build.PL" && -e "Build") {
 	doit("perl", "Build", "--allow_mb_mismatch", 1, "distclean", @{$dh{U_PARAMS}});
 }
diff --git a/dh_auto_configure b/dh_auto_configure
index b131962..7623218 100755
--- a/dh_auto_configure
+++ b/dh_auto_configure
@@ -17,9 +17,9 @@ B<dh_auto_configure> [S<I<debhelper options>>] [S<B<--> I<params>>]
 
 dh_auto_configure is a debhelper program that tries to automatically
 configure a package prior to building. It looks for and runs a ./configure
-script, waf, Makefile.PL, or Build.PL. A standard set of parameters is
-determined and passed to the program that is run. If no program to run is
-found, dh_auto_configure will exit without doing anything.
+script, Setup.lhs, Setup.hs, waf, Makefile.PL, or Build.PL. A standard set of
+parameters is determined and passed to the program that is run. If no program to
+run is found, dh_auto_configure will exit without doing anything.
 
 This is intended to work for about 90% of packages. If it doesn't work,
 you're encouraged to skip using dh_auto_configure at all, and just run
@@ -87,6 +87,10 @@ if (-x "configure") {
 elsif (-x "waf" && -e "wscript") {
 	doit("./waf", "--nocache", "configure", "--prefix=/usr", @{$dh{U_PARAMS}});
 }
+elsif (-e "Setup.hs" || -e "Setup.lhs") {
+	doit("ghc", "--make", "Setup");
+	doit("./Setup", "configure", "--prefix=/usr", @{$dh{U_PARAMS}});
+}
 elsif (-e "Makefile.PL") {
 	# If set to a true value then MakeMaker's prompt function will
 	# # always return the default without waiting for user input.
diff --git a/dh_auto_install b/dh_auto_install
index 515fdc3..5c39abb 100755
--- a/dh_auto_install
+++ b/dh_auto_install
@@ -19,7 +19,7 @@ B<dh_auto_install> [S<I<debhelper options>>] [S<B<--> I<params>>]
 dh_auto_install is a debhelper program that tries to automatically install
 built files. If there's a Makefile and it contains a "install" target,
 then this is done by running make (or MAKE, if the environment variable is
-set). If there is a setup.py, waf or Build.PL, it is used.
+set). If there is a setup.py, Setup.lhs, Setup.hs, waf or Build.PL, it is used.
 
 The files are installed into debian/<package>/ if there is only one binary
 package. In the multiple binary package case, the files are instead
@@ -92,6 +92,10 @@ elsif (-e "setup.py") {
 elsif (-x "waf" && -e "wscript") {
 	doit("./waf", "--nocache", "install", "--destdir=$destdir", @{$dh{U_PARAMS}});
 }
+elsif (-e "Setup.hs" || -e "Setup.lhs") {
+	doit("ghc", "--make", "Setup");
+	doit("./Setup", "copy", "--destdir=$destdir", @{$dh{U_PARAMS}});
+}
 elsif (-e "Build.PL" && -e "Build") {
 	doit("perl", "Build", "install", "destdir=$destdir",
 		"create_packlist=0", @{$dh{U_PARAMS}});
diff --git a/dh_auto_test b/dh_auto_test
index 03289f5..937559b 100755
--- a/dh_auto_test
+++ b/dh_auto_test
@@ -57,6 +57,10 @@ if (-e "Makefile" || -e "makefile" || -e "GNUmakefile") {
 elsif (-x "waf" && -e "wscript") {
 	doit("./waf", "--nocache", "check", @{$dh{U_PARAMS}});
 }
+elsif (-e "Setup.hs" || -e "Setup.lhs") {
+	doit("ghc", "--make", "Setup");
+	doit("./Setup", "test", @{$dh{U_PARAMS}});
+}
 elsif (-e "Build.PL" && -e "Build") {
 	doit(qw/perl Build test/, @{$dh{U_PARAMS}});
 }
-- 
1.6.1.3





Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#499225; Package debhelper. (Wed, 25 Feb 2009 04:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. (Wed, 25 Feb 2009 04:21:02 GMT) Full text and rfc822 format available.

Message #20 received at 499225@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: "Trent W. Buck" <trentbuck@gmail.com>, 499225@bugs.debian.org
Subject: Re: Bug#499225: [PATCH 1/2] Support waf (closes: #499225).
Date: Tue, 24 Feb 2009 23:18:51 -0500
[Message part 1 (text/plain, inline)]
A few questions:

* Earlier, you said you wanted to run waf in preference to configure,
  but this looks to run it after?
* Is there any good reason to add the check for waf before the check
  for Build.PL? While it seems unlikely a package would include both,
  this could in theory change how such a package builds and probably
  break it. 

* Suprised to see the Setup.hs patch included in this; similar concerns
  with its ordering.
* The one Setup.hs file that I tried (in hpodder) does not delete Setup
  on 'Setup clean'.
* I'd really like to have the debian haskell people look over any
  cabal/Setup/haskell stuff before putting it into debhelper, and make
  sure we get it 100% right the first time. In particular 

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#499225; Package debhelper. (Wed, 25 Feb 2009 04:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Trent W. Buck" <trentbuck@gmail.com>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Wed, 25 Feb 2009 04:33:02 GMT) Full text and rfc822 format available.

Message #25 received at 499225@bugs.debian.org (full text, mbox):

From: "Trent W. Buck" <trentbuck@gmail.com>
To: Joey Hess <joeyh@debian.org>
Cc: 499225@bugs.debian.org
Subject: Re: Bug#499225: [PATCH 1/2] Support waf (closes: #499225).
Date: Wed, 25 Feb 2009 15:35:02 +1100
On Tue, Feb 24, 2009 at 11:18:51PM -0500, Joey Hess wrote:
> A few questions:
>
> * Earlier, you said you wanted to run waf in preference to
>   configure, but this looks to run it after?

That was based on the existing behaviour for Make.PL and setup.py,
which both defer to autoconf should it exist.

I work around it by doing "rm -f configure" in the clean target.

> * Is there any good reason to add the check for waf before the check
>   for Build.PL? While it seems unlikely a package would include
>   both, this could in theory change how such a package builds and
>   probably break it.

I stuck it directly below setup.py because they're both python thingies.
I'm not really fussed if you would prefer it to go below.

> * Suprised to see the Setup.hs patch included in this; similar
>   concerns with its ordering.

They're separate patches, because I realized I forgot to file a
separate wishlist bug for cabal (Setup.hs) support, and I couldn't be
bothered working out how to cherry-pick patches in git-format-email.

> * The one Setup.hs file that I tried (in hpodder) does not delete
>   Setup on 'Setup clean'.

I need to talk to the other Debian-Haskell people about this stuff
still.  Right now I guess they're asleep (or defecting to Arch :-/).

> * I'd really like to have the debian haskell people look over any
>   cabal/Setup/haskell stuff before putting it into debhelper, and
>   make sure we get it 100% right the first time. In particular

[You're message got cut off here.]

I have no problem getting Setup.hs stuff right before deploying it in
unstable/testing; I just want to get started so that it's ready by the
time Darcs (my package) transitions to cabal (scheduled for July).




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#499225; Package debhelper. (Wed, 25 Feb 2009 04:54:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. (Wed, 25 Feb 2009 04:54:05 GMT) Full text and rfc822 format available.

Message #30 received at 499225@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: "Trent W. Buck" <trentbuck@gmail.com>
Cc: 499225@bugs.debian.org
Subject: Re: Bug#499225: [PATCH 1/2] Support waf (closes: #499225).
Date: Tue, 24 Feb 2009 23:51:12 -0500
[Message part 1 (text/plain, inline)]
Trent W. Buck wrote:
> I stuck it directly below setup.py because they're both python thingies.
> I'm not really fussed if you would prefer it to go below.

I think it's safest to always add new stuff the the end of these
commands. Of course, that might mean the wrong stuff runs in some weird
packages, but that's very unlikely and in such a package, one guess is
probably as good as another -- as long as the guess is the same going
forward.
 
> > * The one Setup.hs file that I tried (in hpodder) does not delete
> >   Setup on 'Setup clean'.
> 
> I need to talk to the other Debian-Haskell people about this stuff
> still.  Right now I guess they're asleep (or defecting to Arch :-/).
> 
> > * I'd really like to have the debian haskell people look over any
> >   cabal/Setup/haskell stuff before putting it into debhelper, and
> >   make sure we get it 100% right the first time. In particular
> 
> [You're message got cut off here.]

[Don't think I really had anything important to add.]
 
> I have no problem getting Setup.hs stuff right before deploying it in
> unstable/testing; I just want to get started so that it's ready by the
> time Darcs (my package) transitions to cabal (scheduled for July).

The existing haskell-devscripts stuff might be a good source for a first
cut at getting it right. I am not sure though if debhelper itself can
afford to encode quite as much haskell-specific knowledge as those
commands do. At least, not until I use haskell a lot more. ;-)

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#499225; Package debhelper. (Wed, 01 Jul 2009 23:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ryan Niebur <ryanryan52@gmail.com>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Wed, 01 Jul 2009 23:00:02 GMT) Full text and rfc822 format available.

Message #35 received at 499225@bugs.debian.org (full text, mbox):

From: Ryan Niebur <ryanryan52@gmail.com>
To: 499225@bugs.debian.org
Subject: Re: Wish for waf support in dh_auto_build, dh_auto_clean, dh_auto_configure, dh_auto_install and dh_auto_test
Date: Wed, 1 Jul 2009 15:58:16 -0700
[Message part 1 (text/plain, inline)]
tag 499225 patch
quit

here's a buildsystem class to add support for this. I would be
grateful if you would add it to the package.

also, while working on this I noticed in doc/PROGRAMMING it says:
A buildsystem class needs to inherit or define these methods: DESCRIPTION,
check_auto_buildable, build, test, install, clean.

I think configure should be added to that list, yes?

Thanks,
Ryan

-- 
_________________________
Ryan Niebur
ryanryan52@gmail.com
[waf.pm (text/x-perl, attachment)]
[signature.asc (application/pgp-signature, inline)]

Tags added: patch Request was from Ryan Niebur <ryanryan52@gmail.com> to control@bugs.debian.org. (Wed, 01 Jul 2009 23:00:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#499225; Package debhelper. (Thu, 02 Jul 2009 00:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. (Thu, 02 Jul 2009 00:03:03 GMT) Full text and rfc822 format available.

Message #42 received at 499225@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: Ryan Niebur <ryanryan52@gmail.com>, 499225@bugs.debian.org
Subject: Re: Bug#499225: Wish for waf support in dh_auto_build, dh_auto_clean, dh_auto_configure, dh_auto_install and dh_auto_test
Date: Wed, 1 Jul 2009 19:55:41 -0400
[Message part 1 (text/plain, inline)]
Ryan Niebur wrote:
> here's a buildsystem class to add support for this. I would be
> grateful if you would add it to the package.

Comments interspersed.

> also, while working on this I noticed in doc/PROGRAMMING it says:
> A buildsystem class needs to inherit or define these methods: DESCRIPTION,
> check_auto_buildable, build, test, install, clean.
> 
> I think configure should be added to that list, yes?

Yes, done.
 
> package Debian::Debhelper::Buildsystem::waf;

Could you include a minimal copyright/license notice?

> sub check_auto_buildable {
>   my ($this, $step) = @_;

Could you please use tabs for indentation?

>   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?

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.
 
> sub configure {
>   my $this=shift;
>   $this->_do_waf("configure", "--prefix=/usr/", @_);
> }

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

Is this going to quietly succeed if there is no test suite?
It needs to..

> sub clean {
>   my $this=shift;
>   $this->_do_waf("distclean", @_);
>   $this->doit_in_sourcedir("rm", "-rf", "_build_");

_build_ is something distclean doesn't remove?

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Message sent on to "Trent W. Buck" <trentbuck@gmail.com>:
Bug#499225. (Sun, 26 Jul 2009 01:00:06 GMT) Full text and rfc822 format available.

Message #45 received at 499225-submitter@bugs.debian.org (full text, mbox):

From: Luca Falavigna <dktrkranz@ubuntu.com>
To: 499225-submitter@bugs.debian.org, Ryan Niebur <ryanryan52@gmail.com>
Subject: waf in NEW
Date: Sun, 26 Jul 2009 03:03:18 +0200
[Message part 1 (text/plain, inline)]
FYI, waf package has been uploaded and is currently waiting in the NEW
queue, so you will probably want to adjust your buildsystem to point to
the script installed as /usr/bin/waf when it will clear NEW.

I will also provide a list of packages that use an internal copy of waf
asking to use the packaged version instead.

Regards,

-- 
 . ''`.      Luca Falavigna
 : :'  :  Ubuntu MOTU Developer
 `. `'`     Debian Maintainer
   `-      GPG Key: 0x86BC2A50
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#499225; Package debhelper. (Sun, 26 Jul 2009 20:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ryan Niebur <ryanryan52@gmail.com>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Sun, 26 Jul 2009 20:09:02 GMT) Full text and rfc822 format available.

Message #50 received at 499225@bugs.debian.org (full text, mbox):

From: Ryan Niebur <ryanryan52@gmail.com>
To: Joey Hess <joeyh@debian.org>
Cc: 499225@bugs.debian.org
Subject: Re: Bug#499225: Wish for waf support in dh_auto_build, dh_auto_clean, dh_auto_configure, dh_auto_install and dh_auto_test
Date: Sun, 26 Jul 2009 13:04:39 -0700
[Message part 1 (text/plain, inline)]
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
ryanryan52@gmail.com
[waf.pm (text/x-perl, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#499225; Package debhelper. (Sun, 20 Dec 2009 05:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitrijs Ledkovs <dmitrij.ledkov@gmail.com>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Sun, 20 Dec 2009 05:33:03 GMT) Full text and rfc822 format available.

Message #55 received at 499225@bugs.debian.org (full text, mbox):

From: Dmitrijs Ledkovs <dmitrij.ledkov@gmail.com>
To: 499225@bugs.debian.org
Subject: Waf build system
Date: Sun, 20 Dec 2009 05:28:32 +0000
Added two variants with system wide waf and package supplied one.
The waf scripts as distributed in projects are DFSG-free. So that's
not an issue.
Preferring system-wide one in case of security updates.
Providing package supplied one in case project depends on that version
of waf, or it has modified
waf script itself instead of extending it using waffles (local python modules).

From b8d6ffdf0790065f5d72de636f48eebf8cbe73dc Mon Sep 17 00:00:00 2001
From: Ryan Niebur <ryanryan52@gmail.com>
Date: Sun, 20 Dec 2009 00:56:56 +0000
Subject: [PATCH] Waf build system support.

Added waf.pm by Ryan Niebur <ryanryan52@gmail.com>
Updated checks in autodetection.
Enabled parallel builds.
Added second waf variant.
Increased amount of expected buildsystem tests.
---
 Debian/Debhelper/Buildsystem/waf.pm     |   70 +++++++++++++++++++++++++++++++
 Debian/Debhelper/Buildsystem/waf_src.pm |   26 +++++++++++
 Debian/Debhelper/Dh_Buildsystems.pm     |    2 +
 t/buildsystems/buildsystem_tests        |    2 +-
 4 files changed, 99 insertions(+), 1 deletions(-)
 create mode 100644 Debian/Debhelper/Buildsystem/waf.pm
 create mode 100644 Debian/Debhelper/Buildsystem/waf_src.pm

diff --git a/Debian/Debhelper/Buildsystem/waf.pm
b/Debian/Debhelper/Buildsystem/waf.pm
new file mode 100644
index 0000000..98d1008
--- /dev/null
+++ b/Debian/Debhelper/Buildsystem/waf.pm
@@ -0,0 +1,70 @@
+# A debhelper build system class for handling Waf based projects.
+# Copyright: © 2009 Ryan Niebur
+#            © 2009 Dmitrijs Ledkovs
+# License: GPL-2+
+
+package Debian::Debhelper::Buildsystem::waf;
+
+use strict;
+use base 'Debian::Debhelper::Buildsystem';
+
+sub DESCRIPTION {
+	"waf using system-installed script";
+}
+
+sub DEFAULT_BUILD_DIRECTORY {
+	my $this=shift;
+	return $this->canonpath($this->get_sourcepath("build"));
+}
+
+sub check_auto_buildable {
+	my ( $this, $step ) = @_;
+	return -e $this->get_sourcepath("wscript") ? 1 : 0;
+}
+
+sub new {
+	my $class = shift;
+	my $this  = $class->SUPER::new(@_);
+	# Out of source tree building is prefered.
+	$this->prefer_out_of_source_building(@_);
+	return $this;
+}
+
+sub _do_waf {
+	my $this = shift;
+	unshift @_, "-j" . ($this->get_parallel() > 0 ? $this->get_parallel() : "");
+	return $this->doit_in_sourcedir( "/usr/bin/waf", "--nocache", @_ );
+}
+
+sub configure {
+	my $this = shift;
+	$this->_do_waf( "configure",
+			"--prefix=/usr",
+			"-b", $this->get_build_rel2sourcedir(),
+			@_ );
+}
+
+sub test {
+	my $this = shift;
+	#waf documentation suggestes to perform tests in the shutdown procedure
+	#which is run unconditionally on sucessful builds.
+	$this->_do_waf( @_ );
+}
+
+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;
diff --git a/Debian/Debhelper/Buildsystem/waf_src.pm
b/Debian/Debhelper/Buildsystem/waf_src.pm
new file mode 100644
index 0000000..00632af
--- /dev/null
+++ b/Debian/Debhelper/Buildsystem/waf_src.pm
@@ -0,0 +1,26 @@
+# A debhelper build system class for handling Waf based projects.
+# Copyright: © 2009 Dmitrijs Ledkovs
+# License: GPL-2+
+
+package Debian::Debhelper::Buildsystem::waf_src;
+
+use strict;
+use base 'Debian::Debhelper::Buildsystem::waf';
+
+sub DESCRIPTION {
+	"waf using source directory script";
+}
+
+sub check_auto_buildable {
+	my ( $this, $step ) = @_;
+	#TODO check that waf is executable or run as "python waf"?
+	return -e $this->get_sourcepath("waf") && -e
$this->get_sourcepath("wscript") ? 1 : 0;
+}
+
+sub _do_waf {
+	my $this = shift;
+	unshift @_, "-j" . ($this->get_parallel() > 0 ? $this->get_parallel() : "");
+	return $this->doit_in_sourcedir( "./waf", "--nocache", @_ );
+}
+
+1
diff --git a/Debian/Debhelper/Dh_Buildsystems.pm
b/Debian/Debhelper/Dh_Buildsystems.pm
index 0f34a2e..07c8af0 100644
--- a/Debian/Debhelper/Dh_Buildsystems.pm
+++ b/Debian/Debhelper/Dh_Buildsystems.pm
@@ -26,6 +26,8 @@ our @BUILDSYSTEMS = (
 	"perl_build",
 	"cmake",
 	"ant",
+	"waf",
+	"waf_src",
 );

 my $opt_buildsys;
diff --git a/t/buildsystems/buildsystem_tests b/t/buildsystems/buildsystem_tests
index 84741a4..820773d 100755
--- a/t/buildsystems/buildsystem_tests
+++ b/t/buildsystems/buildsystem_tests
@@ -1,6 +1,6 @@
 #!/usr/bin/perl

-use Test::More tests => 295;
+use Test::More tests => 305;

 use strict;
 use warnings;
-- 
1.6.3.3



-- 
With best regards


Dmitrijs Ledkovs (for short Dima),
Ледков Дмитрий Юрьевич

()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#499225; Package debhelper. (Sun, 17 Jul 2011 01:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. (Sun, 17 Jul 2011 01:39:03 GMT) Full text and rfc822 format available.

Message #60 received at 499225@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: Ryan Niebur <ryanryan52@gmail.com>
Cc: 499225@bugs.debian.org
Subject: Re: Bug#499225: Wish for waf support in dh_auto_build, dh_auto_clean, dh_auto_configure, dh_auto_install and dh_auto_test
Date: Sat, 16 Jul 2011 21:35:52 -0400
[Message part 1 (text/plain, inline)]
Ryan Niebur wrote (in 2009):
> 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?

I belive this is why the build system class did not get added to
debhelper. It seems that waf has in the mean time still not been
packaged. I'm not sure if it makes sense to add this class now, or not.

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#499225; Package debhelper. (Sat, 26 Jan 2013 15:48:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oliver Sauder <os@esite.ch>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. (Sat, 26 Jan 2013 15:48:03 GMT) Full text and rfc822 format available.

Message #65 received at 499225@bugs.debian.org (full text, mbox):

From: Oliver Sauder <os@esite.ch>
To: 499225@bugs.debian.org
Subject: Waf as source
Date: Sat, 26 Jan 2013 17:34:23 +0200
According to the discussion here [0] won't there be any waf package
available, but all packages using waf have to include its source code.

So therefore it would be still great to get the waf supported integrated
into debhelper.

Oliver

[0] http://lists.debian.org/debian-devel/2010/02/msg00714.html
[1] http://wiki.debian.org/UnpackWaf



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 22:28:43 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.