Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to include a preview of the new experimental Gtk+ 3 build of Inkscape in our PPA... I want to compile the upstream source using different compile-time options to generate two different binary packages: "inkscape-trunk" (the normal daily build) and "inkscape-trunk-gtk3" (the experimental Gtk+ 3 build).

Below, I've shown how I'd do this manually using the upstream source but I need to know how to do it using Debian packaging tools.

I already found the mpb and vim Ubuntu source packages, which both create multiple binaries using different compile-time configurations. However, both of these use old debhelper syntax, and the rules files both end up being rather complex.

My question: Can anyone suggest a suitable example package, in which multiple binary builds are performed using the new elegant "dh" debhelper syntax? Is this even possible, or do I have to resort to writing the rules file manually.

# Building two different configurations of the same package...

# Make subfolders for building the two different configurations
src_dir=`pwd`
build_default_dir=${src_dir}/build-default
build_gtk3_dir=${src_dir}/build-gtk3
mkdir -p $build_default_dir
mkdir -p $build_gtk3_dir

# Generate build files
./autogen.sh

# Configure and build the default version
cd $build_default_dir
../configure --prefix=/usr/
make

# Configure and build the gtk+ 3 version
cd $build_gtk3_dir
../configure --prefix=/usr/ --enable-gtk3-experimental
make
share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Take a look at the qbittorrent package, it builds two versions of the package from the same source using the new dh syntax. Here's what it might look like in your case (untested):

#!/usr/bin/make -f
%:
    dh $@

override_dh_auto_configure:
    mkdir -p build-nox && cd build-default && ../configure --prefix=/usr
    mkdir -p build-gtk3 && cd build-gtk3 && ../configure --prefix=/usr --enable-gtk3-experimental

override_dh_auto_build:
    dh_auto_build --builddirectory build-default
    dh_auto_build --builddirectory build-gtk3

override_dh_auto_install:
    dh_auto_install --builddirectory build-default --destdir debian/inkscape-trunk
    dh_auto_install --builddirectory build-gtk3 --destdir debian/inkscape-trunk-gtk3

override_dh_auto_clean:
    dh_auto_clean --builddirectory build-default
    dh_auto_clean --builddirectory build-gtk3
share|improve this answer
    
This looks great... the --builddirectory flag looks very useful. A couple of minor points that come to mind: 1. I need to run autogen.sh to generate build files for the PPA - easily done in the override_dh_auto_configure rule 2. Is there a reason why we couldn't use dh_auto_configure --builddirectory -- --enable-whatever in the override_dh_auto_configure rule? 3. There will be quite a lot of redundancy here... for example, all the tutorial files, icons etc will be identical for each build. I guess it would be nice to have a shared inkscape-trunk-data package for both configs –  Alex Valavanis Jul 9 '13 at 17:07
    
Sorry, that was meant to say dh_auto_configure --builddirectory build-gtk3 -- --enable-gtk3-experimental (for example). –  Alex Valavanis Jul 9 '13 at 17:19
    
dh_auto_configure --builddirectory build-gtk3 -- --enable-gtk3-experimental should work as well. I was just basing this on qbittorrent's approach as it's a package I've touch. I'm not sure why the maintainer made that choice. –  andrewsomething Jul 9 '13 at 18:17
    
Sorry about the slow reply. I've finally sorted it. I had to make a couple of minor changes, but it's almost exactly how you suggested. See the rules file in the repo. Many thanks for your great answer. –  Alex Valavanis Aug 13 '13 at 15:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.