public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] New eclass: cmake-utils.eclass
@ 2007-09-09 19:15 Wulf C. Krueger
  2007-09-09 19:48 ` Piotr Jaroszyński
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Wulf C. Krueger @ 2007-09-09 19:15 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

Hello!

As you might know, a very active Gentoo user, Zephyrus, several members of 
the KDE herd and other interested parties [1] are currently working on 
the pre-releases of KDE4 in the GenKDEsvn overlays [2]. 

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. 

We've been using it successfully for several months now:

http://tinyurl.com/27xknq [3]

As I would like to introduce it to the official Portage Tree in 
preparation of things to come, we would welcome any comments, patches 
and, of course, your kind approval to commit it. :-)

Best regards, Wulf

[1] http://sourceforge.net/project/memberlist.php?group_id=186399
[2] http://genkdesvn.sf.net
[3] 
http://genkdesvn.svn.sourceforge.net/viewvc/genkdesvn/kde4-stable/eclass/cmake-utils.eclass?revision=1711

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] New eclass: cmake-utils.eclass
  2007-09-09 19:15 [gentoo-dev] New eclass: cmake-utils.eclass Wulf C. Krueger
@ 2007-09-09 19:48 ` Piotr Jaroszyński
  2007-09-09 20:32   ` Mike Frysinger
  2007-09-09 20:11 ` [gentoo-dev] " Christian Faulhammer
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Piotr Jaroszyński @ 2007-09-09 19:48 UTC (permalink / raw
  To: gentoo-dev

>>		if ! emake -j1 check; then
>>			hasq test $FEATURES && die "Make check failed. See above for details."
>>			hasq test $FEATURES || eerror "Make check failed. See above for details."
>>		fi

No reason to check for test in FEATURES, make it die uncodnitionally.
btw. ebuilds shouldn't access FEATURES at all.

-- 
Best Regards,
Piotr Jaroszyński
--
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [gentoo-dev] Re: New eclass: cmake-utils.eclass
  2007-09-09 19:15 [gentoo-dev] New eclass: cmake-utils.eclass Wulf C. Krueger
  2007-09-09 19:48 ` Piotr Jaroszyński
@ 2007-09-09 20:11 ` Christian Faulhammer
  2007-09-09 20:44 ` [gentoo-dev] " Mike Frysinger
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Christian Faulhammer @ 2007-09-09 20:11 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 734 bytes --]

"Wulf C. Krueger" <philantrop@gentoo.org>:

> As you might know, a very active Gentoo user, Zephyrus, several
> members of the KDE herd and other interested parties [1] are
> currently working on the pre-releases of KDE4 in the GenKDEsvn
> overlays [2]. 

 Nice to hear.
 
> As I would like to introduce it to the official Portage Tree in 
> preparation of things to come, we would welcome any comments, patches 
> and, of course, your kind approval to commit it. :-)

 Is there a specific reason you use echo instead of the functions
provided by Portage?

V-Li

-- 
Christian Faulhammer, Gentoo Lisp project
<URL:http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode

<URL:http://www.faulhammer.org/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] New eclass: cmake-utils.eclass
  2007-09-09 19:48 ` Piotr Jaroszyński
@ 2007-09-09 20:32   ` Mike Frysinger
  0 siblings, 0 replies; 20+ messages in thread
From: Mike Frysinger @ 2007-09-09 20:32 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

On Sunday 09 September 2007, Piotr Jaroszyński wrote:
> >>		if ! emake -j1 check; then
> >>			hasq test $FEATURES && die "Make check failed. See above for details."
> >>			hasq test $FEATURES || eerror "Make check failed. See above for
> >> details." fi
>
> No reason to check for test in FEATURES, make it die uncodnitionally.

a better question is, why does that function exist at all
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] New eclass: cmake-utils.eclass
  2007-09-09 19:15 [gentoo-dev] New eclass: cmake-utils.eclass Wulf C. Krueger
  2007-09-09 19:48 ` Piotr Jaroszyński
  2007-09-09 20:11 ` [gentoo-dev] " Christian Faulhammer
@ 2007-09-09 20:44 ` Mike Frysinger
  2007-09-09 21:05   ` Wulf C. Krueger
  2007-09-09 21:03 ` [gentoo-dev] " Christian Faulhammer
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Mike Frysinger @ 2007-09-09 20:44 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1473 bytes --]

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_code)
 * dont pollute env (mycmakeargs) ... might be better if your 
