1

I want to use the graphviz package on an Ubuntu system, but according to the build log it is configured using --without-gts, whereas I want GTS support to be included (I don't know if there's a reason why it isn't, or if it's just an arbitrary decision).

What's the best way to go about doing this? Ideally I want to keep my build as close as possible to the one shipped in Ubuntu, as that would make it easier to get the change merged in at a later date. I'm struggling to find any guides which show how to do this - they all seem to assume you want to package new software from scratch.

pwaring
  • 113

1 Answers1

4

The general procedure for changing build options for an Ubuntu/Debian package goes like this:

  1. Get the build dependencies
  2. Download the source package
  3. Change the appropriate files (usually debian/rules)
  4. Build the packages
  5. Install the packages

The commands involved:

sudo apt-get build-dep graphviz
apt-get source graphviz
cd graphviz-* # Or check the directory with ls and pick the correct version

Then you can delete the configuration option from debian/rules, either using an editor, or:

sed -i '/--without-gts/d' debian/rules

This command is specific to this instance, as there is only one match for --without-gts in debian/rules.

Then build the package:

dpkg-buildpackage -us -uc

This will create a bunch of packages in the parent directory. The options indicate the you don't wish to make a package for uploading to the Ubuntu repositories (and so don't want to sign them, etc.). Now you can install these packages:

sudo dpkg -i ../*.deb # or pick out the packages manually

The build dependencies may be different from the installation dependencies, so to install all the dependencies you might need to run:

sudo apt-get install -f
muru
  • 197,895
  • 55
  • 485
  • 740
  • Thanks, that's incredibly helpful. Sadly the package won't build even without changing the GTS option but that's something I'll have to look into. – pwaring Jan 12 '15 at 10:48
  • There were a couple of errors about changed documentation PDF files when I tried, but otherwise it built successfully. What error did you get? – muru Jan 12 '15 at 11:16
  • @pwaring I had made a typo: it should be build-dep instead of build-deps, sorry about that. – muru Jan 12 '15 at 11:17
  • The final errors are:
    
    dh_install --sourcedir=debian/tmp --list-missing
    
    dh_install: libgvc6 missing files (usr/lib/graphviz/libgvplugin_pango.so.*), aborting
    make: *** [install] Error 255
    dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
    
    – pwaring Jan 12 '15 at 11:19
  • @pwaring Yeah, that's completely different from what I got, so I can't help much. – muru Jan 12 '15 at 11:26