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.
This is probably the reason why the ebuild previously depended on python unconditionally. Maybe we should drop USE=python altogether to avoid the confusion.
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.
Well apparently it is needed?
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)
(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.)
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.
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?
With USE=-python and patched ebuild for sci-geosciences/qgis-3.0.3 Python is found and qgis builds. Thanks!
Maybe we should use USE=minimal and inverted logic instead of python?
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(-)