common_configure_code echoed the output and then do:
common_configure_code() {
	if has debug ${IUSE} && use debug; then
		echo -DCMAKE_BUILD_TYPE=debug
	fi
	echo -DCMAKE_C_COMPILER=$(type -P $(tc-getCC))
	echo -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX))
	echo -DCMAKE_INSTALL_PREFIX=${PREFIX:-/usr}
	echo -DLIB_SUFFIX=$(get_libdir| sed 's/lib//')
}
local mycmakeargs=$(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 <USE flag> [<flag name>]"
	echo "-D$1_${3:-$2}=$(use $2 && echo ON || echo OFF)"
}
cmake-utils_use_with() { _use_me_now WITH "$@" ; }
cmake-utils_use_enable() { _use_me_now ENABLE "$@" ; }
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [gentoo-dev] Re: New eclass: cmake-utils.eclass
  2007-09-09 19:15 [gentoo-dev] New eclass: cmake-utils.eclass Wulf C. Krueger
                   ` (2 preceding siblings ...)
  2007-09-09 20:44 ` [gentoo-dev] " Mike Frysinger
@ 2007-09-09 21:03 ` Christian Faulhammer
  2007-09-10  8:00 ` [gentoo-dev] " Luca Barbato
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Christian Faulhammer @ 2007-09-09 21:03 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 734 bytes --]

"Wulf C. Krueger" <philantrop@gentoo.org>:

> As you might know, a very active Gentoo user, Zephyrus, several
> members of the KDE herd and other interested parties [1] are
> currently working on the pre-releases of KDE4 in the GenKDEsvn
> overlays [2]. 

 Nice to hear.
 
> As I would like to introduce it to the official Portage Tree in 
> preparation of things to come, we would welcome any comments, patches 
> and, of course, your kind approval to commit it. :-)

 Is there a specific reason you use echo instead of the functions
provided by Portage?

V-Li

-- 
Christian Faulhammer, Gentoo Lisp project
<URL:http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode

<URL:http://www.faulhammer.org/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] New eclass: cmake-utils.eclass
  2007-09-09 20:44 ` [gentoo-dev] " Mike Frysinger
@ 2007-09-09 21:05   ` Wulf C. Krueger
  0 siblings, 0 replies; 20+ messages in thread
From: Wulf C. Krueger @ 2007-09-09 21:05 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

Thanks for all your comments! 

Some ideas (especially the use_with/_enable shrinking) are rather 
spectacular and *all* are greatly appreciated.

If there's more, please let us know. Until then, we'll make those changes 
you suggested and will follow-up on this tomorrow with the changed 
eclass.

Best regards, Wulf

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] New eclass: cmake-utils.eclass
  2007-09-09 19:15 [gentoo-dev] New eclass: cmake-utils.eclass Wulf C. Krueger
                   ` (3 preceding siblings ...)
  2007-09-09 21:03 ` [gentoo-dev] " Christian Faulhammer
@ 2007-09-10  8:00 ` Luca Barbato
  2007-09-10 11:08 ` Thomas Anderson
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Luca Barbato @ 2007-09-10  8:00 UTC (permalink / raw
  To: gentoo-dev

Wulf C. Krueger wrote:
> Hello!
> 
> As you might know, a very active Gentoo user, Zephyrus, several members of 
> the KDE herd and other interested parties [1] are currently working on 
> the pre-releases of KDE4 in the GenKDEsvn overlays [2]. 
> 
> 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. 
> 

Given that one of the many issues I have with cmake (being portage
unfriendly) I welcome warmly your contribution =)

