Steve Langasek [Wed, 28 Sep 2011 19:37:42 +0000 (12:37 -0700)]
pass dpkg-buildflags to makemaker build system
The standard way to pass build flags to makemaker perl build systems is to
set the OPTIMIZE variable on the commandline; CFLAGS in the environment gets
ignored entirely. So pass the CFLAGS from the environment to Makefile.PL so
makemaker packages can also benefit from dpkg-buildflags.
* dh: Now you can use override_dh_command-arch and override_dh_command-indep
to run different overrides when building arch and indep packages. This
allows for a much simplified form of rules file in this situation, where
build-arch/indep and binary-arch/indep targets do not need to be manually
specified. See man page for examples.
* dh: Note that if a rules file has say, override_dh_fixperms-arch,
but no corresponding override_dh_fixperms-indep, then the unoverridden
dh_fixperms will be run on the indep packages.
* dh: Note that the old override_dh_command takes precidence over the new
overrides, because mixing the two types of overrides would have been
too complicated. In particular, it's difficult to ensure an
old override target will work if it's sometimes constrained to only
acting on half the packages it would normally run on. This would be
a source of subtle bugs, so is avoided.
Gergely Nagy [Tue, 23 Aug 2011 18:36:57 +0000 (20:36 +0200)]
dh_installlogcheck: Add support for --name.
This patch makes dh_installlogcheck be similar to other helpers, like
dh_installlogrotate that already support a --name option: to install
the files as if they were installed by a different package.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Joey Hess [Sat, 6 Aug 2011 22:58:55 +0000 (18:58 -0400)]
dpkg-buildflags is only used to set environment in v9
To avoid re-breaking packages that were already broken a first time by
dpkg-buildpackage unconditionally setting the environment, and unbroke it
by unsetting variables in the rules file. (Example: numpy)
Add support for running tests in parallel to the cmake build system.
Pass appropriate -jN option to ctest (via ARGS variable in the Makefile) to
enable support for running tests in parallel. Similarly to makefile build
system, ctest -j1 mode is enforced even when parallel mode in debhelper is not
explicitly enabled.
Unlike make, CTest does not have "unlimited parallel" setting (-j implies -j1).
So in order to simulate unlimited parallel, allow to fork a huge number of
threads instead.
makefile.pm: remove build directory even if Makefile does not exist yet.
Assume that the package can be cleaned (i.e. the build directory can be
removed) as long as it is built out-of-source tree and can be configured. This
is useful for derivative buildsystems which generate Makefiles.
If a rules file has a custom install or binary target, those targets
still need to explicitly depend on the build target. Unless dh is used
in such a target (which it probably is of course).
It's not possible to avoid the need for those dependencies. A rules file
with a hand-written binary target simply does not run dh, so dh can
do nothing to help it run the build target.
Reword the docs to not give the wrong impression that dh somehow
magically makes that work.
dh: Remove obsolete optimisation hack that caused sequence breakage in v9 with a rules file with an explict build target. Closes: #634784
This hack was necessary back when dh ran each target, and so recursively
invoked itself. If debian/rules binary ran debian/rules binary-arch ran
debian/rules install-arch ran debian/rules build-arch, then debhelper
commands would be running with -a throughout, and so for debian/rules
binary-indep it would have to re-run all the commands with -i. The hack
avoided this extra work (and expecially dh_auto_configure running twice) by
first running the common commands without -i or -a and only then following
through with running the explicit per-arch targets, which didn't run many
(if any) additional commands.
But now dh does not run implicit targets, so (unless targets
are explicit), it will instead just construct a sequence of debhelper
commands to run directly, and so the -a flag is avoided.
Now the QT4 version of qmake can be explicitly selected by passing --buildsystem=qmake_qt4. Closes: #566840
There is that build system option patch that I suckily never applied,
and could be used here.. but this is at its core a different build system,
and so handling it as such makes the most sense.
It may make sense to have a qmake_qt3 build system, but perhaps QT 3
will instead just go away. I considered just waiting, but this is an easy
fix. ;)
dh: In v9, do not enable any python support commands.
dh_pysupport has started emitting a deprecation warning, which is
very annoying since it clutters every build that uses dh -- even builds
where it doesn't do anything. Since there is not just a dh_python2, but
also a dh_python3 waiting in the wings, this is clearly too volatile
a situation for dh to try to support further.
I considered making dh_python detect and run the right dh_python[23] helper
-- a python helper helper as it were -- but 70-odd packages still use that
command.
Modestas Vainius [Sun, 19 Jun 2011 20:53:14 +0000 (23:53 +0300)]
Always respect DEB_${flag}_{APPEND,SET} envvars.
Do that even when dpkg-buildpackage modifies environment variables. Also
document DEB_${flag}_{APPEND,SET} as recommended way to override standard build
flags.
Modestas Vainius [Sat, 18 Jun 2011 20:02:42 +0000 (23:02 +0300)]
Use Dpkg::BuildFlags module directly in set_buildflags().
Dpkg::BuildFlags API is declared stable. It should be safe to use it directly
rather than dpkg-buildflags wrapper. In addition, do not do any
DEB_BUILD_OPTIONS=noopt handling in debhelper. Dpkg::BuildFlags already does it
for us.
Joey Hess [Tue, 14 Jun 2011 21:22:34 +0000 (17:22 -0400)]
dpkg-buildflags support
* dh_auto_build, dh_auto_configure, dh: Set environment variables
listed by dpkg-buildflags --export. Any environment variables that
are already set to other values will not be changed. Closes: #544844
* Also, support DEB_BUILD_OPTIONS=noopt, by changing -O2 to -O0.
Joey Hess [Tue, 14 Jun 2011 16:24:31 +0000 (12:24 -0400)]
avoid infinite recursion
The makefile parse causes dh to be run recursively.
Before, dh would just immediatly fail with "unknown sequence", but
now it has to run the makefile parse to calculate the sequences, so an
earlier bailout is needed.
Joey Hess [Mon, 13 Jun 2011 23:13:32 +0000 (19:13 -0400)]
honor empty targets
An empty explicit target in debian/rules should still be run,
to run its dependencies, and allow defining empty targets in order to
skip running what's nornally done by a sequence.
Joey Hess [Mon, 13 Jun 2011 21:00:08 +0000 (17:00 -0400)]
inline sequences to optimize away recursive calls to make/dh for implicit targets
This assumes that all implicit rules file targets are owned by dh, so
it can just assume an implicit target can be optimized away to the commands
in its sequence.
I suppose this would break:
build:
dh build
install: build
dh install
binary-%: install
my-binary-builder-$@
my-binary-builder-arch:
echo "whee! I did something pointlessly complicated with make!"
dh binary-arch
my-binary-builder-indep:
dh binary-indep
But I can't imagine anyone does this, at least with a probability of 1 in
ten thousand, so hopefully it doesn't break any existing packages. :)
Joey Hess [Mon, 13 Jun 2011 20:41:21 +0000 (16:41 -0400)]
improve sequence logic
Reorder code so sequences can all be built before addons are loaded, so
addon interface can always affect all commands in any sequences. This fixes
a bug in the previous patch, where addons could not influence dh_testdir
and dh_testroot.
Joey Hess [Mon, 13 Jun 2011 20:14:59 +0000 (16:14 -0400)]
move dh_auto_configure out of @bd_minimal
Callers overriding build targets will need to configure by hand or by
calling dh_auto_configure, which should be the status quo. And moving
dh_auto_configure to build (and build-arch and build-indep) will not
make it run twice AFAICS (except for the edge case when it already did:
debian/rules build-arch build-indep)
Roger Leigh [Sun, 12 Jun 2011 19:22:43 +0000 (20:22 +0100)]
dh: Use minimal sequences if delegating work
The build and install rules run a minimal sequence if the build-arch or
build-indep, or install-arch or install-indep targets, respectively,
are present in debian/rules. The purpose is to not do work ahead of
time, such as building before the build-arch or build-indep targets are
built, which could potentially lead to misbuilds. If the targets are
not defined, the sequences may be run directly which is faster due to
being able to run the arch and indep commands together.
Roger Leigh [Fri, 3 Jun 2011 19:41:30 +0000 (20:41 +0100)]
dh: Add sequence dependency support
Rather than dh sequences containing dependent sequences within
themselves, invoke the sub-sequence via debian/rules to permit
overriding and customisation using the policy-defined debian/rules
targets.