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
signature.asc
Description: This is a digitally signed message part.
