I've made some progress, but not as much as I thought I would. Jodal omitted a critical step, which is so obvious I can't blame him. The steps given above should have been.
mdkir ptest
cd ptest
apt-get source bc
cd bc-1.06.95
OS=debian DIST=jessie ARCH=armhf pdebuild
My (stupid) mistake was that you need to cd into the directory with the actual code; it's not good enough to run pdebuild in the location where you did the apt-get.
Anyway, this results in several files found in /var/cache/pbuilder/debian-jessie-armhf/result (this location is specified by Jodal's .pbuilderrc file). Among these files is bc_1.06.95-9_armhf.deb. Copy that deb file to the BBBchroot directory, created earlier with debootstrap and qemu. Then do
chroot BBBchroot
cd /pbtest
dpkg -i *.deb
where pbtest is the location of the bc deb file created by pdebuild.
So we have proof of concept. The bc command now exists on the armhf machine being emulated on the i386. But I still can't figure out how to rebuild libgtk-3-dev for armhf. Following the template of what worked for bc, I did:
mkdir /gtk_build_test
cd /gtk_build_test
apt-get source libgtk-3-dev
cd gtk+3.0-3.14.5
OS=debian DIST=jessie ARCH=armhf pdebuild
The apt-get source does complain a little, saying that it is "Picking gtk+3.0 as source package instead of 'libgtk-3-dev'," but I don't think that matters. The pdebuild gives this output
Code: Select all
root@debian:/pb_gtkbuild/gtk+3.0-3.14.5# OS=debian DIST=jessie ARCH=armhf pdebuild
Using Jodal's script
DEBOOTSTRAPOPTS set to --variant=buildd
BASETGZ set to /var/cache/pbuilder/debian-jessie-armhf-base.tgz
BUILDPLACE set to/var/cache/pbuilder/build
BUILDRESULT set to/var/cache/pbuilder/debian-jessie-armhf/result/
CCACHEDIR set to
APTCACHE set to/var/cache/pbuilder/debian-jessie-armhf/aptcache/
LOGFILE set to
dpkg-checkbuilddeps: Unmet build dependencies: cdbs (>= 0.4.93) gnome-pkg-tools (>= 0.11) gtk-doc-tools (>= 1.20) dh-autoreconf autotools-dev libxt-dev libxkbfile-dev libcups2-dev (>= 1.2) libcolord-dev (>= 0.1.9) librest-dev libjson-glib-dev gobject-introspection (>= 1.41.3) libgirepository1.0-dev (>= 1.39.0) xvfb
W: Unmet build-dependency in source
dpkg-buildpackage: warning: using a gain-root-command while being root
dpkg-buildpackage: source package gtk+3.0
dpkg-buildpackage: source version 3.14.5-1+deb8u1
dpkg-buildpackage: source distribution jessie
dpkg-buildpackage: source changed by Andreas Henriksson <andreas@fatal.se>
dpkg-source --before-build gtk+3.0-3.14.5
dpkg-checkbuilddeps: Unmet build dependencies: cdbs (>= 0.4.93) gnome-pkg-tools (>= 0.11) gtk-doc-tools (>= 1.20) dh-autoreconf autotools-dev libxt-dev libxkbfile-dev libcups2-dev (>= 1.2) libcolord-dev (>= 0.1.9) librest-dev libjson-glib-dev gobject-introspection (>= 1.41.3) libgirepository1.0-dev (>= 1.39.0) xvfb
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
dpkg-buildpackage: warning: this is currently a non-fatal warning with -S, but will probably become fatal in the future
fakeroot debian/rules clean
debian/rules:8: /usr/share/cdbs/1/rules/autoreconf.mk: No such file or directory
debian/rules:9: /usr/share/cdbs/1/rules/debhelper.mk: No such file or directory
debian/rules:10: /usr/share/cdbs/1/rules/utils.mk: No such file or directory
debian/rules:11: /usr/share/cdbs/1/class/gnome.mk: No such file or directory
debian/rules:12: /usr/share/gnome-pkg-tools/1/rules/uploaders.mk: No such file or directory
debian/rules:13: /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk: No such file or directory
debian/rules:14: /usr/share/gnome-pkg-tools/1/rules/gnome-version.mk: No such file or directory
make: *** No rule to make target '/usr/share/gnome-pkg-tools/1/rules/gnome-version.mk'. Stop.
dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2
The gist of which is that there are unmet dependencies and pdebuild doesn't know how to deal with them.
Based on small crumbs I found with google, it seems like there is some way to have pdebuild work up the tree to build whatever is necessary for the ultimate target, but it's unclear how this is arranged. Does it involve any of mk-build-deps, gdebi, or something related to the HOOKDIR value set by the .pbuilderrc file?
Actually, step back and consider the actual goal: compiling code which relies on libgtk-3-dev so that it will run on BBB. Maybe I don't need pbuilder at all. pbuilder would be an automated way to convert my code to run on a variety of architectures and OSes, but I only want to run on a single physical BBB -- the one on my desk right now. Would it work to chroot to the armhf emulator, apt-get the gtk source, like I already did, examine the contents of debian/control (which seems to list all of the prerequisite packages), apt-get install any missing packages, then do a configure, make, and make install of gtk, all within the armhf emulator? Granted, that is seen as a crude hack these days, and pbuilder is pretty cool, and having come this far I want to understand it better, but maybe what I just described is an easier and more direct route to the goal -- if it would work.