Permalink
Browse files

Attempt at migrating numpy-1.7.0 to new python eclass do not run the …

…tests, they are likely broken at this stage.

Package-Manager: portage-2.2.0_alpha149
  • Loading branch information...
1 parent c8ab2c1 commit af15944e51e26237a8c6e23e0e0a6d8171c48a36 @kiwifb kiwifb committed Dec 17, 2012
@@ -2,6 +2,12 @@
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/numpy/ChangeLog,v 1.157 2012/05/04 15:12:15 patrick Exp $
+*numpy-1.7.0_pre20121217-r1 (17 Dec 2012)
+
+ 17 Dec 2012; François Bissey <francois.bissey@canterbury.ac.nz>
+ -numpy-1.7.0_pre20121217.ebuild, +numpy-1.7.0_pre20121217-r1.ebuild:
+ Try moving numpy-1.7 to new python eclass
+
*numpy-1.7.0_pre20121217 (17 Dec 2012)
17 Dec 2012; François Bissey <francois.bissey@canterbury.ac.nz>
@@ -15,6 +15,6 @@ DIST numpy-1.6.0-ref.pdf 6106335 SHA256 cbeea9b1395e0576bbd256c5de11886c63321d43
DIST numpy-1.6.0-user.pdf 20021 SHA256 d5f157b19585d4db6aa170573e6b41c70d075097221e5e6ba928a16233f5db24 SHA512 63a5e68de8db10fd0eb1e6ff1c06cd772a288c677616cc2055a750e8805e7a4be9d5caed5b2303d09be66cf87842baa062bf6b44740146d2a02f4129e4934bfc WHIRLPOOL ca728169b1f2fa5ee0187893d42db17e3e1733fae1e1b4ec73bafefd683222051e01fd3e3e03b58cd1eb5115693f61f34670c777f003266c899ae11107d97c5e
DIST numpy-c4c169c7cb32075386bd03463a908035c655784b.tar.gz 4806486 SHA256 23665e3c4f8d61a44de8306e8c5a6af45ef8bf3ee297782e4f84fb68fcf4b73e SHA512 aa06344eadf042cfdd4fbcc2a670769aee44be14a84737af184508d8e327b76278e0d1d768da482719b0c81ff2dbd59a31f9fdfc2b3c7b4f5e6a359bb42aab4c WHIRLPOOL 0a9736603ac58e43052e212db800a0a717a8410465d80703265508d68bfbdae159cb6f18d891b758fe3c73671fa4bdb9169c93ee07e2a55d5c31aba6a05875d4
EBUILD numpy-1.5.1.ebuild 5381 SHA256 e498ce9e5155b89d88fb3bd8e73413c1ac790cf421ecea02bb7351e031d6efe6 SHA512 c58a5a2dade2ea25a06ce776dc98b92d232923984775ddf77cee7120584a72414fa123d89c9ba562cc2e50dc1d731cb5269267eb724d90cfb8c170d3fa7d7880 WHIRLPOOL 1b5bb57e67e65393eb4f80f90fcc39b09b4f16c606ada864b0bfa2ebbe5a9d5d1bc9585f7bc072dd153fe13a33cba5e8a486d5746fb20f8abb9947ecd961838c
-EBUILD numpy-1.7.0_pre20121217.ebuild 4241 SHA256 5633bedf01ed42295f5a5bd8d314389de2def0a75f5a0e91d586659b4bf1ccd3 SHA512 94c98ce3c81edf9b5db78e634da49ced36f064789ab229b8bd230fdd3d189d8985e168d7231e9d6977dd4aff20893ece5bb9591ee4215ac7f972a3677b3b5ef3 WHIRLPOOL 03e45e0a895f5b3c67dcec147b690d92e95eaf37f2457dac8046ed499310a566bb927a4601f2ca72c635f5d56155497be7c70817df7c25b9581c3f6834e049b8
-MISC ChangeLog 23098 SHA256 c6e6c23afe68af071218c6e8a7b9af74dec8006595d57377dad3986f04893e65 SHA512 aa320b6a385e83945ba08fb2939595ced9c64f2fbd4df687c153d328c76fe3a36f3f500b33884699243d06b386be88e3befc64e24eb17cdd4667fbe6a574afa7 WHIRLPOOL 19592c83f9fab3a4ca2c22b14d6f4455acf64e0122be71921a5cf73bea62831c0df30f0d9ea5db9a22d78a96c62909ccc6f2812aec3f4a32d54b1a219b51cc16
+EBUILD numpy-1.7.0_pre20121217-r1.ebuild 4303 SHA256 17a3308a438ccd4acc17b8321077638c836d5b05858d9b9d6afbffbdb4d08fe0 SHA512 dff1b1c2a05066af545128f43b78de91a968392231972ee902a4395ce1fefb9a509b8f7092be35330d46bf16daf1ea45a527e4eb2be00eb5f0f30413e15fea21 WHIRLPOOL 1ea9588c51b391e354b27a7d8e947de11feaebc5e89fcaab3b166e01a6ecd40cebcdd7ade574f5f666921af6fd9bb61dfe7998d6da119f44d5746edb3b49ab91
+MISC ChangeLog 23324 SHA256 4786dcadbd88b4b0797e079bc71f7285db8f9b4bf6ea54c50d52ffec39017ac6 SHA512 586094a07431100abf5b5fa369216573bf05d08516ef77a46c315af033093a6f69e274d2b3401df915b74ad5b6f84c5c3d541dc441ec17c99078e7193f01d32a WHIRLPOOL 947d920e9daded8dbdcc23be51c9e2c196a6b60dd7bc58d1642ffd754acb9cd2a4f7377dd9997918aad71e2d7eb7f9a679af9e469bb01e0fdc49d938778c53e2
MISC metadata.xml 615 SHA256 f50bbda17ece7ce10e62c739225822877af67a95b3fb9b6a861ee31db489cab3 SHA512 ffe2529b21b7a5ae0e201e735680603653fe32b2426a2c5cefe22409e4116e32d9e3ab3684192fa56f03e269bcc9ff333a511c0b5499246195c9a011b5779db0 WHIRLPOOL 6b43f449e642d51c693dbcb1c09af5e11dde1959c692073b8e7b366c61746e980ac966eede3ac7cc2cdbf7b7f41a092f8bdbe604cd5f477a7e6a43fc4129e2f7
@@ -4,13 +4,11 @@
EAPI=4
-PYTHON_DEPEND="*::3.2"
-SUPPORT_PYTHON_ABIS="1"
-RESTRICT_PYTHON_ABIS="3.3 *-jython *-pypy-*"
+PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2} )
FORTRAN_NEEDED=lapack
-inherit distutils eutils flag-o-matic fortran-2 toolchain-funcs versionator
+inherit distutils-r1 multilib eutils flag-o-matic fortran-2 toolchain-funcs versionator
DOC_P="${PN}-1.6.0"
GITTAG="c4c169c7cb32075386bd03463a908035c655784b"
@@ -31,25 +29,30 @@ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86
IUSE="doc lapack test"
RDEPEND="
- dev-python/setuptools
+ ${PYTHON_DEPS}
@cschwan

