Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 658250 - sci-geosciences/qgis-3.0.3[-python] - Could NOT find PythonInterp: Found unsuitable version "2.7.14", but required is at least "3"
Summary: sci-geosciences/qgis-3.0.3[-python] - Could NOT find PythonInterp: Found unsu...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sci-geo Project
URL:
Whiteboard:
Keywords:
Depends on: 658948
Blocks:
  Show dependency tree
 
Reported: 2018-06-16 19:14 UTC by Sławomir Nizio
Modified: 2018-06-24 13:18 UTC (History)
2 users (show)

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


Attachments
add hard DEPEND on python3 (bug658250.patch,291 bytes, patch)
2018-06-17 21:25 UTC, Kalin KOZHUHAROV
Details | Diff
add proper python3 dependenncy (BGO658250.patch,669 bytes, patch)
2018-06-19 20:31 UTC, Kalin KOZHUHAROV
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sławomir Nizio 2018-06-16 19:14:48 UTC
in CMakeLists.txt, there is:

# Python build dependency

FIND_PACKAGE(PythonInterp 3 REQUIRED)


and during building I've got:

-- QtCore/QCA include/lib variables missing or CMake is cross-compiling,
--   skipping QCA OpenSSL plugin C++ check
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PythonInterp: Found unsuitable version "2.7.14", but
  required is at least "3" (found /usr/bin/python)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindPythonInterp.cmake:158 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:688 (FIND_PACKAGE)



in case it matters, "python" is python 2: /usr/bin/python -> python-exec2c

maybe there's some Python-initialization missing in ebuild for build time with USE=-python.
Comment 1 Andreas Sturmlechner gentoo-dev 2018-06-17 16:02:52 UTC
This is probably the reason why the ebuild previously depended on python unconditionally. Maybe we should drop USE=python altogether to avoid the confusion.
Comment 2 Kalin KOZHUHAROV 2018-06-17 16:19:26 UTC
Hmm... I'll have a look in few hours and try to reproduce.

If indeed python3 is needed (not only for plugins), then yes dropping the USEFLAG is the only way forward. Hopefully any python3 (.4,.5,.6) works fine.
Comment 3 Amy Liffey gentoo-dev 2018-06-17 17:13:50 UTC
Well apparently it is needed?
Comment 4 Kalin KOZHUHAROV 2018-06-17 21:25:55 UTC
Created attachment 536154 [details, diff]
add hard DEPEND on python3

OK, I had a bit of look into this.

So, to clarify, yes python3 looks like a build dependency (a proper BDEPEND=">=dev-lang/python-3" in EAPI=7 terms). In my system I have python3, so all is working.

sci-geosciences/qgis-3.0.3[-python] still requires python3 during emerge, but does not build python stuff (e.g. plugins) and thus requires no python installed during runtime.

And the initial purpose I wanted this change was to avoid needing python3.5, because several of the dependencies support (on Gentoo) only python3.5 (e.g. dev-python/owslib, dev-python/pyproj).

So, yes at present this is a bug (in the way I implemented the feature). In other words a missing hard dependency to python3 (disregarding the USE=python or USE=-python) needs to be added. Then will it work for people having selected python2.7 as default, we need to test.

I quickfixed the mentioned packages, misstating they support python3_6 and recompiled all dependencies with USE=python and it all seems to work. So I'll split this and open another bug.

The attached one-line patch should work for everybody at present or future. I guess it is OK to slip into the current ebuild, no need for -r1.

(and no it doesn't seem possible to build current qgis with python2.7 or without python)
Comment 5 Sławomir Nizio 2018-06-19 19:11:38 UTC
(In reply to Kalin KOZHUHAROV from comment #4)
> Created attachment 536154 [details, diff] [details, diff]
> add hard DEPEND on python3
> 
> OK, I had a bit of look into this.
> 
> So, to clarify, yes python3 looks like a build dependency (a proper
> BDEPEND=">=dev-lang/python-3" in EAPI=7 terms). In my system I have python3,
> so all is working.

Do you mean that it built with USE=-python? On the system I was building on, Python 3 (3.5) was also installed, and still it failed as reported.

OTOH, that cmake routines to find Python outside of the emerge process pass (Python 3 can be found).

(Both 2.7 and 3.5 are present.)
Comment 6 Sławomir Nizio 2018-06-19 19:28:00 UTC
Yeah, I played with it and apparently, EPYTHON and/or PYTHON has to be set for this to work (using a function from the eclass). It boils down to Gentoo-specific code in FindPythonInterp.cmake.
Comment 7 Kalin KOZHUHAROV 2018-06-19 20:31:47 UTC
Created attachment 536454 [details, diff]
add proper python3 dependenncy

OK, I had a deeper look and here is the patch that should work.

I tested it on a system with python3.6 and python2.7 it finds correctly the python3.6 despite the setting by `eselect python` (since 2.7 is not supported by qgis). I expect that portage will refuse to emerge it for people having only python2 (i.e. emerge will try to pull some python3 as dependency), but have not tested that case.

The main change is that `python-single-r1_pkg_setup` is called in all cases, not only when USE=python. Also instead of directly depending on dev-lang/python I moved the "${PYTHON_DEPS}" one level up, so some python3 is always a dependency.

Not sure if we need comments in the ebuild, something like:
# USE=python adds additional functionality/plugins; python3 is always required during build

Additionally I added python3_6, since it is stable and seems working so far.

Can you please test this patch?
Comment 8 Sławomir Nizio 2018-06-20 17:10:00 UTC
With USE=-python and patched ebuild for sci-geosciences/qgis-3.0.3 Python is found and qgis builds. Thanks!
Comment 9 Andreas Sturmlechner gentoo-dev 2018-06-24 10:08:34 UTC
Maybe we should use USE=minimal and inverted logic instead of python?
Comment 10 Larry the Git Cow gentoo-dev 2018-06-24 13:18:15 UTC
The bug has been closed via the following commit(s):

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

commit e12ccf4e38b42bd4e4dd118eb6010bd7edb79002
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2018-06-24 10:48:54 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2018-06-24 13:18:02 +0000

    sci-geosciences/qgis: Always depend on python
    
    Reported-by: Sławomir Nizio <slawomir.nizio@sabayon.org>
    Thanks-to: Kalin KOZHUHAROV <kalin@ThinRope.net>
    Closes: https://bugs.gentoo.org/658250
    Package-Manager: Portage-2.3.40, Repoman-2.3.9

 sci-geosciences/qgis/qgis-9999.ebuild | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)