diff options
author | 2011-04-16 16:28:19 +0200 | |
---|---|---|
committer | 2011-04-16 16:33:20 +0200 | |
commit | ca8fc90f69a6e5e6316bc05ae8d96a84c13f3b03 (patch) | |
tree | dcbcf0b19d3bef41bbbe14c765be3bde86895351 | |
parent | Allow a different xulrunner (diff) | |
download | sardemff7-ca8fc90f69a6e5e6316bc05ae8d96a84c13f3b03.tar.gz sardemff7-ca8fc90f69a6e5e6316bc05ae8d96a84c13f3b03.tar.bz2 sardemff7-ca8fc90f69a6e5e6316bc05ae8d96a84c13f3b03.zip |
Factorize some stuff to a mozilla-scm-fetch eclass
-rw-r--r-- | eclass/mozilla-scm-fetch.eclass | 127 | ||||
-rw-r--r-- | eclass/mozilla-scm.eclass | 50 | ||||
-rw-r--r-- | meta-sync/mozilla-repositories/Manifest | 2 | ||||
-rw-r--r-- | meta-sync/mozilla-repositories/mozilla-repositories-9999.ebuild | 73 |
4 files changed, 134 insertions, 118 deletions
diff --git a/eclass/mozilla-scm-fetch.eclass b/eclass/mozilla-scm-fetch.eclass new file mode 100644 index 0000000..9d68fc8 --- /dev/null +++ b/eclass/mozilla-scm-fetch.eclass @@ -0,0 +1,127 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +# @ECLASS: mozilla-scm-fetch.eclass +# @MAINTAINER: +# Sardem FF7 <sardemff7.pub@gmail.com> +# @BLURB: This eclass provides Mozilla SCM fetching support + +EAPI="3" + +MOZ_HG_BASE_URI="http://hg.mozilla.org" + +XULRUNNER_HG_MODULE="mozilla-central" +MOZDOM_HG_MODULE="dom-inspector" +THUNDERBIRD_HG_MODULE="comm-central" +LDAP_SDKS_HG_MODULE="projects/ldap-sdks" + +# Enigmail CVS stuff +ECVS_USER="guest" +ECVS_PASS="guest" +ECVS_SERVER="mozdev.org:/cvs" +ECVS_MODULE="enigmail/src" + +inherit eutils + +MOZ_HG_BASE_URI="http://hg.mozilla.org" + + +# @ECLASS-VARIABLE: XULRUNNER_HG_MODULE +# @DESCRIPTION: +# The xulrunner module to use +# +# Default to mozilla-central, you may want +# to use mozilla-aurora +: ${XULRUNNER_HG_MODULE:=mozilla-central} +MOZDOM_HG_MODULE="dom-inspector" + +IUSE="mozdom" + +LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )" +SLOT="0" +SRC_URI="" +S="${WORKDIR}/${XULRUNNER_HG_MODULE}" + +# @ECLASS-VARIABLE: EHG_STORE_DIR +# @DESCRIPTION: +# Mercurial sources store directory. Users may override this in /etc/make.conf +: ${EHG_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/hg-src} + + +# @ECLASS-VARIABLE: EHG_QUIET +# @DESCRIPTION: +# Force the Mercurial commands to be quiet + +# @ECLASS-VARIABLE: EHG_CLONE_CMD +: ${EHG_CLONE_CMD:=hg clone ${EHG_QUIET:+--quiet} --pull --noupdate} + +# @ECLASS-VARIABLE: EHG_PULL_CMD +: ${EHG_PULL_CMD:=hg pull ${EHG_QUIET:+--quiet}} + +# @ECLASS-VARIABLE: EHG_OFFLINE +# @DESCRIPTION: +# Should be non-empty if offline to avoid cloning/updating +: ${EHG_OFFLINE:=${ESCM_OFFLINE}} + +function moz_hg_fetch { + [[ -n "${EHG_OFFLINE}" ]] && return + debug-print-function ${FUNCNAME} ${*} + + local repo=${1} + local module="$(basename "${repo}")" + + + # Should be set but blank to prevent using $HOME/.hgrc + export HGRCPATH= + + # Check ${EHG_STORE_DIR} directory: + addwrite "$(dirname "${EHG_STORE_DIR}")" || die "addwrite failed" + if [[ ! -d "${EHG_STORE_DIR}" ]]; then + mkdir -p "${EHG_STORE_DIR}" || die "failed to create ${EHG_STORE_DIR}" + chmod -f g+rw "${EHG_STORE_DIR}" || \ + die "failed to chown ${EHG_STORE_DIR}" + fi + + # Create project directory: + mkdir -p "${EHG_STORE_DIR}/mozilla" || \ + die "failed to create ${EHG_STORE_DIR}/mozilla" + chmod -f g+rw "${EHG_STORE_DIR}/mozilla" || \ + echo "Warning: failed to chmod g+rw mozilla" + cd "${EHG_STORE_DIR}/mozilla" || \ + die "failed to cd to ${EHG_STORE_DIR}/mozilla" + + # Clone/update repository: + if [[ ! -d "${module}" ]]; then + einfo "Cloning ${repo} to ${EHG_STORE_DIR}/mozilla/${module}" + ${EHG_CLONE_CMD} "${repo}" "${module}" || { + rm -rf "${module}" + die "failed to clone ${repo}" + } + cd "${module}" + else + einfo "Updating ${EHG_STORE_DIR}/mozilla/${module} from ${repo}" + cd "${module}" || die "failed to cd to ${module}" + ${EHG_PULL_CMD} || die "update failed" + fi +} + +function moz_hg_unpack { + debug-print-function ${FUNCNAME} ${*} + + local module=${1} + local dest="${WORKDIR}/${2:-${module}}" + + + # Should be set but blank to prevent using $HOME/.hgrc + export HGRCPATH= + + # Checkout working copy: + einfo "Creating working directory for ${module} (target revision: ${EHG_REVISION})" + hg archive \ + ${EHG_QUIET_CMD_OPT} \ + --rev="${EHG_REVISION}" \ + -R "${EHG_STORE_DIR}/mozilla/${module}" \ + "${dest}" || die "hg clone failed" + einfo "Work directory: ${dest}" +} diff --git a/eclass/mozilla-scm.eclass b/eclass/mozilla-scm.eclass index e211938..5c6f9fd 100644 --- a/eclass/mozilla-scm.eclass +++ b/eclass/mozilla-scm.eclass @@ -5,32 +5,18 @@ # @ECLASS: mozilla-scm.eclass # @MAINTAINER: # Sardem FF7 <sardemff7.pub@gmail.com> -# @BLURB: This eclass provides Mozilla SCM support +# @BLURB: This eclass provides Mozilla SCM building support WANT_AUTOCONF="2.1" -EAPI="4" -inherit base eutils multilib toolchain-funcs autotools python +inherit mozilla-scm-fetch base multilib toolchain-funcs autotools python MAJ_XUL_PV="6.0" MOZ_HG_BASE_URI="http://hg.mozilla.org" - -# @ECLASS-VARIABLE: XULRUNNER_HG_MODULE -# @DESCRIPTION: -# The xulrunner module to use -# -# Default to mozilla-central, you may want -# to use mozilla-aurora -: ${XULRUNNER_HG_MODULE:=mozilla-central} -MOZDOM_HG_MODULE="dom-inspector" - IUSE="mozdom" -LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )" -SLOT="0" -SRC_URI="" S="${WORKDIR}/${XULRUNNER_HG_MODULE}" # @@ -65,11 +51,6 @@ EXPORT_FUNCTIONS pkg_setup src_unpack src_configure src_install pkg_postinst # just a revision, please consult `hg help revisions' for more details. : ${EHG_REVISION:=tip} -# @ECLASS-VARIABLE: EHG_STORE_DIR -# @DESCRIPTION: -# Mercurial sources store directory. Users may override this in /etc/make.conf -: ${EHG_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/hg-src} - ## ## Base common stuff @@ -91,29 +72,6 @@ DEPEND="${RDEPEND} =dev-lang/python-2*[threads] " -IUSE="" - -function moz_hg_unpack { - debug-print-function ${FUNCNAME} ${*} - - local module=${1} - local dest="${WORKDIR}/${2:-${module}}" - - - # Should be set but blank to prevent using $HOME/.hgrc - export HGRCPATH= - - # Checkout working copy: - einfo "Creating working directory for ${module} (target revision: ${EHG_REVISION})" - hg archive \ - ${EHG_QUIET_CMD_OPT} \ - --rev="${EHG_REVISION}" \ - -R "${EHG_STORE_DIR}/mozilla/${module}" \ - "${dest}" || die "hg clone failed" - einfo "Work directory: ${dest}" -} - - ## ## eclass exported function ## src_unpack @@ -166,10 +124,10 @@ function mozilla-scm_src_install { die "failed to cp default-prefs.js" # Workaround - ${IS_LIBXUL} || { + if ! ${IS_LIBXUL}; then dosym ../xulrunner-${MAJ_XUL_PV} "${MOZILLA_FIVE_HOME}"/xulrunner \ || die "failed to workaround xulrunner gre stuff" - } + fi } ## diff --git a/meta-sync/mozilla-repositories/Manifest b/meta-sync/mozilla-repositories/Manifest index a17efd1..fbdda05 100644 --- a/meta-sync/mozilla-repositories/Manifest +++ b/meta-sync/mozilla-repositories/Manifest @@ -1 +1 @@ -EBUILD mozilla-repositories-9999.ebuild 2588 RMD160 bccefd1db3b3cbf149b7277e5a7225611524ea26 SHA1 2a4efc37e3caf05e0df58772c345b3fd4770bb21 SHA256 ef883bbc23d266839dd545677a8f877ddf7685fa417e13e43766b9ba878cd5a8 +EBUILD mozilla-repositories-9999.ebuild 700 RMD160 be1131a556bb48dc87555a3504ad09c733d42a2f SHA1 8d6bd7afcdd63b063f350c8256e950dcf5dff63f SHA256 3e7e7125494294fa7e261bf2da14be0e225f783f02e4f1aae52886954c1e505b diff --git a/meta-sync/mozilla-repositories/mozilla-repositories-9999.ebuild b/meta-sync/mozilla-repositories/mozilla-repositories-9999.ebuild index a0beb5e..159aa1f 100644 --- a/meta-sync/mozilla-repositories/mozilla-repositories-9999.ebuild +++ b/meta-sync/mozilla-repositories/mozilla-repositories-9999.ebuild @@ -2,42 +2,14 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ -EAPI="4" - -inherit eutils +inherit mozilla-scm-fetch use enigmail && inherit cvs -MOZ_HG_BASE_URI="http://hg.mozilla.org" - DESCRIPTION="Mozilla Mercurial repositories" HOMEPAGE="${MOZ_HG_BASE_URI}" -SRC_URI="" - -XULRUNNER_HG_MODULE="mozilla-central" -MOZDOM_HG_MODULE="dom-inspector" -THUNDERBIRD_HG_MODULE="comm-central" -LDAP_SDKS_HG_MODULE="projects/ldap-sdks" - -# Enigmail CVS stuff -ECVS_USER="guest" -ECVS_PASS="guest" -ECVS_SERVER="mozdev.org:/cvs" -ECVS_MODULE="enigmail/src" KEYWORDS="~amd64 ~x86" -IUSE="enigmail mozdom thunderbird" - -REQUIRE_USE=" - enigmail? ( thunderbird ) - " - -LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )" -SLOT="0" - -: ${EHG_STORE_DIR:=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/hg-src} -: ${EHG_CLONE_CMD:=hg clone ${EHG_QUIET:+--quiet} --pull --noupdate} -: ${EHG_PULL_CMD:=hg pull ${EHG_QUIET:+--quiet}} -: ${EHG_OFFLINE:=${ESCM_OFFLINE}} +IUSE="enigmail thunderbird" DEPEND=" dev-vcs/mercurial @@ -46,47 +18,6 @@ RDEPEND="" S="${WORKDIR}" -function moz_hg_fetch { - debug-print-function ${FUNCNAME} ${*} - - local repo=${1} - local module="$(basename "${repo}")" - - - # Should be set but blank to prevent using $HOME/.hgrc - export HGRCPATH= - - # Check ${EHG_STORE_DIR} directory: - addwrite "$(dirname "${EHG_STORE_DIR}")" || die "addwrite failed" - if [[ ! -d "${EHG_STORE_DIR}" ]]; then - mkdir -p "${EHG_STORE_DIR}" || die "failed to create ${EHG_STORE_DIR}" - chmod -f g+rw "${EHG_STORE_DIR}" || \ - die "failed to chown ${EHG_STORE_DIR}" - fi - - # Create project directory: - mkdir -p "${EHG_STORE_DIR}/mozilla" || \ - die "failed to create ${EHG_STORE_DIR}/mozilla" - chmod -f g+rw "${EHG_STORE_DIR}/mozilla" || \ - echo "Warning: failed to chmod g+rw mozilla" - cd "${EHG_STORE_DIR}/mozilla" || \ - die "failed to cd to ${EHG_STORE_DIR}/mozilla" - - # Clone/update repository: - if [[ ! -d "${module}" ]]; then - einfo "Cloning ${repo} to ${EHG_STORE_DIR}/mozilla/${module}" - ${EHG_CLONE_CMD} "${repo}" "${module}" || { - rm -rf "${module}" - die "failed to clone ${repo}" - } - cd "${module}" - elif [[ -z "${EHG_OFFLINE}" ]]; then - einfo "Updating ${EHG_STORE_DIR}/mozilla/${module} from ${repo}" - cd "${module}" || die "failed to cd to ${module}" - ${EHG_PULL_CMD} || die "update failed" - fi -} - function src_unpack { moz_hg_fetch "${MOZ_HG_BASE_URI}/${XULRUNNER_HG_MODULE}/" use mozdom && moz_hg_fetch "${MOZ_HG_BASE_URI}/${MOZDOM_HG_MODULE}/" |