cschwan Dec 18, 2012

Owner

Thats not needed. From distutils-r1' eclass manpage:

Please note that distutils-r1 sets RDEPEND and DEPEND unconditionally for you.

@kiwifb

kiwifb Dec 18, 2012

Collaborator

Indeed, may be the documentation for python-r1 should mention it is not necessary in that case - not really under our control but that's why I did it.

@cschwan

cschwan Dec 18, 2012

Owner

Yeah, the docs could be better.

+ dev-python/setuptools[${PYTHON_USEDEP}]
lapack? ( virtual/cblas virtual/lapack )"
DEPEND="${RDEPEND}
doc? ( app-arch/unzip )
lapack? ( virtual/pkgconfig )
- test? ( >=dev-python/nose-0.10 )"
+ test? ( >=dev-python/nose-0.10[${PYTHON_USEDEP}] )"
PYTHON_CFLAGS=("* + -fno-strict-aliasing")
# Build system installs f2py${Python_version} scripts.
PYTHON_NONVERSIONED_EXECUTABLES=("/usr/bin/f2py[[:digit:]]+\.[[:digit:]]+")
-DOCS="COMPATIBILITY DEV_README.txt THANKS.txt"
+PATCHES=(
+ # ATLAS patch
+ "${FILESDIR}"/${PN}-1.7.0-atlas.patch
+ )
+
+DOCS=( COMPATIBILITY DEV_README.txt THANKS.txt )
S="${WORKDIR}/${MY_P}"
pkg_setup() {
fortran-2_pkg_setup
- python_pkg_setup
# See progress in http://projects.scipy.org/scipy/numpy/ticket/573
# with the subtle difference that we don't want to break Darwin where
@@ -93,8 +96,6 @@ pc_libs() {
}
src_prepare() {
@cschwan

cschwan Dec 18, 2012

Owner

src_prepare should be called python_prepare_all

@kiwifb

kiwifb Dec 18, 2012

Collaborator

that's new to me. I suppose the goal is for it to be called during a normal prepare phase that is overriden by distutils-r1?

@cschwan

cschwan Dec 18, 2012

Owner

Right, as with python_install / python_install_all there are also python_prepare (for each python version) and python_prepare_all (only once for the whole source tree). See also my updated comment below.

- epatch "${FILESDIR}"/${PN}-1.7.0-atlas.patch
-
if use lapack; then
append-ldflags "$(pkg-config --libs-only-other cblas lapack)"
local libdir="${EPREFIX}"/usr/$(get_libdir)
@@ -114,10 +115,11 @@ src_prepare() {
fi
export CC="$(tc-getCC) ${CFLAGS}"
+ distutils-r1_python_prepare_all
}
src_compile() {
- distutils_src_compile ${NUMPY_FCONFIG}
+ distutils-r1_src_compile ${NUMPY_FCONFIG}
@cschwan

cschwan Dec 18, 2012

Owner

Instead passing ${NUMPY_FCONFIG} to distutils-r1_src_compile I think you could use the mydistutilsargs array instead.

@kiwifb

kiwifb Dec 18, 2012

Collaborator

I think that's the thing to do to, I ran a bit out of time there.

}
src_test() {
@@ -130,24 +132,24 @@ src_test() {
popd > /dev/null
rm -fr test-${PYTHON_ABI}
}
- python_execute_function testing
+ python_foreach_impl testing
}
src_install() {
@cschwan

cschwan Dec 18, 2012

Owner

src_install could be split into python_install and python_install_all. Thereby you prevent using python_foreach_impl and the local function.

@kiwifb

kiwifb Dec 18, 2012

Collaborator

I found the doc quite confusing on that point. Do you have a pointer to an ebuild where it is done and not trivial?

@cschwan

cschwan Dec 18, 2012

Owner

I think dev-python/epydoc-3.0.1-r2 is a quite good example. Note that python_install is called for each python version and python_install_all only once. The same is true for python_prepare and python_prepare_all.

@kiwifb

kiwifb Dec 18, 2012

Collaborator

My head hurts but I think I get it. I wish it wasn't necessary to read the code for several eclass to figure it out. Actually there are two things left over that annoyed me. PYTHON_CFLAGS and PYTHON_NONVERSIONED_EXECUTABLES, after looking long and hard at the doc and the eclass I am still not completely sure how the later is working. I am not sure if the former is specifically for setup.py in this package or part of an eclass - haven't had all the time I wanted to comb the eclass concerned. I also have no clue how to translate them to the new eclass.

@cschwan

cschwan Dec 18, 2012

Owner

Me neither. My first idea would be to prevent the things in PYTHON_NONVERSIONED_EXECUTABLES be installed with python_install and install them finally within python_install_all. Not sure if this is possible, however. I will take a look at that later.

- distutils_src_install ${NUMPY_FCONFIG}
+ distutils-r1_src_install ${NUMPY_FCONFIG}
delete_txt() {
rm -f "${ED}"$(python_get_sitedir)/numpy/*.txt
}
- python_execute_function -q delete_txt
+ python_foreach_impl delete_txt
docinto f2py
dodoc numpy/f2py/docs/*.txt
doman numpy/f2py/f2py.1
if use doc; then
insinto /usr/share/doc/${PF}
- doins -r "${WORKDIR}"/html
- doins "${DISTDIR}"/${DOC_P}*pdf
+ doins -r "${WORKDIR}"/html || die
+ doins "${DISTDIR}"/${NP}*pdf || die
fi
}

1 comment on commit af15944

Owner

cschwan commented on af15944 Dec 18, 2012

I added some suggestions in the code.

Please sign in to comment.