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 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?

share|improve this question
    
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 '12 at 15:02

1 Answer 1

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.

share|improve this answer

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.