Mail archive
alpine-aports

Re: [alpine-aports] [PATCH] testing/py-matplotlib: Update to 2.2.2, py3 support

From: Leonardo Arena <rnalrd_at_gmail.com>
Date: Mon, 15 Oct 2018 08:22:21 +0200

Hi,

sorry for the late feedback.

Please see some comments below:

On Mon, May 21, 2018 at 11:33 PM Marian Buschsieweke <
marian.buschsieweke_at_ovgu.de> wrote:

> Added subpackages py2-matplotlib and py3-matplotlib, which provide the
> python2
> and python3 version of matplotlib.
> ---
> testing/py-matplotlib/APKBUILD | 59 ++++++++++++++++++++++------------
> 1 file changed, 39 insertions(+), 20 deletions(-)
>
> diff --git a/testing/py-matplotlib/APKBUILD
> b/testing/py-matplotlib/APKBUILD
> index 45e057e3f6..d71994b560 100644
> --- a/testing/py-matplotlib/APKBUILD
> +++ b/testing/py-matplotlib/APKBUILD
> _at__at_ -2,42 +2,61 @@
> # Maintainer: Isaac Dunham <ibid.ag_at_gmail.com>
> pkgname=py-matplotlib
> _pkgname=matplotlib
> -pkgver=1.5.1
> -pkgrel=2
> +pkgver=2.2.2
> +pkgrel=0
> pkgdesc="A Python library for plots"
> url="http://matplotlib.org"
> arch="all !s390x"
> license="custom"
>


I think the licence needs to be adjusted.



> -depends="python2 py-numpy python2-tkinter py-dateutil py-parsing py-tz
> py-cycler"
> -makedepends="python2-dev gfortran py-numpy-dev freetype-dev libpng-dev
> tk-dev
> - py-setuptools"
> -subpackages="$pkgname-doc $pkgname-tests"
> +depends=""
> +_depends_py2="python2 py2-numpy python2-tkinter py2-dateutil py2-parsing
> py2-tz
> + py2-cycler py2-cairo py2-kiwisolver"
> +_depends_py3="python3 py3-numpy python3-tkinter py3-dateutil py3-parsing
> py3-tz
> + py3-cycler py3-cairo py3-kiwisolver"
>

We use to specify unversioned dependencies in "depends" and then in the
respective subpackage we do a variable substitution for each python version:

depends="${depends//py-/py2-}"
depends="${depends//py-/py3-}"

+makedepends="python3-dev python2-dev gfortran py-numpy-dev freetype-dev
> + libpng-dev tk-dev py-setuptools ${_depends_py2} ${_depends_py3}
> + py2-backports_functools_lru_cache"
> +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3
> + $pkgname-doc"
> source="$_pkgname-$pkgver.tar.gz::
> https://github.com/matplotlib/$_pkgname/archive/v$pkgver.tar.gz"
> builddir="$srcdir/$_pkgname-$pkgver"
>
> build() {
> cd "$builddir"
> python2 setup.py build || return 1
> + python3 setup.py build || return 1
> }
>

"|| return 1" can be removed nowdays.



>
> package() {
> - cd "$builddir"
> + mkdir -p "$pkgdir"
> +}
> +
> +_py2() {
> + replaces="$pkgname"
> + depends="$depends $_depends_py2"
> + _py python2
> +}
>
> - python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
> - install -m755 -d "$pkgdir"/usr/share/licenses/custom/$pkgname
> - install -m644 LICENSE/*
> "$pkgdir"/usr/share/licenses/custom/$pkgname/
> +_py3() {
> + depends="$depends $_depends_py3"
> + _py python3
> + # Remove documentation, doc-subpkg will use python2 version
> + rm -rf "$subpkgdir/usr/share"
> }
>
> -tests() {
> - pkgdesc="$pkgdesc (tests)"
> - arch="noarch"
> - depends="$depends py-nose"
> - local sitepath="$(python2 -c 'import site;
> print(site.getsitepackages()[0])')/$_pkgname"
> +doc() {
> + mkdir -p "${subpkgdir}/usr"
> + mv "${pkgdir}/../py2-$_pkgname/usr/share" "$subpkgdir/usr/"
> +}
> +
> +_py() {
> + local python="$1"
> + pkgdesc="$pkgdesc (for $python)"
> + cd "$builddir"
>
> - mkdir -p "$subpkgdir"$sitepath
> - mv "$pkgdir"$sitepath/tests "$subpkgdir"$sitepath/
> + $python setup.py install --prefix=/usr --root="$subpkgdir" ||
> return 1
> + install -m755 -d "$subpkgdir"/usr/share/licenses/custom/$subpkgname
> + install -m644 LICENSE/*
> "$subpkgdir"/usr/share/licenses/custom/$subpkgname/
> }
>
>
Doesn't look like there are tests enabled nor disabled.

Thanks!

/eo



---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon Oct 15 2018 - 08:22:21 UTC