lu - now if they convert the whole mess in C and make it build in 1/4
the time it takes now... (well coremake could be a replacement if were
accessible right now)

-- 

Luca Barbato

Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/~lu_zero
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] New eclass: cmake-utils.eclass
  2007-09-09 19:15 [gentoo-dev] New eclass: cmake-utils.eclass Wulf C. Krueger
                   ` (4 preceding siblings ...)
  2007-09-10  8:00 ` [gentoo-dev] " Luca Barbato
@ 2007-09-10 11:08 ` Thomas Anderson
  2007-11-02 22:33 ` Wulf C. Krueger
  2007-11-08 16:20 ` René 'Necoro' Neumann
  7 siblings, 0 replies; 20+ messages in thread
From: Thomas Anderson @ 2007-09-10 11:08 UTC (permalink / raw
  To: gentoo-dev

On Sunday 09 September 2007 15:15:12 Wulf C. Krueger wrote:
> As I would like to introduce it to the official Portage Tree in
> preparation of things to come, we would welcome any comments, patches
> and, of course, your kind approval to commit it. :-)

Looks really nice. Just one question: What about colors? I know that some 
Cmake build systems color the compiles rather nicely(games-puzzle/ksudoku for 
example). It would be nice if the kde builds were colored that nicely, or is 
this an upstream issue?

/me knows absolutely nothing about cmake ;) ....yet
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] New eclass: cmake-utils.eclass
  2007-09-09 19:15 [gentoo-dev] New eclass: cmake-utils.eclass Wulf C. Krueger
                   ` (5 preceding siblings ...)
  2007-09-10 11:08 ` Thomas Anderson
@ 2007-11-02 22:33 ` Wulf C. Krueger
  2007-11-08 16:20 ` René 'Necoro' Neumann
  7 siblings, 0 replies; 20+ messages in thread
From: Wulf C. Krueger @ 2007-11-02 22:33 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]

Hello!

On Sunday, 09. September 2007 21:15:12 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.

We've implemented the fixes that were asked for on this list and they have 
been extensively tested. Thus, I'd like to re-submit our 
cmake-utils.eclass because I want to commit it to the tree on Sunday 
unless there are more objections:

http://tinyurl.com/368lzh [1]

[1] 
http://genkdesvn.svn.sourceforge.net/viewvc/genkdesvn/kde4-stable/eclass/cmake-utils.eclass?view=markup&pathrev=1990

-- 
Best regards, Wulf

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] New eclass: cmake-utils.eclass
  2007-09-09 19:15 [gentoo-dev] New eclass: cmake-utils.eclass Wulf C. Krueger
                   ` (6 preceding siblings ...)
  2007-11-02 22:33 ` Wulf C. Krueger
@ 2007-11-08 16:20 ` René 'Necoro' Neumann
  2007-11-08 22:57   ` [gentoo-dev] " Steve Long
  7 siblings, 1 reply; 20+ messages in thread
From: René 'Necoro' Neumann @ 2007-11-08 16:20 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I just worked on a project using cmake. And I needed the
cmake-utils_src_enable function...
But it did not work as expected. This is because cmake arguments are in
uppercase most of the time, and cmake is case sensitive.
And unfortunately the cmake-utils_src_* functions just return the passed
in flag literally:

cmake-utils_src_enable python => -DENABLE_python=...

Wanted would be that it returned -DENABLE_PYTHON=...

I'm not into bash scripting that much, so I do not know a way to do so -
but I guess someone else is ;)

Regards,
Necoro
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHMzdk4UOg/zhYFuARAg92AJ4qpzuei0P+y+Wfy4dah/MWq4pBAACdG178
yEkbV4vpDx3CtFc9pdEfldw=
=avlW
-----END PGP SIGNATURE-----
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 20+ messages in thread

* [gentoo-dev]  Re: New eclass: cmake-utils.eclass
  2007-11-08 16:20 ` René 'Necoro' Neumann
