Source: highlight
Version: 3.12+svn83-1
Severity: wishlist
Tags: patch

Hi,

Thanks for taking care of highlight in Debian!

As part of this year's "Bootstrappable Debian" Google Summer of Code
project I took a look at highlight to break a circular build dependency
as noted in the "Feedback Arc Set" section of
http://bootstrap.debian.net/amd64/ and, more specifically, at
http://bootstrap.debian.net/source/highlight.html and the
version-specific pages linked from it.  There are two primary goals to
my work on this GSoC project:
- The first goal is to modify some packages so that they may be built in
  some limited way ("nocheck", binary-only, or build profiles like
  "stage1") without some of their usual build dependencies.  In most
  cases this is caused by one or more dependency loops between binary
  and source packages, so that a source package requires for its
  building, directly or indirectly, one of its own binary packages to be
  already built.  The modifications make the source build in a limited
  fashion (not generating documentation, not running tests, not building
  some of the binary packages) so that this may happen with only the
  rest of the build dependencies, so Debian may be bootstrapped on a new
  architecture starting from a very few cross-built toolchain packages
  and then moving along, source package by source package.
- The second goal, which is actually closely related to the first, is
  that in the process of modifications, any changes (some files not
  regenerated, others not built at all) can be made with binary package
  level granularity.  This means that if a binary package is built at
  all during a limited build, then it must have the same contents as the
  same binary package resulting from a full build.  The point here is to
  avoid breakage if other packages in the archive depend on some
  functionality provided by the omitted files; if so, it should be
  obvious that the functionality is missing, and the clearest way to do
  that is by omitting a full binary package or, rather, delaying its
  build until the rest of the build dependencies are present.

Now, with highlight this is relatively easy - SWIG is only used for
building the libhighlight-perl package, not for the actual highlight
libraries.  So what do you think about the attached patch that checks
for a "stage1" build profile specified in the DEB_BUILD_PROFILES
variable and, if so, omits the libhighlight-perl package from the build at
all?

In this iteration, one would also have to manually remove the offending
build dependencies from the control file; I will file another bug that
makes use of the new <profile.*> restriction and the new Build-Profiles
binary stanza header to make this completely automated.  However, that
would have to wait for the actual introduction of build profile-aware
tools in the Debian archive infrastructure.

If anything should go wrong with the patch, it is also available at
https://gitorious.org/roam-debian-bootstrap/highlight-debian/commits/roam-stage1-build

Thanks in advance for your time, and thanks for your work on Debian!

G'luck,
Peter

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

-- no debconf information
From 44445ee8bc3e71b655f057fd8f2118b782dc24af Mon Sep 17 00:00:00 2001
From: Peter Pentchev <r...@ringlet.net>
Date: Tue, 22 Jul 2014 03:25:16 +0300
Subject: [PATCH] Build without swig in the stage1 build profile.

Break a dependency loop as outlined in the version-specific pages at
http://bootstrap.debian.net/source/highlight.html
---
 debian/control | 1 +
 debian/rules   | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/debian/control b/debian/control
index 2faabdb..bd893ec 100644
--- a/debian/control
+++ b/debian/control
@@ -3,6 +3,7 @@ Section: devel
 Priority: optional
 Maintainer: Ayman Negm <n...@debian.org>
 Uploaders: David Bremner <brem...@debian.org>
+# For stage1 builds, remove the swig dependency.
 Build-Depends: debhelper (>= 9), swig, liblua5.1-0-dev, libboost-dev,
               pkg-config
 Standards-Version: 3.9.4
diff --git a/debian/rules b/debian/rules
index 3aaee3f..3f305ce 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,10 +5,16 @@ UPSTREAM=$(shell dpkg-parsechangelog |  sed -n 's/^Version: 
\(.*\)-[^-]*/\1/p')
 ORIG=${SOURCEPKG}_${UPSTREAM}.orig.tar.bz2
 
 %: 
+ifeq (,$(filter stage1,$(DEB_BUILD_PROFILES)))
        dh $@
+else
+       dh $@ -Nlibhighlight-perl
+endif
 
 override_dh_auto_build:
+ifeq (,$(filter stage1,$(DEB_BUILD_PROFILES)))
        $(MAKE) -C examples/swig perl
+endif
        $(MAKE) -C src clean
        $(MAKE) LUA_LIBS=-llua5.1
 
-- 
2.1.0.rc1

Attachment: signature.asc
Description: Digital signature

Reply via email to