When building sci-libs/gmsh-4.10.3 with the python use flag the module in not found Reproducible: Always Steps to Reproduce: 1.# USE=python emerge sci-libs/gmsh 2. $ python Python 3.10.5 (main, Aug 17 2022, 13:01:32) [GCC 12.1.1 20220625] on linux Type "help", "copyright", "credits" or "license" for more information. 3. >>> import gmsh Actual Results: >>> import gmsh Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'gmsh' Expected Results: >>> import gmsh
It looks like the gmsh.py file is installed in /usr/lib64/ (by cmake) and not where python can find it. I tried something like: <pre> src_install() { -snip- # The gmsh.py file is installed in /usr/lib64/ (by cmake) # and not where Python can find it if use shared ; then insinto /usr/lib/python3.10/site-packages doins api/gmsh.py fi } </pre> in an modified ebuild (I guess one should not hardcode the install paths but I do now how to set the site-packages path for the current Python version). NB. The api/gmsh.py is build when setting USE=shared and the python stuff which is enabled when gmsh is build with USE=python is the private (undocumented) python API which is a bit confusing. My guess is that USE=python should imply enabling the api/gmsh.py (and not internal python APIs used mainly for the developers of gmsh?).
Hello, I have the following patch for the ebuild that appears to fix this. I had to make the `python`
Let's try this again. I have the following patch that fixes this bug for me. The Python API seems to require the shared library, so I've added "shared" to the required use flags. --- a/sci-libs/gmsh-4.13.1-r1.ebuild +++ b/sci-libs/gmsh-4.13.1-r1.ebuild @@ -5,7 +5,7 @@ PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake desktop fortran-2 python-any-r1 toolchain-funcs xdg-utils +inherit cmake desktop fortran-2 python-r1 toolchain-funcs xdg-utils DESCRIPTION="Three-dimensional finite element mesh generator" HOMEPAGE="https://gmsh.info https://gitlab.onelab.info/gmsh/gmsh" @@ -29,6 +29,7 @@ ^^ ( blas eigen ) mumps? ( blas ) slepc? ( petsc ) + python? ( shared ) " RDEPEND=" @@ -113,6 +114,10 @@ src_install() { cmake_src_install + if use python; then + python_foreach_impl python_domodule api/gmsh.py + fi + if use examples ; then dodoc -r examples tutorials docompress -x /usr/share/doc/${PF}/{examples,tutorials}
I'm seeing the same problem. Would the maintainer(s) please at least mark this as confirmed?
Gentoo generally doesn't do UNCONFIRMED vs CONFIRMED. Anyway, I'll take a look.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd23c721e57d589da48232fb656fc59ae0ccb7a9 commit dd23c721e57d589da48232fb656fc59ae0ccb7a9 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-03-10 23:03:11 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-03-10 23:03:17 +0000 sci-libs/gmsh: fix USE=python Thanks to Alex Wranovsky. Closes: https://bugs.gentoo.org/867520 Signed-off-by: Sam James <sam@gentoo.org> sci-libs/gmsh/gmsh-4.13.1-r2.ebuild | 143 ++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+)