* [gentoo-dev] autotools-utils & cmake-utils: use common BUILD_DIR var
@ 2012-11-29 13:40 Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 1/4] autotools-utils: use common BUILD_DIR variable Michał Górny
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Michał Górny @ 2012-11-29 13:40 UTC (permalink / raw
To: gentoo-dev; +Cc: reavertm, scarabeus
Currently, each of the mentioned eclasses has its own *_BUILD_DIR.
Therefore, if someone needs to provide a custom BUILD_DIR, he needs to
set it explicitly for the eclass. This is fine for ebuilds but not
really neat for eclasses.
The idea is simple: use a common BUILD_DIR instead. For compatibility,
export AUTOTOOLS_ & CMAKE_BUILD_DIR as well but prefer the former one.
For most of the ebuilds this won't make a difference.
I'm attaching an example conversion of pygobject where this would
benefit. The idea is quite simple; ebuild calls
python_foreach_impl autotools-utils_src_...
python_foreach_impl() sets BUILD_DIR for each implementation,
autotools-utils phases use that and everything simply works!
^ permalink raw reply [flat|nested] 7+ messages in thread
* [gentoo-dev] [PATCH 1/4] autotools-utils: use common BUILD_DIR variable.
2012-11-29 13:40 [gentoo-dev] autotools-utils & cmake-utils: use common BUILD_DIR var Michał Górny
@ 2012-11-29 13:40 ` Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 2/4] autotools-multilib: use and support BUILD_DIR Michał Górny
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2012-11-29 13:40 UTC (permalink / raw
To: gentoo-dev; +Cc: reavertm, scarabeus, Michał Górny
For interoperability with python-r1.
---
gx86/eclass/autotools-utils.eclass | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/gx86/eclass/autotools-utils.eclass b/gx86/eclass/autotools-utils.eclass
index b035dc5..b6bfc96 100644
--- a/gx86/eclass/autotools-utils.eclass
+++ b/gx86/eclass/autotools-utils.eclass
@@ -76,10 +76,10 @@
# }
#
# src_install() {
-# use doc && HTML_DOCS=("${AUTOTOOLS_BUILD_DIR}/apidocs/html/")
+# use doc && HTML_DOCS=("${BUILD_DIR}/apidocs/html/")
# autotools-utils_src_install
# if use examples; then
-# dobin "${AUTOTOOLS_BUILD_DIR}"/foo_example{1,2,3} \\
+# dobin "${BUILD_DIR}"/foo_example{1,2,3} \\
# || die 'dobin examples failed'
# fi
# }
@@ -117,11 +117,14 @@ inherit autotools eutils libtool
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
-# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
+# @ECLASS-VARIABLE: 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.
+#
+# This variable has been called AUTOTOOLS_BUILD_DIR formerly.
+# It is set under that name for compatibility.
# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
# @DEFAULT_UNSET
@@ -183,11 +186,14 @@ EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
_check_build_dir() {
: ${ECONF_SOURCE:=${S}}
if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
- AUTOTOOLS_BUILD_DIR="${ECONF_SOURCE}"
+ BUILD_DIR="${ECONF_SOURCE}"
else
- : ${AUTOTOOLS_BUILD_DIR:=${WORKDIR}/${P}_build}
+ : ${BUILD_DIR:=${AUTOTOOLS_BUILD_DIR:-${WORKDIR}/${P}_build}}
fi
- echo ">>> Working in BUILD_DIR: \"$AUTOTOOLS_BUILD_DIR\""
+
+ # Backwards compatibility.
+ AUTOTOOLS_BUILD_DIR=${BUILD_DIR}
+ echo ">>> Working in BUILD_DIR: \"${BUILD_DIR}\""
}
# @FUNCTION: remove_libtool_files
@@ -413,20 +419,20 @@ autotools-utils_src_configure() {
# Append user args
econfargs+=("${myeconfargs[@]}")
- mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
- pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+ mkdir -p "${BUILD_DIR}" || die
+ pushd "${BUILD_DIR}" > /dev/null || die
econf "${econfargs[@]}" "$@"
popd > /dev/null || die
}
# @FUNCTION: autotools-utils_src_compile
# @DESCRIPTION:
-# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR.
+# The autotools src_compile function, invokes emake in specified BUILD_DIR.
autotools-utils_src_compile() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+ pushd "${BUILD_DIR}" > /dev/null || die
emake "$@" || die 'emake failed'
popd > /dev/null || die
}
@@ -443,7 +449,7 @@ autotools-utils_src_install() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+ pushd "${BUILD_DIR}" > /dev/null || die
emake DESTDIR="${D}" "$@" install || die "emake install failed"
popd > /dev/null || die
@@ -490,7 +496,7 @@ autotools-utils_src_test() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+ pushd "${BUILD_DIR}" > /dev/null || die
# Run default src_test as defined in ebuild.sh
default_src_test
popd > /dev/null || die
--
1.8.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-dev] [PATCH 2/4] autotools-multilib: use and support BUILD_DIR.
2012-11-29 13:40 [gentoo-dev] autotools-utils & cmake-utils: use common BUILD_DIR var Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 1/4] autotools-utils: use common BUILD_DIR variable Michał Górny
@ 2012-11-29 13:40 ` Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 3/4] cmake-utils: support common BUILD_DIR variable Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 4/4] Example conversion of pygobject to python-r1 + autotools-utils Michał Górny
3 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2012-11-29 13:40 UTC (permalink / raw
To: gentoo-dev; +Cc: reavertm, scarabeus, Michał Górny
---
gx86/eclass/autotools-multilib.eclass | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/gx86/eclass/autotools-multilib.eclass b/gx86/eclass/autotools-multilib.eclass
index f6d1feb..541e934 100644
--- a/gx86/eclass/autotools-multilib.eclass
+++ b/gx86/eclass/autotools-multilib.eclass
@@ -38,17 +38,19 @@ IUSE=multilib
# @USAGE: argv...
# @DESCRIPTION:
# If multilib support is enabled, sets the toolchain up for each
-# supported ABI along with the ABI variable and correct
-# AUTOTOOLS_BUILD_DIR, and runs the given commands with them.
+# supported ABI along with the ABI variable and correct BUILD_DIR,
+# and runs the given commands with them.
#
# If multilib support is disabled, it just runs the commands. No setup
# is done.
autotools-multilib_foreach_abi() {
+ local initial_dir=${BUILD_DIR:-${S}}
+
if use multilib; then
local ABI
for ABI in $(get_all_abis); do
multilib_toolchain_setup "${ABI}"
- AUTOTOOLS_BUILD_DIR=${S%%/}-${ABI} "${@}"
+ BUILD_DIR=${initial_dir%%/}-${ABI} "${@}"
done
else
"${@}"
--
1.8.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-dev] [PATCH 3/4] cmake-utils: support common BUILD_DIR variable.
2012-11-29 13:40 [gentoo-dev] autotools-utils & cmake-utils: use common BUILD_DIR var Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 1/4] autotools-utils: use common BUILD_DIR variable Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 2/4] autotools-multilib: use and support BUILD_DIR Michał Górny
@ 2012-11-29 13:40 ` Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 4/4] Example conversion of pygobject to python-r1 + autotools-utils Michał Górny
3 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2012-11-29 13:40 UTC (permalink / raw
To: gentoo-dev; +Cc: reavertm, scarabeus, Michał Górny
---
gx86/eclass/cmake-utils.eclass | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/gx86/eclass/cmake-utils.eclass b/gx86/eclass/cmake-utils.eclass
index 2129ebf..26fc1c1 100644
--- a/gx86/eclass/cmake-utils.eclass
+++ b/gx86/eclass/cmake-utils.eclass
@@ -114,12 +114,15 @@ _use_me_now_inverted() {
fi
}
-# @ECLASS-VARIABLE: CMAKE_BUILD_DIR
+# @ECLASS-VARIABLE: BUILD_DIR
# @DESCRIPTION:
# Build directory where all cmake processed files should be generated.
# For in-source build it's fixed to ${CMAKE_USE_DIR}.
# For out-of-source build it can be overriden, by default it uses
# ${WORKDIR}/${P}_build.
+#
+# This variable has been called CMAKE_BUILD_DIR formerly.
+# It is set under that name for compatibility.
# @ECLASS-VARIABLE: CMAKE_BUILD_TYPE
# @DESCRIPTION:
@@ -163,12 +166,14 @@ _check_build_dir() {
: ${CMAKE_USE_DIR:=${S}}
if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
# we build in source dir
- CMAKE_BUILD_DIR="${CMAKE_USE_DIR}"
+ BUILD_DIR="${CMAKE_USE_DIR}"
else
- : ${CMAKE_BUILD_DIR:=${WORKDIR}/${P}_build}
+ : ${BUILD_DIR:=${CMAKE_BUILD_DIR:-${WORKDIR}/${P}_build}}
fi
- mkdir -p "${CMAKE_BUILD_DIR}"
- echo ">>> Working in BUILD_DIR: \"$CMAKE_BUILD_DIR\""
+ CMAKE_BUILD_DIR=${BUILD_DIR}
+
+ mkdir -p "${BUILD_DIR}"
+ echo ">>> Working in BUILD_DIR: \"$BUILD_DIR\""
}
# Determine which generator to use
@@ -328,7 +333,7 @@ enable_cmake-utils_src_configure() {
fi
# Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.)
- local build_rules=${CMAKE_BUILD_DIR}/gentoo_rules.cmake
+ local build_rules=${BUILD_DIR}/gentoo_rules.cmake
cat > "${build_rules}" <<- _EOF_
SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE)
@@ -364,7 +369,7 @@ enable_cmake-utils_src_configure() {
fi
# Common configure parameters (invariants)
- local common_config=${CMAKE_BUILD_DIR}/gentoo_common_config.cmake
+ local common_config=${BUILD_DIR}/gentoo_common_config.cmake
local libdir=$(get_libdir)
cat > "${common_config}" <<- _EOF_
SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
@@ -396,7 +401,7 @@ enable_cmake-utils_src_configure() {
"${MYCMAKEARGS}"
)
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${BUILD_DIR}" > /dev/null
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}"
echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
"${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"
@@ -418,7 +423,7 @@ cmake-utils_src_make() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${BUILD_DIR}" > /dev/null
if [[ $(_generator_to_use) = Ninja ]]; then
# first check if Makefile exist otherwise die
[[ -e build.ninja ]] || die "Makefile not found. Error during configure stage."
@@ -444,7 +449,7 @@ enable_cmake-utils_src_install() {
debug-print-function ${FUNCNAME} "$@"
_check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${BUILD_DIR}" > /dev/null
if [[ $(_generator_to_use) = Ninja ]]; then
DESTDIR=${D} ninja install "$@" || die "died running ninja install"
base_src_install_docs
@@ -467,7 +472,7 @@ enable_cmake-utils_src_test() {
local ctestargs
_check_build_dir
- pushd "${CMAKE_BUILD_DIR}" > /dev/null
+ pushd "${BUILD_DIR}" > /dev/null
[[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; }
[[ -n ${TEST_VERBOSE} ]] && ctestargs="--extra-verbose --output-on-failure"
@@ -479,13 +484,13 @@ enable_cmake-utils_src_test() {
else
if [[ -n "${CMAKE_YES_I_WANT_TO_SEE_THE_TEST_LOG}" ]] ; then
# on request from Diego
- eerror "Tests failed. Test log ${CMAKE_BUILD_DIR}/Testing/Temporary/LastTest.log follows:"
+ eerror "Tests failed. Test log ${BUILD_DIR}/Testing/Temporary/LastTest.log follows:"
eerror "--START TEST LOG--------------------------------------------------------------"
- cat "${CMAKE_BUILD_DIR}/Testing/Temporary/LastTest.log"
+ cat "${BUILD_DIR}/Testing/Temporary/LastTest.log"
eerror "--END TEST LOG----------------------------------------------------------------"
die "Tests failed."
else
- die "Tests failed. When you file a bug, please attach the following file: \n\t${CMAKE_BUILD_DIR}/Testing/Temporary/LastTest.log"
+ die "Tests failed. When you file a bug, please attach the following file: \n\t${BUILD_DIR}/Testing/Temporary/LastTest.log"
fi
# die might not die due to nonfatal
--
1.8.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-dev] [PATCH 4/4] Example conversion of pygobject to python-r1 + autotools-utils.
2012-11-29 13:40 [gentoo-dev] autotools-utils & cmake-utils: use common BUILD_DIR var Michał Górny
` (2 preceding siblings ...)
2012-11-29 13:40 ` [gentoo-dev] [PATCH 3/4] cmake-utils: support common BUILD_DIR variable Michał Górny
@ 2012-11-29 13:40 ` Michał Górny
2012-11-29 16:50 ` Gilles Dartiguelongue
3 siblings, 1 reply; 7+ messages in thread
From: Michał Górny @ 2012-11-29 13:40 UTC (permalink / raw
To: gentoo-dev; +Cc: reavertm, scarabeus, Michał Górny
---
.../dev-python/pygobject/pygobject-3.2.2-r1.ebuild | 106 +++++++++++++++++++++
1 file changed, 106 insertions(+)
create mode 100644 gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild
diff --git a/gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild b/gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild
new file mode 100644
index 0000000..289eace
--- /dev/null
+++ b/gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/pygobject/pygobject-3.2.2.ebuild,v 1.5 2012/09/28 05:45:45 mattst88 Exp $
+
+EAPI="4"
+GCONF_DEBUG="no"
+PYTHON_COMPAT=( python2_6 python2_7 python3_1 python3_2 )
+AUTOTOOLS_AUTORECONF=1
+
+inherit autotools-utils eutils gnome2 python-r1 virtualx
+
+DESCRIPTION="GLib's GObject library bindings for Python"
+HOMEPAGE="http://www.pygtk.org/"
+
+LICENSE="LGPL-2.1+"
+SLOT="3"
+KEYWORDS="alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="+cairo examples test +threads" # doc
+REQUIRED_USE="test? ( cairo )"
+
+COMMON_DEPEND=">=dev-libs/glib-2.31.0:2
+ >=dev-libs/gobject-introspection-1.31.20
+ virtual/libffi
+ ${PYTHON_DEPS}
+ cairo? ( >=dev-python/pycairo-1.10.0 )"
+DEPEND="${COMMON_DEPEND}
+ test? (
+ dev-libs/atk[introspection]
+ media-fonts/font-cursor-misc
+ media-fonts/font-misc-misc
+ x11-libs/gdk-pixbuf:2[introspection]
+ x11-libs/gtk+:3[introspection]
+ x11-libs/pango[introspection] )
+ virtual/pkgconfig"
+# docs disabled for now per upstream default since they are very out of date
+# doc? (
+# app-text/docbook-xml-dtd:4.1.2
+# dev-libs/libxslt
+# >=app-text/docbook-xsl-stylesheets-1.70.1 )
+
+#RESTRICT=test
+
+# We now disable introspection support in slot 2 per upstream recommendation
+# (see https://bugzilla.gnome.org/show_bug.cgi?id=642048#c9); however,
+# older versions of slot 2 installed their own site-packages/gi, and
+# slot 3 will collide with them.
+RDEPEND="${COMMON_DEPEND}
+ !<dev-python/pygtk-2.13
+ !<dev-python/pygobject-2.28.6-r50:2[introspection]"
+
+src_prepare() {
+ PATCHES=(
+ "${FILESDIR}/${PN}-2.90.1-make_check.patch"
+ )
+
+ autotools-utils_src_prepare
+
+ gnome2_environment_reset
+ gnome2_omf_fix
+}
+
+src_configure() {
+ # Hard-enable libffi support since both gobject-introspection and
+ # glib-2.29.x rdepend on it anyway
+ local myeconfargs=(
+ --disable-dependency-tracking
+ --with-ffi
+ $(use_enable cairo)
+ $(use_enable threads thread)
+ )
+
+ python_foreach_impl autotools-utils_src_configure
+}
+
+src_compile() {
+ python_foreach_impl autotools-utils_src_compile
+}
+
+python_test() {
+ local XDG_CACHE_DIR=${T}/${EPYTHON}
+ autotools-utils_src_compile check PYTHON="${PYTHON}"
+}
+
+# FIXME: With python multiple ABI support, tests return 1 even when they pass
+src_test() {
+ local DBUS_SESSION_BUS_ADDRESS
+ local GIO_USE_VFS='local' # prevents odd issues with deleting ${T}/.gvfs
+ local VIRTUALX_COMMAND=python_test
+
+ export GIO_USE_VFS
+
+ python_foreach_impl virtualmake
+
+ python_execute_function -s testing
+}
+
+src_install() {
+ python_foreach_impl autotools-utils_src_install
+
+ dodoc AUTHORS ChangeLog* NEWS README || die
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ fi
+}
--
1.8.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [gentoo-dev] [PATCH 4/4] Example conversion of pygobject to python-r1 + autotools-utils.
2012-11-29 13:40 ` [gentoo-dev] [PATCH 4/4] Example conversion of pygobject to python-r1 + autotools-utils Michał Górny
@ 2012-11-29 16:50 ` Gilles Dartiguelongue
2012-11-29 17:53 ` Michał Górny
0 siblings, 1 reply; 7+ messages in thread
From: Gilles Dartiguelongue @ 2012-11-29 16:50 UTC (permalink / raw
To: gentoo-dev
First, thanks for this patch, I was planning on converting it but did
not have to do it.
Le jeudi 29 novembre 2012 à 14:40 +0100, Michał Górny a écrit :
> ---
> .../dev-python/pygobject/pygobject-3.2.2-r1.ebuild | 106 +++++++++++++++++++++
> 1 file changed, 106 insertions(+)
> create mode 100644 gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild
>
> diff --git a/gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild b/gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild
> new file mode 100644
> index 0000000..289eace
> --- /dev/null
> +++ b/gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild
> @@ -0,0 +1,106 @@
> +# Copyright 1999-2012 Gentoo Foundation
> +# Distributed under the terms of the GNU General Public License v2
> +# $Header: /var/cvsroot/gentoo-x86/dev-python/pygobject/pygobject-3.2.2.ebuild,v 1.5 2012/09/28 05:45:45 mattst88 Exp $
> +
> +EAPI="4"
> +GCONF_DEBUG="no"
> +PYTHON_COMPAT=( python2_6 python2_7 python3_1 python3_2 )
> +AUTOTOOLS_AUTORECONF=1
> +
> +inherit autotools-utils eutils gnome2 python-r1 virtualx
Please do not mix autotools utils with gnome2 eclass. gnome team does
not support out of tree builds for now. I have plans to integrate this
in the eclass but we found that upstream generally does not test this so
we want to test it more extensively before making this available.
> +# FIXME: With python multiple ABI support, tests return 1 even when they pass
> +src_test() {
> + local DBUS_SESSION_BUS_ADDRESS
> + local GIO_USE_VFS='local' # prevents odd issues with deleting ${T}/.gvfs
> + local VIRTUALX_COMMAND=python_test
> +
> + export GIO_USE_VFS
> +
> + python_foreach_impl virtualmake
> +
> + python_execute_function -s testing
> +}
> +
dbus variables needs to be unset for tests to work when you do your
builds from a terminal started from your desktop, is that really
equivalent ?
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-dev] [PATCH 4/4] Example conversion of pygobject to python-r1 + autotools-utils.
2012-11-29 16:50 ` Gilles Dartiguelongue
@ 2012-11-29 17:53 ` Michał Górny
0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2012-11-29 17:53 UTC (permalink / raw
To: gentoo-dev; +Cc: eva
[-- Attachment #1.1: Type: text/plain, Size: 3197 bytes --]
On Thu, 29 Nov 2012 17:50:28 +0100
Gilles Dartiguelongue <eva@gentoo.org> wrote:
> First, thanks for this patch, I was planning on converting it but did
> not have to do it.
Well, the patch was on the ml a while ago but it was reply to one
of the mails, so it was hard to notice it.
> Le jeudi 29 novembre 2012 à 14:40 +0100, Michał Górny a écrit :
> > ---
> > .../dev-python/pygobject/pygobject-3.2.2-r1.ebuild | 106 +++++++++++++++++++++
> > 1 file changed, 106 insertions(+)
> > create mode 100644 gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild
> >
> > diff --git a/gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild b/gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild
> > new file mode 100644
> > index 0000000..289eace
> > --- /dev/null
> > +++ b/gx86/dev-python/pygobject/pygobject-3.2.2-r1.ebuild
> > @@ -0,0 +1,106 @@
> > +# Copyright 1999-2012 Gentoo Foundation
> > +# Distributed under the terms of the GNU General Public License v2
> > +# $Header: /var/cvsroot/gentoo-x86/dev-python/pygobject/pygobject-3.2.2.ebuild,v 1.5 2012/09/28 05:45:45 mattst88 Exp $
> > +
> > +EAPI="4"
> > +GCONF_DEBUG="no"
> > +PYTHON_COMPAT=( python2_6 python2_7 python3_1 python3_2 )
> > +AUTOTOOLS_AUTORECONF=1
> > +
> > +inherit autotools-utils eutils gnome2 python-r1 virtualx
>
> Please do not mix autotools utils with gnome2 eclass. gnome team does
> not support out of tree builds for now. I have plans to integrate this
> in the eclass but we found that upstream generally does not test this so
> we want to test it more extensively before making this available.
Well, the main purpose of this patch was to demonstrate using
out-of-source builds with python-r1.
Therefore, I ask thee: is it acceptable then to use gnome2-utils
in the eclass or shall I restrain completely from using out-of-source
builds on that package?
One thing I can assure you is that this package supports them.
> > +# FIXME: With python multiple ABI support, tests return 1 even when they pass
> > +src_test() {
> > + local DBUS_SESSION_BUS_ADDRESS
> > + local GIO_USE_VFS='local' # prevents odd issues with deleting ${T}/.gvfs
> > + local VIRTUALX_COMMAND=python_test
> > +
> > + export GIO_USE_VFS
> > +
> > + python_foreach_impl virtualmake
> > +
> > + python_execute_function -s testing
> > +}
> > +
> dbus variables needs to be unset for tests to work when you do your
> builds from a terminal started from your desktop, is that really
> equivalent ?
You are correct that it isn't. I wrote the patch before I actually
noticed how crazy local+export logic works. We need to re-export
DBUS_SESSION_BUS_ADDRESS here. Also, I forgot
to remove python_execute_function... silly.
After doing those two changes, the tests succeed for me
with DBUS_SESSION_BUS_ADDRESS set in the parent env.
To be more correct, they succeed for py2.7, 3.1 & 3.2.
In python2.6 they fail with:
@unittest.expectedFailure
AttributeError: 'module' object has no attribute 'expectedFailure'
But that's another story.
I'd say that the ebuild works 100% fine in the version I'm attaching
to this mail.
--
Best regards,
Michał Górny
[-- Attachment #1.2: pygobject-3.2.2-r1.ebuild --]
[-- Type: text/plain, Size: 3001 bytes --]
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/pygobject/pygobject-3.2.2.ebuild,v 1.5 2012/09/28 05:45:45 mattst88 Exp $
EAPI="4"
GCONF_DEBUG="no"
PYTHON_COMPAT=( python2_6 python2_7 python3_1 python3_2 )
AUTOTOOLS_AUTORECONF=1
inherit autotools-utils eutils gnome2 python-r1 virtualx
DESCRIPTION="GLib's GObject library bindings for Python"
HOMEPAGE="http://www.pygtk.org/"
LICENSE="LGPL-2.1+"
SLOT="3"
KEYWORDS="alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="+cairo examples test +threads" # doc
REQUIRED_USE="test? ( cairo )"
COMMON_DEPEND=">=dev-libs/glib-2.31.0:2
>=dev-libs/gobject-introspection-1.31.20
virtual/libffi
${PYTHON_DEPS}
cairo? ( >=dev-python/pycairo-1.10.0 )"
DEPEND="${COMMON_DEPEND}
test? (
dev-libs/atk[introspection]
media-fonts/font-cursor-misc
media-fonts/font-misc-misc
x11-libs/gdk-pixbuf:2[introspection]
x11-libs/gtk+:3[introspection]
x11-libs/pango[introspection] )
virtual/pkgconfig"
# docs disabled for now per upstream default since they are very out of date
# doc? (
# app-text/docbook-xml-dtd:4.1.2
# dev-libs/libxslt
# >=app-text/docbook-xsl-stylesheets-1.70.1 )
#RESTRICT=test
# We now disable introspection support in slot 2 per upstream recommendation
# (see https://bugzilla.gnome.org/show_bug.cgi?id=642048#c9); however,
# older versions of slot 2 installed their own site-packages/gi, and
# slot 3 will collide with them.
RDEPEND="${COMMON_DEPEND}
!<dev-python/pygtk-2.13
!<dev-python/pygobject-2.28.6-r50:2[introspection]"
src_prepare() {
PATCHES=(
"${FILESDIR}/${PN}-2.90.1-make_check.patch"
)
autotools-utils_src_prepare
gnome2_environment_reset
gnome2_omf_fix
}
src_configure() {
# Hard-enable libffi support since both gobject-introspection and
# glib-2.29.x rdepend on it anyway
local myeconfargs=(
--disable-dependency-tracking
--with-ffi
$(use_enable cairo)
$(use_enable threads thread)
)
python_foreach_impl autotools-utils_src_configure
}
src_compile() {
python_foreach_impl autotools-utils_src_compile
}
python_test() {
local XDG_CACHE_DIR=${T}/${EPYTHON}
autotools-utils_src_compile check PYTHON="${PYTHON}"
}
# FIXME: With python multiple ABI support, tests return 1 even when they pass
src_test() {
local DBUS_SESSION_BUS_ADDRESS
local GIO_USE_VFS='local' # prevents odd issues with deleting ${T}/.gvfs
local VIRTUALX_COMMAND=python_test
export DBUS_SESSION_BUS_ADDRESS GIO_USE_VFS
python_foreach_impl virtualmake
}
src_install() {
python_foreach_impl autotools-utils_src_install
dodoc AUTHORS ChangeLog* NEWS README || die
if use examples; then
insinto /usr/share/doc/${PF}
doins -r examples
fi
}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-11-29 17:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-29 13:40 [gentoo-dev] autotools-utils & cmake-utils: use common BUILD_DIR var Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 1/4] autotools-utils: use common BUILD_DIR variable Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 2/4] autotools-multilib: use and support BUILD_DIR Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 3/4] cmake-utils: support common BUILD_DIR variable Michał Górny
2012-11-29 13:40 ` [gentoo-dev] [PATCH 4/4] Example conversion of pygobject to python-r1 + autotools-utils Michał Górny
2012-11-29 16:50 ` Gilles Dartiguelongue
2012-11-29 17:53 ` 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