From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1IUTn1-0004bI-H5 for garchives@archives.gentoo.org; Sun, 09 Sep 2007 20:53:55 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l89KjdI4001719; Sun, 9 Sep 2007 20:45:39 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l89Kgs1A030344 for ; Sun, 9 Sep 2007 20:42:54 GMT Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 6188C653F0 for ; Sun, 9 Sep 2007 20:42:53 +0000 (UTC) From: Mike Frysinger Organization: wh0rd.org To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] New eclass: cmake-utils.eclass Date: Sun, 9 Sep 2007 16:44:36 -0400 User-Agent: KMail/1.9.7 References: <200709092115.17423.philantrop@gentoo.org> In-Reply-To: <200709092115.17423.philantrop@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4077766.r4UOHJlR1n"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200709091644.36550.vapier@gentoo.org> X-Archives-Salt: a258f963-8827-4575-a025-f4497a90bace X-Archives-Hash: cb098d46b6ccf1b7421000bc7b2a1d88 --nextPart4077766.r4UOHJlR1n Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 09 September 2007, Wulf C. Krueger wrote: > KDE4's build system is based on CMake and seeing that more and more KDE > and non-KDE applications are using it, we have created a new > cmake-utils.eclass [3] which allows for easier implementation of ebuilds > for those applications. * you've got pointless quoting in [[ ... ]] * use portage e* funcs instead of your own "echo !!!" * have incorrectly used functions die instead of echo * i think the maintainer comment warning is a left over copy & paste * you inherit eutils but i dont think you use it * dont document internal functions and use a _ prefix (common_configure_co= de) * dont pollute env (mycmakeargs) ... might be better if your=20 common_configure_code echoed the output and then do: common_configure_code() { if has debug ${IUSE} && use debug; then echo -DCMAKE_BUILD_TYPE=3Ddebug fi echo -DCMAKE_C_COMPILER=3D$(type -P $(tc-getCC)) echo -DCMAKE_CXX_COMPILER=3D$(type -P $(tc-getCXX)) echo -DCMAKE_INSTALL_PREFIX=3D${PREFIX:-/usr} echo -DLIB_SUFFIX=3D$(get_libdir| sed 's/lib//') } local mycmakeargs=3D$(common_configure_code) * those use_with/use_enable could be shrunk ... _use_me_now() { debug-print-function $FUNCNAME $* [[ -z $2 ]] && die "cmake-utils_use_with []" echo "-D$1_${3:-$2}=3D$(use $2 && echo ON || echo OFF)" } cmake-utils_use_with() { _use_me_now WITH "$@" ; } cmake-utils_use_enable() { _use_me_now ENABLE "$@" ; } =2Dmike --nextPart4077766.r4UOHJlR1n Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.6 (GNU/Linux) iQIVAwUARuRbNEFjO5/oN/WBAQJWKBAAusVLvZHcN77JwuB+OVcZPsCU5nRlNm8P YTBJCvC0zFQeec85RxKToKDqAZm3xckanzTY3Lde0vNJWJAi6+cmGFfRG2yihTR8 9WT3SUhm7jtTvbSEy+TzKDi8nCS4YwvqYWp+Db99RG5CElO+qNijzbGT+IeNGnOs HhQWTBbKSYH5wwGH9wO3vl5fE2E/0BVXTobtlTkyrECeffJgzhVCw3jOLV7bUfSr 24U8VZRX5GLs8Ph5IxbNv6emKoxGwPBFm7UOilYRltx7+UsLXesJ42XEBtlZZE4M zGQlaB+73R7pDtyy6eX13kjQxoeeWZ2FlCyjtyUIXTtkU7C3W+R2+zunQPloFwLJ JG7on+FtyEPujiCFS+8SG8UhpIGGV9Y62leowzFGR/+Q0nVMz3XW5CGCbTlJuFik cEFh6uunhHdUQlzEflYbNieWxg5ZsZUkfRzTB5yP/b8IWJFeuYX9JNwrA2w+zcVp vBYdJ0E4USG2+LJSHVWY2Yrx+JcxTlKeThTekvptRLCt992EcBmBfE5s97z2v3TD Q0TMDeDJmIgz5ol8Wem8Fpt0S96Gb8Vv+8C6vIA82Z7obQtOatdL0SrsA1Bw7wxV loWS2/WDmWAtxtUqcMXMrPR6jZFzIgwMYWzdtm5STuQN1p3KhCazUQxUutvQBhMX /RkhfTdAuwo= =/7QR -----END PGP SIGNATURE----- --nextPart4077766.r4UOHJlR1n-- -- gentoo-dev@gentoo.org mailing list