@ 2007-11-08 22:57   ` Steve Long
  2007-11-08 23:28     ` René 'Necoro' Neumann
  0 siblings, 1 reply; 20+ messages in thread
From: Steve Long @ 2007-11-08 22:57 UTC (permalink / raw
  To: gentoo-dev

René 'Necoro' Neumann wrote:
> cmake-utils_src_enable python => -DENABLE_python=...
> 
> Wanted would be that it returned -DENABLE_PYTHON=...
> 
> I'm not into bash scripting that much, so I do not know a way to do so -
> but I guess someone else is ;)
> 
Unfortunately BASH doesn't support ksh93 or zsh style casting to uppercase.
The best way really is via tr:
alias toUpper='tr [[:lower:]] [[:upper:]]'
alias toLower='tr [[:upper:]] [[:lower:]]'

(er aliases don't normally work in scripts, but you get the idea.) Bear in
mind that tr reads stdin and writes to stdout. It has the advantage of
being locale-safe. Every other method I've looked at is much slower and
only works with ASCII.

A function wouldn't be too hard:
toUpper() {
        for i; do
        echo "$i" |tr [[:lower:]] [[:upper:]]
        done
}

Usage depends on the parameters you pass.
var=$(toUpper $var) # for single vars with no newlines in
for i in $(toUpper "$@"); do # for multiple, if just simple flags with no
space, tabs or newlines.

IFS=$'\n'; before the above would deal with anything but newlines in the
vars. (We can get more complex but I doubt it's needed in this scope, much
as I hate leaving script in a technically unsafe state. If you're parsing
filenames, this is *not* safe.)

$ a='blah blah'
$ a=$(toUpper "$a")
$ echo "$a"
BLAH BLAH


-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev]  Re: New eclass: cmake-utils.eclass
  2007-11-08 22:57   ` [gentoo-dev] " Steve Long
@ 2007-11-08 23:28     ` René 'Necoro' Neumann
  2007-11-09  2:46       ` Ingmar Vanhassel
  2007-11-09  3:04       ` Ingmar Vanhassel
  0 siblings, 2 replies; 20+ messages in thread
From: René 'Necoro' Neumann @ 2007-11-08 23:28 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1429 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steve Long schrieb:
> René 'Necoro' Neumann wrote:
>> cmake-utils_src_enable python => -DENABLE_python=...
>>
>> Wanted would be that it returned -DENABLE_PYTHON=...
>>
>> I'm not into bash scripting that much, so I do not know a way to do so -
>> but I guess someone else is ;)
>>
> Unfortunately BASH doesn't support ksh93 or zsh style casting to uppercase.
> The best way really is via tr:
> alias toUpper='tr [[:lower:]] [[:upper:]]'
> alias toLower='tr [[:upper:]] [[:lower:]]'
> 
> (er aliases don't normally work in scripts, but you get the idea.) Bear in
> mind that tr reads stdin and writes to stdout. It has the advantage of
> being locale-safe. Every other method I've looked at is much slower and
> only works with ASCII.
> 
> A function wouldn't be too hard:
> toUpper() {
>         for i; do
>         echo "$i" |tr [[:lower:]] [[:upper:]]
>         done
> }
> 
> Usage depends on the parameters you pass.
> var=$(toUpper $var) # for single vars with no newlines in

This is right the version I've chosen ... so with the help of Steve: a
small patch ;)

Regards,
Necoro
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFHM5uv4UOg/zhYFuARAuELAJjnlDCFDMm3e2mJqYuyT4nkFoaaAJ4go9qp
Qca9r8Y7LpD0YSSylUh2BQ==
=517n
-----END PGP SIGNATURE-----

