Summary: | media-gfx/openmesh-3.2 selects Qt version automagically | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Michael Palimaka (kensington) <kensington> |
Component: | Current packages | Assignee: | Justin Bronder (RETIRED) <jsbronder> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | maggu2810, uwelk |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 454132, 526374 | ||
Attachments: | build log |
Description
Michael Palimaka (kensington)
2014-09-18 12:46:22 UTC
I'll force a Qt 4 build in a week or so if there's no objections. (In reply to Michael Palimaka (kensington) from comment #1) > I'll force a Qt 4 build in a week or so if there's no objections. No objections from me if I don't get to it first. I'd appreciate the help. There is option to force qt4 in Apps/CmakeLists.txt: # try to use QT5 if possible otherwise stick to QT4 set (FORCE_QT4 OFF CACHE BOOL "Use Qt4 even if Qt5 was found") It should be enough to pass '-DFORCE_QT4=on' option for 'qt4' use flag and create new use flag 'qt5' for which this variable won't be set. Of course these 2 use flags should be mutually exlusive. [1] http://openmesh.org/svnrepo/OpenMesh/tags/OpenMesh-3.2/src/OpenMesh/Apps/CMakeLists.txt --- openmesh-3.2.ebuild 2014-08-26 01:14:55.000000000 +0200 +++ - 2014-10-23 14:48:39.845042498 +0200 @@ -16,11 +16,16 @@ LICENSE="LGPL-3-with-linking-exception" SLOT="0" KEYWORDS="~amd64 ~ia64 ~x86" -IUSE="qt4 static-libs" +IUSE="qt4 qt5 static-libs" + +REQUIRED_USE="?? ( qt4 qt5 )" RDEPEND="qt4? ( dev-qt/qtgui:4 - dev-qt/qtopengl:4 - media-libs/freeglut )" + dev-qt/qtopengl:4 + media-libs/freeglut ) + qt5? ( dev-qt/qtgui:5 + dev-qt/qtopengl:5 + media-libs/freeglut )" DEPEND="${RDEPEND}" src_prepare() { @@ -42,7 +47,15 @@ } src_configure() { - mycmakeargs="$(cmake-utils_use_build "qt4" "APPS")" + local mycmakeargs=( + "$(cmake-utils_use_build "qt4" "APPS")" + "$(cmake-utils_use_build "qt5" "APPS")" + ) + + if use qt4 ; then + mycmakeargs+=( -DFORCE_QT4=on ) + fi + cmake-utils_src_configure } --- openmesh-3.2.ebuild 2014-08-26 01:14:55.000000000 +0200 +++ - 2014-10-23 15:11:59.199595052 +0200 @@ -16,11 +16,16 @@ LICENSE="LGPL-3-with-linking-exception" SLOT="0" KEYWORDS="~amd64 ~ia64 ~x86" -IUSE="qt4 static-libs" +IUSE="qt4 qt5 static-libs" + +REQUIRED_USE="?? ( qt4 qt5 )" RDEPEND="qt4? ( dev-qt/qtgui:4 - dev-qt/qtopengl:4 - media-libs/freeglut )" + dev-qt/qtopengl:4 + media-libs/freeglut ) + qt5? ( dev-qt/qtgui:5 + dev-qt/qtopengl:5 + media-libs/freeglut )" DEPEND="${RDEPEND}" src_prepare() { @@ -42,7 +47,12 @@ } src_configure() { - mycmakeargs="$(cmake-utils_use_build "qt4" "APPS")" + local mycmakeargs=( + "$(cmake-utils_use qt4 FORCE_QT4)" + "$(cmake-utils_use_build qt4 APPS)" + "$(cmake-utils_use_build qt5 APPS)" + ) + cmake-utils_src_configure } --- openmesh-3.2.ebuild 2014-08-26 01:14:55.000000000 +0200 +++ - 2014-10-23 20:15:27.874370231 +0200 @@ -16,11 +16,16 @@ LICENSE="LGPL-3-with-linking-exception" SLOT="0" KEYWORDS="~amd64 ~ia64 ~x86" -IUSE="qt4 static-libs" +IUSE="qt4 qt5 static-libs" + +REQUIRED_USE="?? ( qt4 qt5 )" RDEPEND="qt4? ( dev-qt/qtgui:4 - dev-qt/qtopengl:4 - media-libs/freeglut )" + dev-qt/qtopengl:4 + media-libs/freeglut ) + qt5? ( dev-qt/qtgui:5 + dev-qt/qtopengl:5 + media-libs/freeglut )" DEPEND="${RDEPEND}" src_prepare() { @@ -42,7 +47,16 @@ } src_configure() { - mycmakeargs="$(cmake-utils_use_build "qt4" "APPS")" + + local mycmakeargs i + for i in qt4 qt5 ; do + if use ${i} ; then + mycmakeargs+=( -DBUILD_APPS=ON ) + fi + done + + mycmakeargs+=( $(cmake-utils_use qt4 FORCE_QT4) ) + cmake-utils_src_configure } Would someone with both qt4 and qt5 installed mind verifying that the change I just pushed actually works? + 23 Oct 2014; Justin Bronder <jsbronder@gentoo.org> openmesh-3.2.ebuild: + Prefer qt5 but force qt4 if only the qt4 USE flag is set. #523124 Tested with both Qt4 and Qt5 installed: USE="qt4 qt5" no -DFORCE_QT4 passed, build succeeds USE="qt4 -qt5" build fails, -DFORCE_QT4 passed instead of -DFORCE_QT4=ON With only Qt5 installed: USE="-qt4 qt5" and USE="-qt4 -qt5" builds succeed (-DFORCE_QT4=OFF passed). --- openmesh-3.2.ebuild 2014-10-23 23:01:12.000000000 +0200 +++ - 2014-10-24 12:46:38.695905095 +0200 @@ -53,7 +53,7 @@ fi if use qt4 && ! use qt5; then - mycmakeargs="${mycmakeargs} -DFORCE_QT4" + mycmakeargs="${mycmakeargs} -DFORCE_QT4=ON" fi cmake-utils_src_configure (In reply to Alpha Bravo from comment #8) > With only Qt5 installed: > USE="-qt4 qt5" and USE="-qt4 -qt5" builds succeed (-DFORCE_QT4=OFF passed). That's not correct, should be: USE="-qt4 qt5" and USE="-qt4 -qt5" builds succeed (no -DFORCE_QT4 passed). Furthermore BUILD_APPS defaults to true (see CMakeLists.txt): if ( NOT DEFINED BUILD_APPS ) set( BUILD_APPS true CACHE BOOL "Enable or disable building of apps" ) So we don't have the behaviour of the old ebuild anymore, which afaict passed -DBUILD_APPS=OFF when built with USE="-qt4 -qt5" --- openmesh-3.2.ebuild 2014-10-23 23:01:12.000000000 +0200 +++ - 2014-10-24 13:21:57.167216139 +0200 @@ -48,12 +48,12 @@ src_configure() { mycmakeargs="" - if use qt4 || use qt5; then - mycmakeargs="${mycmakeargs} -DBUILD_APPS=ON" + if ! use qt4 && ! use qt5; then + mycmakeargs="${mycmakeargs} -DBUILD_APPS=OFF" fi if use qt4 && ! use qt5; then - mycmakeargs="${mycmakeargs} -DFORCE_QT4" + mycmakeargs="${mycmakeargs} -DFORCE_QT4=ON" fi cmake-utils_src_configure With the last patch applied building with USE="qt4 -qt5" succeeds, and apparently links to Qt4, afaict. + 24 Oct 2014; Justin Bronder <jsbronder@gentoo.org> openmesh-3.2.ebuild: + Proper qt4 and app handling, #523124. Thanks to Alpha Bravo (In reply to Alpha Bravo from comment #11) > --- openmesh-3.2.ebuild 2014-10-23 23:01:12.000000000 +0200 > +++ - 2014-10-24 13:21:57.167216139 +0200 > @@ -48,12 +48,12 @@ > src_configure() { > mycmakeargs="" > > - if use qt4 || use qt5; then > - mycmakeargs="${mycmakeargs} -DBUILD_APPS=ON" Please note while this still works, it's deprecated and array style is preferred, for example: local mycmakeargs= mycmakeargs+=( -DBUILD_APPS=ON ) |