Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 805491 - [PATCH] app-eselect/eselect-emacs: Set symlink in /usr/include
Summary: [PATCH] app-eselect/eselect-emacs: Set symlink in /usr/include
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Emacs project
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2021-07-31 11:19 UTC by akater
Modified: 2021-08-03 07:59 UTC (History)
1 user (show)

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


Attachments
(draft) Add symlink to /usr/include (file_805491.txt,1.18 KB, patch)
2021-07-31 11:20 UTC, akater
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description akater 2021-07-31 11:19:01 UTC
emacs-module.h may be present in several installed versions.  Looks like we should install symlink in /usr/include as well.

app-emacs/vterm uses a bundled emacs-module.h  It better use the system-provided one.  It's difficult or impossible to do it reliably in the absence of the symlink.

Reproducible: Always




I'll attach the patch.  In it, I imitate what's written in other eselect-emacs functions but I'm not familiar with the intricacies of eselect so the patch is provided in the hope that it would be useful but the hope is only so strong.

This is not a git-formatted patch; I don't observe a live ebuild and the location of the repository is unclear.
Comment 1 akater 2021-07-31 11:20:54 UTC
Created attachment 728652 [details, diff]
(draft) Add symlink to /usr/include
Comment 2 Ulrich Müller gentoo-dev 2021-07-31 13:21:22 UTC
This is a valid issue. The problem is that the upstream emacs-libvterm package has no support for using the system header. The #include statement uses double quotes, and there's no cmake support to specify an include path.

We could of course remove the bundled header and specify the path manually, but that feels a little hackish. Maybe one should instead talk to upstream to have proper support for it added? (Then again, they may tell us that nothing is currently broken.)
Comment 3 akater 2021-07-31 13:38:51 UTC
I think symlink won't hurt anyway, right?

Re: vterm, I just patch the #include lines in my ebuild replacing it with <emacs/emacs-module.h>.  If emacs-module.h is there on other distros, I'd expect upstream to agree to fix this.  I'll ping them.
Comment 4 Ulrich Müller gentoo-dev 2021-07-31 17:41:48 UTC
https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?h=eselect-emacs&id=db0e1f18245abd3288fa76135fc048ec1f495aa4

commit db0e1f18245abd3288fa76135fc048ec1f495aa4
Author: Ulrich Müller <ulm@gentoo.org>
Date:   Sat Jul 31 19:34:07 2021 +0200

    Set symbolic links to C header files
    
    * emacs.eselect (set_header_symlinks): New function, set symbolic
    links to C header files. Bug 805491.
    (set_symlinks): Call it.
    (remove_symlinks): Remove symlinks to header files.
    (HEADERLIST): New variable.
    
    Bug: https://bugs.gentoo.org/805491
    Reported-by: akater <nuclearspace@gmail.com>
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Comment 5 Ulrich Müller gentoo-dev 2021-07-31 17:50:38 UTC
Please test. app-eselect/eselect-emacs-9999-r2 in emacs overlay.
Comment 6 akater 2021-08-01 00:21:13 UTC
I'll check the new eselect-emacs release tomorrow.

Alas, vterm upstream bundles emacs-module.h because users aren't expected to have header files on their systems at all.  This will likely be the case with other module-reliant packages, it seems.

However, header patches are common in Gentoo, certainly so in my experience with non-glibc profiles, so I don't find it hackish.
Comment 7 Larry the Git Cow gentoo-dev 2021-08-02 08:07:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75af653f0b7692860439a9c9bbbebec43705480d

commit 75af653f0b7692860439a9c9bbbebec43705480d
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2021-08-02 08:05:01 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2021-08-02 08:06:26 +0000

    app-eselect/eselect-emacs: Version bump to 1.19
    
    Bug: https://bugs.gentoo.org/805491
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 app-eselect/eselect-emacs/Manifest                 |  1 +
 .../eselect-emacs/eselect-emacs-1.19.ebuild        | 35 ++++++++++++++++++++++
 2 files changed, 36 insertions(+)
Comment 8 Ulrich Müller gentoo-dev 2021-08-02 08:11:51 UTC
(In reply to Ulrich Müller from comment #5)
> Please test. app-eselect/eselect-emacs-9999-r2 in emacs overlay.

Test with eselect-emacs-1.19 instead (in gentoo tree), it should add the symlink in /usr/include automatically, without the need to execute eselect emacs manually.
Comment 9 akater 2021-08-03 07:07:13 UTC
The package only arrived today.

I tested 25 → 26 → 27 → 28 → 25, that's exhaustive.  Works correctly.

But I wonder why you didn't symlink the whole directory.
Comment 10 Ulrich Müller gentoo-dev 2021-08-03 07:59:00 UTC
(In reply to akater from comment #9)

Thanks for testing. Closing then.

> But I wonder why you didn't symlink the whole directory.

Emacs' Makefile.in has this:

install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA}
	umask 022 && $(MKDIR_P) "$(DESTDIR)$(includedir)"
	$(INSTALL_DATA) src/emacs-module.h "$(DESTDIR)$(includedir)/emacs-module.h"

includedir is "${prefix}/include" which means the file is installed directly in /usr/include. Programs will expect it there, not in /usr/include/emacs.