[-- Attachment #2: cmake-utils.eclass.diff --]
[-- Type: text/plain, Size: 731 bytes --]

--- cmake-utils.eclass.old	2007-11-09 00:25:49.000000000 +0100
+++ cmake-utils.eclass	2007-11-09 00:14:47.000000000 +0100
@@ -23,11 +23,17 @@
 
 EXPORT_FUNCTIONS src_compile src_test src_install
 
+# Internal funcion used by _use_me_now. Converts string to upper case.
+_to_upper() {
+	debug-print-function $FUNCNAME $*
+	echo "$1" | tr "[[:lower:]]" "[[:upper:]]"
+}
+
 # Internal function use by cmake-utils_use_with and cmake-utils_use_enable
 _use_me_now() {
 	debug-print-function $FUNCNAME $*
 	[[ -z $2 ]] && die "cmake-utils_use-$1 <USE flag> [<flag name>]"
-	echo "-D$1_${3:-$2}=$(use $2 && echo ON || echo OFF)"
+	echo "-D$1_${3:-$(_to_upper $2)}=$(use $2 && echo ON || echo OFF)"
 }
 
 # @FUNCTION: cmake-utils_use_with

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] Re: New eclass: cmake-utils.eclass
  2007-11-08 23:28     ` René 'Necoro' Neumann
@ 2007-11-09  2:46       ` Ingmar Vanhassel
  2007-11-09  3:04       ` Ingmar Vanhassel
  1 sibling, 0 replies; 20+ messages in thread
From: Ingmar Vanhassel @ 2007-11-09  2:46 UTC (permalink / raw
  To: gentoo-dev

Excerpts from René 'Necoro' Neumann's message of Fri Nov 09 00:28:47 +0100 2007:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Steve Long schrieb:
> > René 'Necoro' Neumann wrote:
> >> cmake-utils_src_enable python => -DENABLE_python=...
> >>
> >> Wanted would be that it returned -DENABLE_PYTHON=...
> >>
> >> I'm not into bash scripting that much, so I do not know a way to do so -
> >> but I guess someone else is ;)
> >>
> > Unfortunately BASH doesn't support ksh93 or zsh style casting to uppercase.
> > The best way really is via tr:
> > alias toUpper='tr [[:lower:]] [[:upper:]]'
> > alias toLower='tr [[:upper:]] [[:lower:]]'
> > 
> > (er aliases don't normally work in scripts, but you get the idea.) Bear in
> > mind that tr reads stdin and writes to stdout. It has the advantage of
> > being locale-safe. Every other method I've looked at is much slower and
> > only works with ASCII.
> > 
> > A function wouldn't be too hard:
> > toUpper() {
> >         for i; do
> >         echo "$i" |tr [[:lower:]] [[:upper:]]
> >         done
> > }
> > 
> > Usage depends on the parameters you pass.
> > var=$(toUpper $var) # for single vars with no newlines in
> 
> This is right the version I've chosen ... so with the help of Steve: a
> small patch ;)
> 
> Regards,
> Necoro
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD4DBQFHM5uv4UOg/zhYFuARAuELAJjnlDCFDMm3e2mJqYuyT4nkFoaaAJ4go9qp
> Qca9r8Y7LpD0YSSylUh2BQ==
> =517n
> -----END PGP SIGNATURE-----

Hi Necoro,

It looks like you want to use

'cmake-utils_use_enable python PYTHON'

It's mentioned in the cmake-utils.eclass manpage (app-portage/eclass-manpages),
as well as in the patch you just sent: cmake-utils_use_enable <USE flag> [flag name]

:-)

Regards,
Ingmar Vanhassel

-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] Re: New eclass: cmake-utils.eclass
  2007-11-08 23:28     ` René 'Necoro' Neumann
  2007-11-09  2:46       ` Ingmar Vanhassel
@ 2007-11-09  3:04       ` Ingmar Vanhassel
  2007-11-09  9:10         ` René 'Necoro' Neumann
  1 sibling, 1 reply; 20+ messages in thread
From: Ingmar Vanhassel @ 2007-11-09  3:04 UTC (permalink / raw
  To: gentoo-dev

2007/11/9, René 'Necoro' Neumann <lists@necoro.eu>:
> Steve Long schrieb:
> > René 'Necoro' Neumann wrote:
> >> cmake-utils_src_enable python => -DENABLE_python=...
> >>
> >> Wanted would be that it returned -DENABLE_PYTHON=...
> >>
> >> I'm not into bash scripting that much, so I do not know a way to do so -
> >> but I guess someone else is ;)
> >>
> > Unfortunately BASH doesn't support ksh93 or zsh style casting to
> uppercase.
> > The best way really is via tr:
> > alias toUpper='tr [[:lower:]] [[:upper:]]'
> > alias toLower='tr [[:upper:]] [[:lower:]]'
> >
> > (er aliases don't normally work in scripts, but you get the idea.) Bear in
> > mind that tr reads stdin and writes to stdout. It has the advantage of
> > being locale-safe. Every other method I've looked at is much slower and
> > only works with ASCII.
> >
> > A function wouldn't be too hard:
> > toUpper() {
> >         for i; do
> >         echo "$i" |tr [[:lower:]] [[:upper:]]
> >         done
> > }
> >
> > Usage depends on the parameters you pass.
> > var=$(toUpper $var) # for single vars with no newlines in
>
> This is right the version I've chosen ... so with the help of Steve: a
> small patch ;)
>
> Regards,
> Necoro

Hi Necoro,

You can just use 'cmake-utils_use_enable python PYTHON'

It's mentioned in the cmake-utils.eclass manpage (app-portage/eclass-manpages),
as well as in the patch you just sent: cmake-utils_use_enable <USE
flag> [flag name]

:-)

Regards,
Ingmar Vanhassel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] Re: New eclass: cmake-utils.eclass
  2007-11-09  3:04       ` Ingmar Vanhassel
