From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6D17A138337 for ; Wed, 6 Nov 2019 01:19:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 27EBEE0A9A; Wed, 6 Nov 2019 01:19:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 97423E0A92 for ; Wed, 6 Nov 2019 01:19:54 +0000 (UTC) Received: from tuxbrain.localnet (178-191-189-32.adsl.highway.telekom.at [178.191.189.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: asturm) by smtp.gentoo.org (Postfix) with ESMTPSA id E179534C8EE for ; Wed, 6 Nov 2019 01:19:52 +0000 (UTC) From: Andreas Sturmlechner To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH 1/3] ecm-utils.eclass: New eclass Date: Wed, 06 Nov 2019 02:19:32 +0100 Message-ID: <4949294.KT39OxLedd@tuxbrain> In-Reply-To: <759405ee4e4ae48d65cbac336e23f91ceec53ea1.camel@gentoo.org> References: <9898161.uzqcMZjEFU@tuxk10> <2344877.D1iEJ5bPx9@tuxbrain> <759405ee4e4ae48d65cbac336e23f91ceec53ea1.camel@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: f7a9596d-f9df-4f32-b366-1b35814835c7 X-Archives-Hash: 9ad74fd69449b1982da1216092dfe172 On Tuesday, 5 November 2019 22:20:46 CET Micha=C5=82 G=C3=B3rny wrote: > On Tue, 2019-11-05 at 00:30 +0100, Andreas Sturmlechner wrote: > > --- /dev/null > > +++ b/eclass/ecm-utils.eclass >=20 > I know we historically screwed this up repeatedly but please don't use > '-utils' for eclasses that export phases. =46ine, I would then choose ecm.eclass instead. > > +# @ECLASS-VARIABLE: ECM_NONGUI > > +# @DESCRIPTION: > > +# If set to "false", add dependency on kde-frameworks/breeze-icons > > +# or kde-frameworks/oxygen-icons and run the xdg.eclass routines for > > +# pkg_preinst, pkg_postinst and pkg_postrm. > > +# For any other value, do nothing. > > +if [[ ${CATEGORY} =3D kde-frameworks ]]; then > > + : ${ECM_NONGUI:=3Dtrue} > > +fi > > +: ${ECM_NONGUI:=3Dfalse} >=20 > I don't think eclassdoc is going to parse this correctly. Can we do something about that? I need to be able to set (overrideable)=20 defaults for a category without being limited by eclassdoc. @DEFAULT_UNSET= =20 would not be precise. Same as ECM_QTHELP, this is what we do in kde5.eclass= =20 already. > > +# @ECLASS-VARIABLE: ECM_DEBUG > > +# @DESCRIPTION: > > +# If set to "false", add -DNDEBUG (via cmake-utils_src_configure) and > > +# -DQT_NO_DEBUG to CPPFLAGS. > > +# Otherwise, add debug to IUSE. > > +: ${ECM_DEBUG:=3Dtrue} >=20 > To be honest, I don't really like this 'anything-or-false' logic. It's > rather confusing and error-prone. For example, if I misspell 'false' > the eclass is going to silently assume true. Making all options explicit then and erroring out on unknown input. > > +# @FUNCTION: ecm_punt_bogus_dep > > +# @USAGE: > > +# @DESCRIPTION: > > +# Removes a specified dependency from a find_package call with multiple > > components. > > +ecm_punt_bogus_dep() { > > + local prefix=3D${1} > > + local dep=3D${2} > > + > > + if [[ ! -e "CMakeLists.txt" ]]; then >=20 > Can this really ever happen in a valid use case? Maybe it should be > an error instead. Even cmake-utils.eclass makes that check in cmake_comment_add_subdirectory = and=20 leaves the erroring out if the file's missing central to src_prepare(), I=20 guess is why it was done that way. Thanks for looking over it! Regards, Andreas