Emulation Packages
1.
Emulation Packages
Policy
Warning: This guide is deprecated! |
- Don't just copy the version number of the 'main' package (e.g. gtk+ for
gtklibs). It will create problems with updates.
- For complete new emul-packages, bump the major version number
- For selective updates to the real packages (i.e. the ones in
SRC_URI), bump the minor version number
- For changes that only affect the ebuild, bump the revision number
- 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:
- Get an amd64 stage2 tarball and unpack it to the chroot
location
- Do all the bind-mounts (/dev, /proc,
/sys, /usr/portage)
- Chroot in
- run find /usr/lib64 /lib64 -exec touch {} \;
- Remove the CHOST=... line from /etc/make.conf and set
FEATURES="noman noinfo -unmerge-orphans", USE="bindist"
- Change the /etc/make.profile link to
profiles/default/linux/amd64/dev/32bit-userland
- Run emerge --nodeps portage && rm -rf /usr/lib64/portage && source /etc/profile
- 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:
- Chroot into your emul-chroot
- Clean out /usr/portage/packages
- emerge -DuF $emul_package
- Copy the just fetched distfiles into
/usr/portage/packages/All
- Emerge all of them using emerge -K
- Emerge the packages you want to update (don't forget
FEATURES=buildpkg)
- 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/libcrack.la.
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.
The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-2.5 license. The Gentoo Name and Logo Usage Guidelines apply.
|