BACKGROUD
Many of us have experienced the problem of emerging a package (most commonly Wine) only to find that two of the dependencies (namely media-libs/harfbuzz and media-libs/freetype) depend on each other breaking the emerge command.
This is a common problem. A quick search in the nets returns instances of this problem as far back as last year. In Gentoo forums, the most commented topic about this has many ideas for how to solve this but, either they are specific to the O.P. or maybe some solutions are implicit or vague or solved the problem in a specific machine for a specific installation.
I believe to have found a more general solution that is applicable to most installations. But before we start on the solution, let me repeat that many will encounter this problem when installing wine for the first time. But the problem is not actually Wine. Some users have reported that this -hard-to-solve- circular dependency problem is present on fresh installs. As I can attest for this too. When issuing a
Code: Select all
emerge -aDNuv @worldA PROPOSED SOLUTION
This solution assumes that media-libs/freetype is already compiled with the USE harfbuzz (as I believe most of us have done at some point in the past on our system). Also, that all packages involved in the problem have not been already compiled with the flag abi_x86_32. My best advice is to start fresh, that is, if you have already compiled such packages but exactly know what was recompiled w/abi_x86_32 (as can be backed up either on /etc/portage/package.use/package.use or /etc/portage/package.use/zz-autounmask or equivalent), go ahead and first undo those changes. Replace any instance of abi_x86_32 in those files for the contending packages with - abi_x86_32 and issue a emerge -aDNuv @world command. In any case, I believe the solution I suggest works for most users when first encountering the problem, but in a heavily modified or tweaked system this may not work.
- Step 1. If in a graphical setting, do not leave your system unattended, or else, disable your screensaver.
Step2. Uninstall media-libs/harfbuzz and media-libs/freetype:Step 3. Reinstall the same packages, this time with flag abi_x86_32 enabled:Code: Select all
emerge -aC media-libs/harfbuzz media-libs/freetypeOn a multilib system, with default ABI=64, this will install both packages with both ABIs. This is the most important step as the circular dependency problem not only affects 64bit builds, but also 32bit builds. This command instructs portage to not use the flags that are the culprits for these two packages to intertwine. Some packages are going to be reinstalled with abi_x86_32 (requirements for freetype and harfbuzz, on a system-by-system basis)Code: Select all
USE="-truetype -harfbuzz abi_x86_32" emerge -a media-libs/harfbuzz media-libs/freetype
Step 4. Instruct portage to re-emerge only one package, this time with all flags permitted:This is necessary, as portage will pull media-libs/harfbuzz as a requirement, and will wait until the completion of the first emerge (harfbuzz) to issue the second one (freetype).Code: Select all
USE="abi_x86_32" emerge -a --oneshot freetype
Step 5. The next time you emerge the original offending pakcage (e.g. Wine) you might still see some circular dependencies but this time, portage will suggest a solution, e.g.:Code: Select all
(sys-libs/gpm-1.20.7-r3:0/0::gentoo, ebuild scheduled for merge) depends on (sys-libs/ncurses-6.2-r1:0/6::gentoo, ebuild scheduled for merge) (buildtime_slot_op) (sys-libs/gpm-1.20.7-r3:0/0::gentoo, ebuild scheduled for merge) (buildtime) It might be possible to break this cycle by applying the following change: - sys-libs/ncurses-6.2-r1 (Change USE: -gpm)
So go ahead and make portage happy by updating your package.use until there are no more conflicts found.
Step 6. After the completion of the (Wine) emerge, undo the changes to the USE flags that caused circular dependencies in the previous step.
Step 7. The installations in steps 3 - 5 issued temporal USE flags to portage. So you may want to make those changes permanent by updating your /etc/portage/package.use/package.use accordingly.
In my journey with Gentoo, I have learned to annotate, every USE change to the system. Also, it is a good idea to not accept any "Would you like to add these changes to your config files?" issued by portage, but only if strictly necessary. And if so, place comments and separate on package.use or zz-autounmasks all these requirements if in the future, I want to undo some changes. The default behavior of portage is to append all new requirements on these files after each package wants them, but does not place any new lines. So, if you been accepting this messages many times for many packages it would be very difficult to discern which packages required which flags. UNLESS there is a feature that I don't know of.