@ 2007-11-09  9:10         ` René 'Necoro' Neumann
  2007-11-09 15:58           ` Wulf C. Krueger
  0 siblings, 1 reply; 20+ messages in thread
From: René 'Necoro' Neumann @ 2007-11-09  9:10 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ingmar Vanhassel schrieb:
> 2007/11/9, René 'Necoro' Neumann <lists@necoro.eu>:
>> Steve Long schrieb:
>>> René 'Necoro' Neumann wrote:
>>>> cmake-utils_src_enable python => -DENABLE_python=...
>>>>
>>>> Wanted would be that it returned -DENABLE_PYTHON=...
>>>>
>>>> I'm not into bash scripting that much, so I do not know a way to do so -
>>>> but I guess someone else is ;)
>>>>
>>> Unfortunately BASH doesn't support ksh93 or zsh style casting to
>> uppercase.
>>> The best way really is via tr:
>>> alias toUpper='tr [[:lower:]] [[:upper:]]'
>>> alias toLower='tr [[:upper:]] [[:lower:]]'
>>>
>>> (er aliases don't normally work in scripts, but you get the idea.) Bear in
>>> mind that tr reads stdin and writes to stdout. It has the advantage of
>>> being locale-safe. Every other method I've looked at is much slower and
>>> only works with ASCII.
>>>
>>> A function wouldn't be too hard:
>>> toUpper() {
>>>         for i; do
>>>         echo "$i" |tr [[:lower:]] [[:upper:]]
>>>         done
>>> }
>>>
>>> Usage depends on the parameters you pass.
>>> var=$(toUpper $var) # for single vars with no newlines in
>> This is right the version I've chosen ... so with the help of Steve: a
>> small patch ;)
>>
>> Regards,
>> Necoro
> 
> Hi Necoro,
> 
> You can just use 'cmake-utils_use_enable python PYTHON'
> 
> It's mentioned in the cmake-utils.eclass manpage (app-portage/eclass-manpages),
> as well as in the patch you just sent: cmake-utils_use_enable <USE
> flag> [flag name]
> 
> :-)
> 
> Regards,
> Ingmar Vanhassel
> ���^�\a���(�	��X��X�t===
 I know this :) ... and this is how I did this at the moment.
But as I think, that the uppercase version is the common behavior here,
it should not need this extra "PYTHON". :) That's why the patch ;)

