Page 1 of 1

Q8 Debian 8 debuild fails: "update-alternatives: error: alternative path /usr/bin/compare-im6 doesn't exist"

Posted: 2016-08-14T14:10:04-07:00
by igorclark
Hello, I'd really appreciate some help getting a Debian 8 (Jessie) ImageMagick source build-and-package working with a quantum depth of 8.

Context: we have a custom build of ImageMagick using quantum depth 8, because it keeps memory usage down and speeds up some operations quite significantly as a result. We've been doing this on Debian 7 (Wheezy) by downloading the IM source with apt-get, making some changes to debian/rules and running debuild -uc -us, and then exporting the .deb files for installing in deployment-machine builds.

Google has recently stopped supporting Wheezy on Compute Engine, so I'm trying to get a similar pipeline working on Jessie.

However, Jessie's ImageMagick source package doesn't seem to build a Q8 without some fiddling; just changing the

Code: Select all

export QUANTUMDEPTH ?= Q16
in debian/rules to

Code: Select all

export QUANTUMDEPTH ?= Q8
results in various errors, which I've dealt with one-by-one by doing these:

Code: Select all

$ sed 's/Q16/Q8/g' -i debian/rules -i debian/imagemagick.manpages
$ cp ./debian/libmagickcore-6.q16-2-extra.install ./debian/libmagickcore-6.q8-2-extra.install
This all gets it to build successfully, but the packages it created by debuild won't install on a fresh Jessie VM; whether I install the dependencies first (apt-get install -y liblqr-1-0 libfftw3-bin libfontconfig libxext-dev libxt6 libltdl7) or ask to install the .deb with dpkg -i *.deb and then run apt-get install -f to fix up the dependencies, either way I get this:

Code: Select all

update-alternatives: error: alternative path /usr/bin/compare-im6 doesn't exist
dpkg: error processing package imagemagick (--install):
 subprocess installed post-installation script returned error exit status 2
The only references I can find to this are debian 709856/709845 and 743042 which are closed, and 810591 which suggests it might be because the Q16 binaries aren't installed - but if this is the case, how is anyone supposed to build a Q8 version?

I also tried setting the imagemagick "Architecture" to "any" in debian/control as suggested in 709856, but then I get this before the build even finishes:

Code: Select all

dh_install: imagemagick missing files (usr/bin/compare-*), aborting
debian/rules:355: recipe for target 'override_dh_install-indep' failed
BTW, I tried just installing imagemagick from the main repo, which installs and works fine, but gives no options on quantum depth. I've also tried running against the newer source package in debian unstable, but there's no difference.

I've posted this on StackOverflow as well in case any debian wizards come across it there; I haven't posted or reopened any debian bug yet though because I could easily be missing some way in which to tell the debian build system to use Q8. If anyone knows that, I'd love to hear about it!

Also, I've tried just building directly from the source using --with-quantum-depth=8, which builds fine - but our build process uses HHVM debian packages, and after several hours banging my head on this, getting the source-built version into HHVM-package-compatible .deb files is more than I can face if there's any alternative!

Thanks :-)