Gentoo Logo

Emulation Packages

1.  Emulation Packages


Warning: This guide is deprecated!

  1. Don't just copy the version number of the 'main' package (e.g. gtk+ for gtklibs). It will create problems with updates.
  2. For complete new emul-packages, bump the major version number
  3. For selective updates to the real packages (i.e. the ones in SRC_URI), bump the minor version number
  4. For changes that only affect the ebuild, bump the revision number
  5. Don't ever apply manual changes to the SRC_URI packages. Everything must be changed in the ebuilds directly.

How to create emul-packages

First, you have to set up a emul-chroot. Note that this is not the same as an ordinary 32bit-chroot. Here's how to create one:

  1. Get an amd64 stage2 tarball and unpack it to the chroot location
  2. Do all the bind-mounts (/dev, /proc, /sys, /usr/portage)
  3. Chroot in
  4. run find /usr/lib64 /lib64 -exec touch {} \;
  5. Remove the CHOST=... line from /etc/make.conf and set FEATURES="noman noinfo -unmerge-orphans", USE="bindist"
  6. Change the /etc/make.profile link to profiles/default/linux/amd64/dev/32bit-userland
  7. Run emerge --nodeps portage && rm -rf /usr/lib64/portage && source /etc/profile
  8. Run emerge -e world

Once you have set up your emul-chroot, you can merge the packages you want in the emul-package. Make sure you have FEATURES="buildpkg" set. The binpkgs you just created serve as SRC_URI for the emul-package. Don't modify them! Double-check that the dependencies between the existing emul-packages are still fulfilled, repoman won't warn you about this and it can cause major borkage!

Now you can create an ebuild for the emul-package. Have a look at the existing ebuilds to get an idea what it should look like. Remove all the files that are not ABI-specific or would collide with the 64bit package.

How to update emul-packages

There are a few dangerous things that are easily forgotten when updating emul-packages, most critical are the dependencies. To minimize the risk of breakage, follow this procedure when upgrading an emul-package:

  1. Chroot into your emul-chroot
  2. Clean out /usr/portage/packages
  3. emerge -DuF $emul_package
  4. Copy the just fetched distfiles into /usr/portage/packages/All
  5. Emerge all of them using emerge -K
  6. Emerge the packages you want to update (don't forget FEATURES=buildpkg)
  7. Bump the emul-package ebuild and use the just generated binpkgs as SRC_URI for it

Warning: Make sure you update the content listing.

Known glitches

Make sure you get the dependencies right. Check all installed .so files if there are any unsatisfied deps and either remove them (if not needed) or include the needed dep: for a in $(equery f emul-linux-x86-??? | grep "\.so") ; do [[ -z $(ldd $a | grep "not found") ]] || echo $a ; done helps

Some ebuilds also have the bad habit of creating files in pkg_postinst. buildpkg/quickpkg doesn't cover these, so you'll have to copy that function to the emul-ebuild.

If sys-apps/shadow complains that it can't find libcrack, try upgrading to =sys-devel/libtool-1.5.23b or rm /usr/lib64/

sys-devel/gcc and sys-libs/glibc are known to fail. Just ignore it, they are multilib-aware themselves anyway and you have all the libraries in both 32/64bit versions already.


Page updated February 24, 2009

Summary: This document describes how to maintain the emul-packages.

Simon Stelling

Donate to support our development efforts.

Copyright 2001-2014 Gentoo Foundation, Inc. Questions, Comments? Contact us.