Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 716334 - app-editors/emacs needs install-time dependency on app-eselect/eselect-emacs
Summary: app-editors/emacs needs install-time dependency on app-eselect/eselect-emacs
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: GNU Emacs project
Depends on: IDEPEND
  Show dependency tree
Reported: 2020-04-05 14:00 UTC by David Michael
Modified: 2021-07-12 14:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---

fix.patch (0001-app-editors-emacs-EAPI-8.patch,16.99 KB, patch)
2021-06-13 23:23 UTC, David Michael
Details | Diff
fix.patch (0001-app-editors-emacs-EAPI-8.patch,17.57 KB, patch)
2021-06-19 15:18 UTC, David Michael
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Michael 2020-04-05 14:00:39 UTC
When I install Emacs in a sysroot, the /usr/bin/emacs symlink is not created in the sysroot unless eselect-emacs is manually installed in / beforehand.  It runs "eselect emacs" in pkg_post* functions.

Reproducible: Always

Steps to Reproduce:
1. emerge --rage-clean app-eselect/eselect-emacs  # with the / profile
2. emerge app-editors/emacs  # with a sysroot profile

Actual Results:  
No /usr/bin/emacs exists in the sysroot.

Expected Results:  
It should symlink /usr/bin/emacs as expected.

I only care about version =app-editors/emacs-27.0.90 at the moment.
Comment 1 Ulrich Müller gentoo-dev 2020-04-05 16:52:56 UTC
BDEPEND won't be correct, because it applies only to src_* functions:

I fear that we must wait for install time dependencies in EAPI 8.
Comment 2 Larry the Git Cow gentoo-dev 2020-04-07 09:41:44 UTC
The bug has been referenced in the following commit(s):

commit c55e891b44ad9297b7483c4b085830247eaf6e72
Author:     Ulrich Müller <>
AuthorDate: 2020-04-07 09:41:16 +0000
Commit:     Ulrich Müller <>
CommitDate: 2020-04-07 09:41:16 +0000

    app-editors/emacs: Move eselect-emacs from DEPEND to BDEPEND.
    Strictly, we would need a CBUILD type install dependency (IDEPEND),
    which cannot be expressed in EAPI 7.
    Package-Manager: Portage-2.3.96, Repoman-2.3.22
    Signed-off-by: Ulrich Müller <>

 app-editors/emacs/emacs-18.59-r12.ebuild           | 12 ++++++++----
 app-editors/emacs/emacs-23.4-r18.ebuild            | 11 +++++++----
 app-editors/emacs/emacs-24.5-r7.ebuild             | 11 +++++++----
 app-editors/emacs/emacs-25.3-r6.ebuild             | 11 ++++++-----
 app-editors/emacs/emacs-26.3-r1.ebuild             | 11 ++++++-----
 app-editors/emacs/emacs-27.0.50_pre20191223.ebuild | 11 ++++++-----
 app-editors/emacs/emacs-27.0.90.ebuild             | 11 ++++++-----
 app-editors/emacs/emacs-27.0.9999-r1.ebuild        | 11 ++++++-----
 app-editors/emacs/emacs-28.0.9999.ebuild           | 11 +++++++----
 9 files changed, 59 insertions(+), 41 deletions(-)
Comment 3 Ulrich Müller gentoo-dev 2020-04-07 09:45:50 UTC
Thinking about it, app-eselect/eselect-emacs is a CBUILD type install dependency, so BDEPEND (CBUILD type) is more correct than DEPEND (CHOST type).

Note that it will still fail when installing a binary package in a sysroot, so I leave this bug open.
Comment 4 David Michael 2021-06-13 23:23:06 UTC
Created attachment 715881 [details, diff]

This updates to EAPI 8 and IDEPEND.  It needed a bunch of eclass updates to work, though.  (Tested with portage-3.0.20.)
Comment 5 David Michael 2021-06-19 15:18:44 UTC
Created attachment 716856 [details, diff]

Rebased, and IDEPEND does not enforce its dependencies being installed during uninstallation, so the pkg_postrm function should test with has_version before calling eselect.
Comment 6 Ulrich Müller gentoo-dev 2021-06-19 16:44:29 UTC
(In reply to David Michael from comment #5)
> [...] the pkg_postrm function should test with has_version before calling
> eselect.

Not going to happen:
- The only effect of the has_version test would be to suppress an error message. (It is intentional that there's no "|| die" after the eselect commands.)
- During an uninstall sequence, there is no guarantee that deep dependencies are still present any point, so additional tests for app-admin/eselect, app-eselect/eselect-ctags, etc. would be needed. IMHO trying to cover this completely would be a futile undertaking.
Comment 7 Ulrich Müller gentoo-dev 2021-06-23 10:29:58 UTC
This is currently blocked by autotools.eclass. All other inherited eclasses have EAPI 8 support.
Comment 8 Larry the Git Cow gentoo-dev 2021-07-12 14:52:12 UTC
The bug has been closed via the following commit(s):

commit 6937b367c618f82930e200f8f72efbf42c8126da
Author:     Ulrich Müller <>
AuthorDate: 2021-07-12 14:45:30 +0000
Commit:     Ulrich Müller <>
CommitDate: 2021-07-12 14:52:07 +0000

    app-editors/emacs: Bump to EAPI 8
    Move app-eselect/eselect-emacs from BDEPEND to IDEPEND.
    Suggested-by: David Michael <>
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Ulrich Müller <>

 app-editors/emacs/emacs-27.2-r3.ebuild   | 447 +++++++++++++++++++++++++++++++
 app-editors/emacs/emacs-27.2.9999.ebuild |   7 +-
 app-editors/emacs/emacs-28.0.9999.ebuild |   7 +-
 3 files changed, 455 insertions(+), 6 deletions(-)