* [gentoo-dev] [PATCH] autotools-utils: drop base.eclass inherit and thus src_unpack() export.
@ 2011-11-30 18:23 Michał Górny
2011-11-30 19:36 ` Mike Frysinger
2011-11-30 22:58 ` Michał Górny
0 siblings, 2 replies; 5+ messages in thread
From: Michał Górny @ 2011-11-30 18:23 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Importing base.eclass causes us to export src_unpack() phase function
which is entirely useless in EAPIs 2+ (which we only support), and
causes trouble importing autotools-utils e.g. after VCS eclasses.
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=392651
---
eclass/autotools-utils.eclass | 38 +++++++++++++++++++++++++++++++++-----
1 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 0aa1679..7a5b77c 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -93,7 +93,7 @@ case ${EAPI:-0} in
*) die "EAPI=${EAPI} is not supported" ;;
esac
-inherit autotools base eutils libtool
+inherit autotools eutils libtool
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
@@ -125,6 +125,24 @@ EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
# }
# @CODE
+# @ECLASS-VARIABLE: DOCS
+# @DESCRIPTION:
+# Array containing documents passed to dodoc command.
+#
+# DOCS=( NEWS README )
+
+# @ECLASS-VARIABLE: HTML_DOCS
+# @DESCRIPTION:
+# Array containing documents passed to dohtml command.
+#
+# HTML_DOCS=( doc/html/ )
+
+# @ECLASS-VARIABLE: PATCHES
+# @DESCRIPTION:
+# PATCHES array variable containing all various patches to be applied.
+#
+# PATCHES=( "${FILESDIR}/mypatch.patch" )
+
# Determine using IN or OUT source build
_check_build_dir() {
: ${ECONF_SOURCE:=${S}}
@@ -224,7 +242,9 @@ remove_libtool_files() {
autotools-utils_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
- base_src_prepare
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+ epatch_user
+
elibtoolize --patch-only
}
@@ -260,7 +280,7 @@ autotools-utils_src_configure() {
_check_build_dir
mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
- base_src_configure "${econfargs[@]}" "$@"
+ default_src_configure "${econfargs[@]}" "$@"
popd > /dev/null
}
@@ -272,7 +292,7 @@ autotools-utils_src_compile() {
_check_build_dir
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
- base_src_compile "$@"
+ default_src_compile "$@"
popd > /dev/null
}
@@ -289,9 +309,17 @@ autotools-utils_src_install() {
_check_build_dir
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
- base_src_install "$@"
+ emake DESTDIR="${D}" "$@" install || die "emake install failed"
popd > /dev/null
+ # XXX: support installing them from builddir as well?
+ if [[ ${DOCS} ]]; then
+ dodoc "${DOCS[@]}" || die "dodoc failed"
+ fi
+ if [[ ${HTML_DOCS} ]]; then
+ dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
+ fi
+
# Remove libtool files and unnecessary static libs
remove_libtool_files
}
--
1.7.8.rc4.dirty
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [gentoo-dev] [PATCH] autotools-utils: drop base.eclass inherit and thus src_unpack() export.
2011-11-30 18:23 [gentoo-dev] [PATCH] autotools-utils: drop base.eclass inherit and thus src_unpack() export Michał Górny
@ 2011-11-30 19:36 ` Mike Frysinger
2011-11-30 21:27 ` Michał Górny
2011-11-30 22:58 ` Michał Górny
1 sibling, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2011-11-30 19:36 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: Text/Plain, Size: 829 bytes --]
On Wednesday 30 November 2011 13:23:53 Michał Górny wrote:
> +# @ECLASS-VARIABLE: DOCS
> +# @DESCRIPTION:
> +# Array containing documents passed to dodoc command.
> +#
> +# DOCS=( NEWS README )
> +
> +# @ECLASS-VARIABLE: HTML_DOCS
> +# @DESCRIPTION:
> +# Array containing documents passed to dohtml command.
> +#
> +# HTML_DOCS=( doc/html/ )
these examples give the illusion these are the defaults. might want to
clarify that ...
> +# @ECLASS-VARIABLE: PATCHES
> +# @DESCRIPTION:
> +# PATCHES array variable containing all various patches to be applied.
> +#
> +# PATCHES=( "${FILESDIR}/mypatch.patch" )
this one is obvious that there is no default. might want to subconsciously
encourage good practices in people and have the example read:
# PATCHES=( "${FILESDIR}/${P}-mypatch.patch" )
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-dev] [PATCH] autotools-utils: drop base.eclass inherit and thus src_unpack() export.
2011-11-30 19:36 ` Mike Frysinger
@ 2011-11-30 21:27 ` Michał Górny
0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2011-11-30 21:27 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Importing base.eclass causes us to export src_unpack() phase function
which is entirely useless in EAPIs 2+ (which we only support), and
causes trouble importing autotools-utils e.g. after VCS eclasses.
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=392651
---
eclass/autotools-utils.eclass | 54 +++++++++++++++++++++++++++++++++++++----
1 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 0aa1679..b65443f 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -93,24 +93,28 @@ case ${EAPI:-0} in
*) die "EAPI=${EAPI} is not supported" ;;
esac
-inherit autotools base eutils libtool
+inherit autotools eutils libtool
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Build directory, location where all autotools generated files should be
# placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Set to enable in-source build.
# @ECLASS-VARIABLE: ECONF_SOURCE
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Specify location of autotools' configure script. By default it uses ${S}.
# @ECLASS-VARIABLE: myeconfargs
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Optional econf arguments as Bash array. Should be defined before calling src_configure.
# @CODE
@@ -125,6 +129,36 @@ EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
# }
# @CODE
+# @ECLASS-VARIABLE: DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array containing documents passed to dodoc command.
+#
+# Example:
+# @CODE
+# DOCS=( NEWS README )
+# @CODE
+
+# @ECLASS-VARIABLE: HTML_DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array containing documents passed to dohtml command.
+#
+# Example:
+# @CODE
+# HTML_DOCS=( doc/html/ )
+# @CODE
+
+# @ECLASS-VARIABLE: PATCHES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# PATCHES array variable containing all various patches to be applied.
+#
+# Example:
+# @CODE
+# PATCHES=( "${FILESDIR}"/${P}-mypatch.patch )
+# @CODE
+
# Determine using IN or OUT source build
_check_build_dir() {
: ${ECONF_SOURCE:=${S}}
@@ -224,7 +258,9 @@ remove_libtool_files() {
autotools-utils_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
- base_src_prepare
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+ epatch_user
+
elibtoolize --patch-only
}
@@ -260,7 +296,7 @@ autotools-utils_src_configure() {
_check_build_dir
mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
- base_src_configure "${econfargs[@]}" "$@"
+ default_src_configure "${econfargs[@]}" "$@"
popd > /dev/null
}
@@ -272,7 +308,7 @@ autotools-utils_src_compile() {
_check_build_dir
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
- base_src_compile "$@"
+ default_src_compile "$@"
popd > /dev/null
}
@@ -289,9 +325,17 @@ autotools-utils_src_install() {
_check_build_dir
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
- base_src_install "$@"
+ emake DESTDIR="${D}" "$@" install || die "emake install failed"
popd > /dev/null
+ # XXX: support installing them from builddir as well?
+ if [[ ${DOCS} ]]; then
+ dodoc "${DOCS[@]}" || die "dodoc failed"
+ fi
+ if [[ ${HTML_DOCS} ]]; then
+ dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
+ fi
+
# Remove libtool files and unnecessary static libs
remove_libtool_files
}
--
1.7.8.rc4.dirty
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [gentoo-dev] [PATCH] autotools-utils: drop base.eclass inherit and thus src_unpack() export.
2011-11-30 18:23 [gentoo-dev] [PATCH] autotools-utils: drop base.eclass inherit and thus src_unpack() export Michał Górny
2011-11-30 19:36 ` Mike Frysinger
@ 2011-11-30 22:58 ` Michał Górny
2011-11-30 23:04 ` Michał Górny
1 sibling, 1 reply; 5+ messages in thread
From: Michał Górny @ 2011-11-30 22:58 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 259 bytes --]
On Wed, 30 Nov 2011 19:23:53 +0100
Michał Górny <mgorny@gentoo.org> wrote:
> - base_src_configure "${econfargs[@]}" "$@"
> + default_src_configure "${econfargs[@]}" "$@"
Ohshi, default funcs don't take args...
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-dev] [PATCH] autotools-utils: drop base.eclass inherit and thus src_unpack() export.
2011-11-30 22:58 ` Michał Górny
@ 2011-11-30 23:04 ` Michał Górny
0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2011-11-30 23:04 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Importing base.eclass causes us to export src_unpack() phase function
which is entirely useless in EAPIs 2+ (which we only support), and
causes trouble importing autotools-utils e.g. after VCS eclasses.
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=392651
---
eclass/autotools-utils.eclass | 54 +++++++++++++++++++++++++++++++++++++----
1 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index 0aa1679..87cbd4a 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -93,24 +93,28 @@ case ${EAPI:-0} in
*) die "EAPI=${EAPI} is not supported" ;;
esac
-inherit autotools base eutils libtool
+inherit autotools eutils libtool
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Build directory, location where all autotools generated files should be
# placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Set to enable in-source build.
# @ECLASS-VARIABLE: ECONF_SOURCE
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Specify location of autotools' configure script. By default it uses ${S}.
# @ECLASS-VARIABLE: myeconfargs
+# @DEFAULT_UNSET
# @DESCRIPTION:
# Optional econf arguments as Bash array. Should be defined before calling src_configure.
# @CODE
@@ -125,6 +129,36 @@ EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
# }
# @CODE
+# @ECLASS-VARIABLE: DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array containing documents passed to dodoc command.
+#
+# Example:
+# @CODE
+# DOCS=( NEWS README )
+# @CODE
+
+# @ECLASS-VARIABLE: HTML_DOCS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Array containing documents passed to dohtml command.
+#
+# Example:
+# @CODE
+# HTML_DOCS=( doc/html/ )
+# @CODE
+
+# @ECLASS-VARIABLE: PATCHES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# PATCHES array variable containing all various patches to be applied.
+#
+# Example:
+# @CODE
+# PATCHES=( "${FILESDIR}"/${P}-mypatch.patch )
+# @CODE
+
# Determine using IN or OUT source build
_check_build_dir() {
: ${ECONF_SOURCE:=${S}}
@@ -224,7 +258,9 @@ remove_libtool_files() {
autotools-utils_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
- base_src_prepare
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
+ epatch_user
+
elibtoolize --patch-only
}
@@ -260,7 +296,7 @@ autotools-utils_src_configure() {
_check_build_dir
mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
- base_src_configure "${econfargs[@]}" "$@"
+ econf "${econfargs[@]}" "$@"
popd > /dev/null
}
@@ -272,7 +308,7 @@ autotools-utils_src_compile() {
_check_build_dir
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
- base_src_compile "$@"
+ emake "$@" || die 'emake failed'
popd > /dev/null
}
@@ -289,9 +325,17 @@ autotools-utils_src_install() {
_check_build_dir
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
- base_src_install "$@"
+ emake DESTDIR="${D}" "$@" install || die "emake install failed"
popd > /dev/null
+ # XXX: support installing them from builddir as well?
+ if [[ ${DOCS} ]]; then
+ dodoc "${DOCS[@]}" || die "dodoc failed"
+ fi
+ if [[ ${HTML_DOCS} ]]; then
+ dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
+ fi
+
# Remove libtool files and unnecessary static libs
remove_libtool_files
}
--
1.7.8.rc4.dirty
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-11-30 23:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-30 18:23 [gentoo-dev] [PATCH] autotools-utils: drop base.eclass inherit and thus src_unpack() export Michał Górny
2011-11-30 19:36 ` Mike Frysinger
2011-11-30 21:27 ` Michał Górny
2011-11-30 22:58 ` Michał Górny
2011-11-30 23:04 ` Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox