4

I have a package (Dymo CUPS drivers in this instance) that I need to compile to a .deb file to include in a private network's repositories. The source itself is sufficiently architecture independent that it'll compile on 32-bit and 64-bit. I am using debhelper to build the packages, and have successfully built the package for the native architecture.

Most of the machines run Precise 64-bit, but some run Precise 32-bit. The current build machine is 64-bit. What I want to be able to do is "cross-compile" the package and generate the 32-bit packages from the 64-bit packages.

What I've tried:

  • Adding "-a" or "--architecture" flags to fakeroot debian/rules binary - fails because it doesn't understand the argument (I must have copied it from a dpkg or other command)
  • Add override_dh_auto_configure in debian/rules that supplies -m32 for CFLAGS etc - builds as 32-bit, but packages and defines dependencies as a 64-bit package
  • Installing dpkg-cross and running fakeroot debian/rules binary-cross (based on an idea from these cross-compile instructions) - fails because binary-cross doesn't exist as a standard dh command

Things I can't try:

  • Launchpad/PPA/any other external build service - everything needs to be part of our infrastructure

Is there any way to make debhelper build 32-bit .deb files on a 64-bit machine? And if so, how?

1
  • As we're working on Ubuntu 12.04, we've decided to go with a 32-bit LXC container for the build. No other methods appear to work.
    – IBBoard
    Sep 19, 2012 at 15:02

1 Answer 1

0

debuild -ai386 should set everything up correctly, but it depends on having the proper multiarch build-dependencies installed; it's easier with a recent version of sbuild (more recent than is in precise, I'm afraid), and it does depend on all the libraries you use having been converted to multiarch. See https://wiki.ubuntu.com/CrossBuilding for details.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .