Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 760408

Summary: sci-libs/amd,sci-libs/camd: Makefile.am requires /bin/sh to be bash
Product: Gentoo Linux Reporter: Michael Orlitzky <mjo>
Component: Current packagesAssignee: Gentoo Science Related Packages <sci>
Status: RESOLVED FIXED    
Severity: normal CC: frp.bissey, kfm, lssndrbarbieri
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 526268    

Description Michael Orlitzky gentoo-dev 2020-12-17 00:59:30 UTC
Some Makefiles that ship with these packages have bashisms. For example, amd's Doc/Makefile.am has

  echo '\begin{verbatim}' > amd_h.tex
  expand -8 $(top_srcdir)/Include/amd.h >> amd_h.tex
  echo '\end{verbatim}' >> amd_h.tex
  -ln -s $(srcdir)/*.{tex,bib} .

The behavior of escape sequences in "echo" is not standard, and the "\b" here produces a literal backspace character when using dash. Moreover the {tex,bib} syntax is a bash only thing, so we get a nonsense symlink with other shells. This kills the documentation build.

Since these packages were painfully autotooled by hand, and since upstream has opted for CMake instead, I suggest we quickly sweep this under the rug with

  CONFIG_SHELL=/bin/bash

during the configure phase, or

  SHELL=/bin/bash

during the compilation phase.
Comment 1 François Bissey 2020-12-17 02:19:26 UTC
Indeed this is known, it was all https://github.com/cschwan/sage-on-gentoo/issues/574 note that klu suffers from the same issue.
Comment 2 François Bissey 2020-12-17 02:38:27 UTC
I ended up patching to use printf instead. Want a PR?
Comment 3 Michael Orlitzky gentoo-dev 2020-12-17 03:18:10 UTC
Yeah, sure, if you're already fixed it then that's a better solution. Are these symlinks,

  -ln -s $(srcdir)/*.{tex,bib} .

even used? That command will succeed with dash, but it will create a symlink literally named "*.{tex,bib}", and so obviously doesn't work as intended.

And we might as well import your *.la fix for sci-libs/klu at the same time.
Comment 4 François Bissey 2020-12-17 03:34:59 UTC
(In reply to Michael Orlitzky from comment #3)
> Yeah, sure, if you're already fixed it then that's a better solution. Are
> these symlinks,
> 
>   -ln -s $(srcdir)/*.{tex,bib} .
> 

I'll to check. I took over bicatali's stuff but I am not claiming to have gone through all the details.
Comment 5 François Bissey 2020-12-17 03:41:06 UTC
(In reply to François Bissey from comment #4)
> (In reply to Michael Orlitzky from comment #3)
> > Yeah, sure, if you're already fixed it then that's a better solution. Are
> > these symlinks,
> > 
> >   -ln -s $(srcdir)/*.{tex,bib} .
> > 
> 
> I'll to check. I took over bicatali's stuff but I am not claiming to have
> gone through all the details.

Cruft that should go. I really have to redo how suitesparse is packaged.
Comment 6 François Bissey 2021-01-14 22:18:23 UTC
Finally can do something about this. About the "ln" command, we had a tester in the overlay that said that worked, but after testing, removing it doesn't seem to hurt. So it will go from everywhere.
Comment 7 François Bissey 2021-01-14 23:07:40 UTC
I think I put my bug tag in the wrong spot and it didn't get picked up.
https://github.com/gentoo/gentoo/pull/19063
Comment 8 Larry the Git Cow gentoo-dev 2021-01-16 02:23:04 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ce883cd2deb8e009ae421d57d1da1f31bfa541d

commit 0ce883cd2deb8e009ae421d57d1da1f31bfa541d
Author:     François Bissey <frp.bissey@gmail.com>
AuthorDate: 2021-01-16 01:56:15 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2021-01-16 02:04:19 +0000

    sci-libs/klu: fix bashism in doc building, remove la file
    
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Closes: https://bugs.gentoo.org/760408
    Closes: https://github.com/gentoo/gentoo/pull/19063
    Signed-off-by: François René Pierre Bissey <frp.bissey@gmail.com>
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 sci-libs/klu/files/klu-1.3.9-dash_doc.patch | 27 ++++++++++++++++++
 sci-libs/klu/klu-1.3.9-r1.ebuild            | 44 +++++++++++++++++++++++++++++
 2 files changed, 71 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e61159117a7d1a3490460dec8c37c7fbeec4c08

commit 4e61159117a7d1a3490460dec8c37c7fbeec4c08
Author:     François Bissey <frp.bissey@gmail.com>
AuthorDate: 2021-01-16 01:55:16 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2021-01-16 02:03:49 +0000

    sci-libs/camd: fix bashism in doc building
    
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Bug: https://bugs.gentoo.org/760408
    Signed-off-by: François René Pierre Bissey <frp.bissey@gmail.com>
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 sci-libs/camd/camd-2.4.6-r1.ebuild            | 41 +++++++++++++++++++++++++++
 sci-libs/camd/files/camd-2.4.6-dash_doc.patch | 16 +++++++++++
 2 files changed, 57 insertions(+)

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

commit a5b286aa8ff504931c0b582821064c8bc32ff539
Author:     François Bissey <frp.bissey@gmail.com>
AuthorDate: 2021-01-16 01:53:57 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2021-01-16 02:03:43 +0000

    sci-libs/amd: fix bashism in doc building
    
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Bug: https://bugs.gentoo.org/760408
    Signed-off-by: François René Pierre Bissey <frp.bissey@gmail.com>
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 sci-libs/amd/amd-2.4.6-r1.ebuild            | 42 +++++++++++++++++++++++++++++
 sci-libs/amd/files/amd-2.4.6-dash_doc.patch | 16 +++++++++++
 2 files changed, 58 insertions(+)