Wulf: check this patch to cmake-utils.eclass - it used pushd/popd, adds CMAKE_IN_SOURCE_BUILD in cmake-utils_src_compile and defines LIB_INSTALL_DIR (cmake-utils will be used by other packages besides KDE too).
-- Krzysiek Pawlik <nelchael at gentoo.org> key id: 0xBC555551 desktop-misc, desktop-dock, x86, java, apache, ppc...
Index: cmake-utils.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v retrieving revision 1.1 diff -u -r1.1 cmake-utils.eclass --- cmake-utils.eclass 4 Nov 2007 13:17:35 -0000 1.1 +++ cmake-utils.eclass 4 Nov 2007 14:08:01 -0000 @@ -49,7 +49,11 @@ cmake-utils_src_compile() { debug-print-function $FUNCNAME $* - cmake-utils_src_configureout + if [[ -n "${CMAKE_IN_SOURCE_BUILD}" ]]; then + cmake-utils_src_configurein + else + cmake-utils_src_configureout + fi cmake-utils_src_make } @@ -74,11 +78,13 @@ debug-print-function $FUNCNAME $* local cmakeargs="${mycmakeargs} $(_common_configure_code)" - mkdir "${WORKDIR}"/${PN}_build - cd "${WORKDIR}"/${PN}_build + mkdir -p "${WORKDIR}"/${PN}_build + pushd "${WORKDIR}"/${PN}_build > /dev/null debug-print "$LINENO $ECLASS $FUNCNAME: mycmakeargs is $cmakeargs" cmake ${cmakeargs} "${S}" || die "Cmake failed" + + popd > /dev/null } # Internal use only. Common configuration options for all types of builds. @@ -91,6 +97,7 @@ echo -DCMAKE_CXX_COMPILER=$(type -P $(tc-getCXX)) echo -DCMAKE_INSTALL_PREFIX=${PREFIX:-/usr} echo -DLIB_SUFFIX=${tmp_libdir/lib} + echo -DLIB_INSTALL_DIR=${tmp_libdir} [[ -n ${CMAKE_NO_COLOR} ]] && echo -DCMAKE_COLOR_MAKEFILE=OFF } @@ -103,12 +110,15 @@ # At this point we can automatically check if it's an out-of-source or an # in-source build if [[ -d ${WORKDIR}/${PN}_build ]]; then - cd "${WORKDIR}"/${PN}_build; + pushd "${WORKDIR}"/${PN}_build > /dev/null fi if ! [[ -z ${CMAKE_COMPILER_VERBOSE} ]]; then - emake VERBOSE=1 || die "Make failed!"; + emake VERBOSE=1 || die "Make failed!" else - emake || die "Make failed!"; + emake || die "Make failed!" + fi + if [[ -d ${WORKDIR}/${PN}_build ]]; then + popd > /dev/null fi } @@ -121,9 +131,12 @@ # At this point we can automatically check if it's an out-of-source or an # in-source build if [[ -d ${WORKDIR}/${PN}_build ]]; then - cd "${WORKDIR}"/${PN}_build; + pushd "${WORKDIR}"/${PN}_build > /dev/null fi emake install DESTDIR="${D}" || die "Make install failed" + if [[ -d ${WORKDIR}/${PN}_build ]]; then + popd > /dev/null + fi } # @FUNCTION: cmake-utils_src_test @@ -135,7 +148,7 @@ # At this point we can automatically check if it's an out-of-source or an # in-source build if [[ -d ${WORKDIR}/${PN}_build ]]; then - cd "${WORKDIR}"/${PN}_build + pushd "${WORKDIR}"/${PN}_build > /dev/null fi # Standard implementation of src_test if emake -j1 check -n &> /dev/null; then @@ -151,4 +164,7 @@ else einfo ">>> Test phase [none]: ${CATEGORY}/${PF}" fi + if [[ -d ${WORKDIR}/${PN}_build ]]; then + popd > /dev/null + fi }
signature.asc
Description: OpenPGP digital signature