diff options
-rw-r--r-- | eclass/trinity-base-2.eclass | 50 | ||||
-rw-r--r-- | eclass/trinity-functions-2.eclass | 1 | ||||
-rw-r--r-- | eclass/trinity-meta-2.eclass | 63 |
3 files changed, 109 insertions, 5 deletions
diff --git a/eclass/trinity-base-2.eclass b/eclass/trinity-base-2.eclass index e5ba4b24..e7604a6b 100644 --- a/eclass/trinity-base-2.eclass +++ b/eclass/trinity-base-2.eclass @@ -8,7 +8,27 @@ # Purpose: Support ebuilds for the Trinity Desktop (KDE3 fork). # -inherit trinity-functions-2 cmake-utils +inherit trinity-functions-2 + +# @ECLASS-VARIABLE: TRINITY_BUILD_ADMIN +# @DESCRIPTION: +# The value of this variable determines the package build mode. +# If set to "yes", the module "admin" is used for assembly.The build +# is done using the 'trinity-econf' and 'emake' functions. +# If set to "no", inherit cmake-utils. +: ${TRINITY_BUILD_ADMIN:=no} + + +case ${TRINITY_BUILD_ADMIN} in + yes) + ;; + no) + inherit cmake-utils + ;; + *) + eerror "Unknown value for \${CHECK_ADMIN}" + die "Value ${CHECK_ADMIN} is not supported" +esac # Don't use Gentoo mirrors RESTRICT="mirror" @@ -244,7 +264,12 @@ trinity-base-2_src_prepare() { fi fi - cmake-utils_src_prepare + if [[ ${TRINITY_BUILD_ADMIN} == "yes" ]] ; then + trinity-gen-configure + eapply_user + elif [[ ${TRINITY_BUILD_ADMIN} == "no" ]] ; then + cmake-utils_src_prepare + fi } @@ -284,7 +309,11 @@ trinity-base-2_src_configure() { "${mycmakeargs[@]}" ) - cmake-utils_src_configure + if [[ ${TRINITY_BUILD_ADMIN} == "yes" ]] ; then + trinity-econf + elif [[ ${TRINITY_BUILD_ADMIN} == "no" ]] ; then + cmake-utils_src_configure + fi } # @FUNCTION: trinity-base-2_src_compile @@ -293,7 +322,11 @@ trinity-base-2_src_configure() { trinity-base-2_src_compile() { debug-print-function ${FUNCNAME} "${@}" - cmake-utils_src_compile + if [[ ${TRINITY_BUILD_ADMIN} == "yes" ]] ; then + emake + elif [[ ${TRINITY_BUILD_ADMIN} == "no" ]] ; then + cmake-utils_src_compile + fi } # @FUNCTION: trinity-base-2_src_install @@ -301,7 +334,14 @@ trinity-base-2_src_compile() { # Call standard cmake-utils_src_install and installs common documentation. trinity-base-2_src_install() { debug-print-function ${FUNCNAME} "${@}" - cmake-utils_src_install + + if [[ ${TRINITY_BUILD_ADMIN} == "yes" ]] ; then + if [[ ${TRINITY_MODULE_NAME} == "${PN}" ]] ; then + emake install DESTDIR="${D}" + fi + elif [[ ${TRINITY_BUILD_ADMIN} == "no" ]] ; then + cmake-utils_src_install + fi if [[ -z "${TRINITY_BASE_NO_INSTALL_DOC}" || "${TRINITY_BASE_NO_INSTALL_DOC}" == "no" ]]; then diff --git a/eclass/trinity-functions-2.eclass b/eclass/trinity-functions-2.eclass index 528bb788..252ef1b4 100644 --- a/eclass/trinity-functions-2.eclass +++ b/eclass/trinity-functions-2.eclass @@ -204,6 +204,7 @@ trinity-admin-prepare() { pushd "${PWD}/admin" libtoolize -c || die "Error libtoolize" cp -Rp /usr/share/aclocal/libtool.m4 "libtool.m4.in" || die "No such file: libtool.m4" + cp -Rp /usr/share/libtool/build-aux/config.* . || die popd } diff --git a/eclass/trinity-meta-2.eclass b/eclass/trinity-meta-2.eclass index d07ad066..d8f32ebe 100644 --- a/eclass/trinity-meta-2.eclass +++ b/eclass/trinity-meta-2.eclass @@ -54,6 +54,7 @@ trinity-meta-2_src_unpack() { case "${TRINITY_SCM}" in git) git-r3_src_unpack + trinity-meta-2_src_delete ;; *) die "TRINITY_SCM: ${TRINITY_SCM} is not supported by ${FUNCNAME}" ;; esac @@ -162,6 +163,8 @@ trinity-meta-2_create_extractlists() { TSM_EXTRACT_LIST+=" ${TSM_EXTRACT} ${TSM_EXTRACT_ALSO} cmake/ CMakeLists.txt" TSM_EXTRACT_LIST+=" config.h.cmake ConfigureChecks.cmake" + [[ ${TRINITY_BUILD_ADMIN} == "yes" ]] && TSM_EXTRACT_LIST+=" configure.in.in Makefile.am.in \ + ChangeLog AUTHORS NEWS README" debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: TSM_EXTRACT_LIST=\"${TSM_EXTRACT_LIST}\"" } @@ -233,10 +236,70 @@ trinity-meta-2_src_compile() { trinity-meta-2_src_install() { debug-print-function ${FUNCNAME} "${@}" + if [[ ${TRINITY_BUILD_ADMIN} == "yes" ]] ; then + for dir in ${TRINITY_SUBMODULE} ${TSM_EXTRACT}; do + if [[ -d "${S}"/$dir ]]; then + pushd "${S}"/$dir > /dev/null || die + emake DESTDIR="${D}" destdir="${D}" install || die "emake install failed." + popd > /dev/null || die + fi + done + fi + TRINITY_BASE_NO_INSTALL_DOC="yes" trinity-base-2_src_install trinity-base-2_create_tmp_docfiles ${TSM_EXTRACT} trinity-base-2_install_docfiles } +# @FUNCTION: trinity-meta-2_src_delete +# @DESCRIPTION: +# Default src_delete function for git. +# Removes unnecessary files. +trinity-meta-2_src_delete() { + debug-print-function ${FUNCNAME} "${@}" + + local x i dir newdir array num mod_dir + # Directories that do not need to be deleted + mod_dir="cmake admin libltdl libtdevnc" + + dir="${WORKDIR}/tmpdir" + trinity-meta-2_create_extractlists + + pushd ${S} > /dev/null || die + mkdir ${dir} || die + + for x in ${TSM_EXTRACT_LIST} + do + array=(${x//\// }) + num=${#array[@]} + + if [[ ${num} -gt 1 ]] ; then + for (( i=0; i<$[${num}-1]; i++ )); + do + newdir+="${array[$i]}/" + done + + mkdir -p ${dir}/${newdir} || die + cp -af ${x} ${dir}/${newdir} || die + unset newdir + else + cp -af ${x} ${dir}/ || die + fi + done + einfo "Delete directories..." + for x in * + do + if ! has ${x} ${mod_dir} ; then + rm -rf ${x} || die + else + einfo "Skipping ${x}" + fi + done + + cp -af ${dir}/. . || die + rm -rf ${dir} || die + popd > /dev/null || die +} + EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_unpack pkg_setup |