Re: [PATCH] emake: explicitly set SHELL

Arfrever Frehtes Taifersar Arahesis <[email protected]> Thu, 28 Jul 2022 19:36:09 +0200
Newsgroups gmane.linux.gentoo.portage.devel
Message-ID <CALaCa4zbRYOJm00bGnZ3CqeA1A12K3RTiNQoJMO9j-G-T3eaOg@mail.gmail.com>
2022-07-26 07:03 UTC=E3=81=AB=E3=80=81Florian Schmaus <[email protected]>=E3=
=81=AF=E6=9B=B8=E3=81=84=E3=81=9F:
> But then I wondered if "make SHELL=3D$BROOT/bin/sh" wouldn't override
> explicitly set SHELL values in Makefiles. Assume a package has
>
> SHELL =3D /bin/zsh
>
> in one of its Makefiles. Then emake would reset this to 'sh'. Which
> appears like it could cause build issues.
>
> If this is the case, then I am not sure what we can do about it. It
> appears fragile, if not impossible, to ask 'make' which value for SHELL
> it would assume, so that emake could adjust the path. Another option
> could be that affected packages define a variable in their ebuild, e.g.
> EMAKE_SHELL=3D"zsh", which emake could extend with BROOT before passing
> the resulting value as SHELL to make.

If there was such package, it could just override SHELL on emake invocation=
:

src_compile() {
    emake SHELL=3D"${BROOT}/bin/zsh"
    # Or:
    emake SHELL=3D"$(type -P zsh)"
}