Regards,
Necoro
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHNCQS4UOg/zhYFuARAmdhAJ9idOAgUEX7GIvQrkDIIOT8heg5YgCfdSAM
09YrI9Nky6kmKVNg4Egafgk=
=ZT15
-----END PGP SIGNATURE-----
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] Re: New eclass: cmake-utils.eclass
  2007-11-09  9:10         ` René 'Necoro' Neumann
@ 2007-11-09 15:58           ` Wulf C. Krueger
  2007-11-09 16:10             ` René 'Necoro' Neumann
  0 siblings, 1 reply; 20+ messages in thread
From: Wulf C. Krueger @ 2007-11-09 15:58 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

On Friday, 09. November 2007 10:10:42 René 'Necoro' Neumann wrote:
> But as I think, that the uppercase version is the common behavior here,
> it should not need this extra "PYTHON". :) That's why the patch ;)

Actually, the mixed-case is what we have encountered in most cases. 

Furthermore, as you stated correctly yourself, cmake is case-sensitive and 
a patch that works around that fact only to have one parameter less for a 
function doesn't really make much sense in my book.

-- 
Best regards, Wulf

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] Re: New eclass: cmake-utils.eclass
  2007-11-09 15:58           ` Wulf C. Krueger
@ 2007-11-09 16:10             ` René 'Necoro' Neumann
  2007-11-09 17:45               ` Marijn Schouten (hkBst)
  0 siblings, 1 reply; 20+ messages in thread
From: René 'Necoro' Neumann @ 2007-11-09 16:10 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Wulf C. Krueger schrieb:
> On Friday, 09. November 2007 10:10:42 René 'Necoro' Neumann wrote:
>> But as I think, that the uppercase version is the common behavior here,
>> it should not need this extra "PYTHON". :) That's why the patch ;)
> 
> Actually, the mixed-case is what we have encountered in most cases. 
> 
> Furthermore, as you stated correctly yourself, cmake is case-sensitive and 
> a patch that works around that fact only to have one parameter less for a 
> function doesn't really make much sense in my book.
> 
Hmm ... ok - if you say, that more applications used the mixed case
versions, the current version is ok :)
I did not want to reduce one parameter, but when I first used this
eclass function, I assumed, that it will do the right thing (that is:
make it uppercase). It did not do so - that's why the patch ;).

Another way would be to enhance the comment and state explicitly that it
takes the useflag literally and does not do any case transition :)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHNIZt4UOg/zhYFuARAhuNAJ97EaX5W2ffNUrtPsFLLY1ZzTQFFQCffyCE
mThno69KazBAWmnsifjxM8E=
=7Xbk
-----END PGP SIGNATURE-----
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] Re: New eclass: cmake-utils.eclass
  2007-11-09 16:10             ` René 'Necoro' Neumann
@ 2007-11-09 17:45               ` Marijn Schouten (hkBst)
  2007-11-09 17:51                 ` Marijn Schouten (hkBst)
  0 siblings, 1 reply; 20+ messages in thread
From: Marijn Schouten (hkBst) @ 2007-11-09 17:45 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

� wrote:
> Wulf C. Krueger schrieb:
>> On Friday, 09. November 2007 10:10:42 Rený 'Necoro' Neumann wrote:
>>> But as I think, that the uppercase version is the common behavior here,
>>> it should not need this extra "PYTHON". :) That's why the patch ;)
>> Actually, the mixed-case is what we have encountered in most cases. 
> 
>> Furthermore, as you stated correctly yourself, cmake is case-sensitive and 
>> a patch that works around that fact only to have one parameter less for a 
>> function doesn't really make much sense in my book.
> 
> Hmm ... ok - if you say, that more applications used the mixed case
> versions, the current version is ok :)
> I did not want to reduce one parameter, but when I first used this
> eclass function, I assumed, that it will do the right thing (that is:
> make it uppercase). It did not do so - that's why the patch ;).
> 
> Another way would be to enhance the comment and state explicitly that it
> takes the useflag literally and does not do any case transition :)

Please don't reuse other people's digital signatures, Necoro.

Marijn

- --
Marijn Schouten (hkBst), Gentoo Lisp project, Gentoo ML
<http://www.gentoo.org/proj/en/lisp/>, #gentoo-{lisp,ml} on FreeNode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHNJy/p/VmCx0OL2wRApycAJwLttjtkPEEzEEkM0XlNg93FCzgCgCgtkRU
/HTtrpUXuHV4jjcQ8qGqlSM=
=K51B
-----END PGP SIGNATURE-----
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [gentoo-dev] Re: New eclass: cmake-utils.eclass
  2007-11-09 17:45               ` Marijn Schouten (hkBst)
@ 2007-11-09 17:51                 ` Marijn Schouten (hkBst)
  0 siblings, 0 replies; 20+ messages in thread
From: Marijn Schouten (hkBst) @ 2007-11-09 17:51 UTC (permalink / raw
  To: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Marijn Schouten (hkBst) wrote:
> ý wrote:
>> Wulf C. Krueger schrieb:
>>> On Friday, 09. November 2007 10:10:42 Rený 'Necoro' Neumann wrote:
>>>> But as I think, that the uppercase version is the common behavior here,
>>>> it should not need this extra "PYTHON". :) That's why the patch ;)
>>> Actually, the mixed-case is what we have encountered in most cases. 
>>> Furthermore, as you stated correctly yourself, cmake is case-sensitive and 
>>> a patch that works around that fact only to have one parameter less for a 
>>> function doesn't really make much sense in my book.
>> Hmm ... ok - if you say, that more applications used the mixed case
>> versions, the current version is ok :)
>> I did not want to reduce one parameter, but when I first used this
>> eclass function, I assumed, that it will do the right thing (that is:
>> make it uppercase). It did not do so - that's why the patch ;).
> 
>> Another way would be to enhance the comment and state explicitly that it
>> takes the useflag literally and does not do any case transition :)
> 
> Please don't reuse other people's digital signatures, Necoro.

Never mind, I take it back.

Marijn

- --
Marijn Schouten (hkBst), Gentoo Lisp project, Gentoo ML
<http://www.gentoo.org/proj/en/lisp/>, #gentoo-{lisp,ml} on FreeNode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHNJ4Qp/VmCx0OL2wRAlNSAJwMzJyjMgcywE05LQSJIIvlZp8L5ACfUEnU
d0YFSB4eC7r+dHvVY1j4y9A=
=qJmh
-----END PGP SIGNATURE-----
-- 
gentoo-dev@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2007-12-28  1:48 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-09 19:15 [gentoo-dev] New eclass: cmake-utils.eclass Wulf C. Krueger
2007-09-09 19:48 ` Piotr Jaroszyński
2007-09-09 20:32   ` Mike Frysinger
2007-09-09 20:11 ` [gentoo-dev] " Christian Faulhammer
2007-09-09 20:44 ` [gentoo-dev] " Mike Frysinger
2007-09-09 21:05   ` Wulf C. Krueger
2007-09-09 21:03 ` [gentoo-dev] " Christian Faulhammer
2007-09-10  8:00 ` [gentoo-dev] " Luca Barbato
2007-09-10 11:08 ` Thomas Anderson
2007-11-02 22:33 ` Wulf C. Krueger
2007-11-08 16:20 ` René 'Necoro' Neumann
2007-11-08 22:57   ` [gentoo-dev] " Steve Long
2007-11-08 23:28     ` René 'Necoro' Neumann
2007-11-09  2:46       ` Ingmar Vanhassel
2007-11-09  3:04       ` Ingmar Vanhassel
2007-11-09  9:10         ` René 'Necoro' Neumann
2007-11-09 15:58           ` Wulf C. Krueger
2007-11-09 16:10             ` René 'Necoro' Neumann
2007-11-09 17:45               ` Marijn Schouten (hkBst)
2007-11-09 17:51                 ` Marijn Schouten (hkBst)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox