X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) by lists.alpinelinux.org (Postfix) with ESMTP id 3E54A5C5412 for ; Sun, 7 May 2017 16:59:32 +0000 (GMT) Received: from cotinga.riseup.net (unknown [10.0.1.164]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 073FF1A0961 for ; Sun, 7 May 2017 16:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1494176372; bh=jGD38Hzjla3icmmf/qkAUHufnZIO50oQwg4C6fBhwZI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KSZ6M5ql3DkQlmvVNYasS9dN39FwDiNV0ihgluAvYwxJV9Bn/SXb+4+FMq811r62n vkjPYWuciAxEnaUzwEOmzl8VCSX94LVjVKcXy5u8bUHOQ2+nQlqxihORT+27Yxn9hP L9krhmANNHeEJf8Hf9nAOLBDa0XzbJRP2OMCfJxM= Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: pickfire@riseup.net) by (cotinga) with ESMTPSA id 1B5084AC5C From: Ivan Tham To: alpine-aports@lists.alpinelinux.org Subject: [alpine-aports] [PATCH 7/8] testing/py-matplotlib: Add support for python3 Date: Mon, 8 May 2017 00:59:14 +0800 Message-Id: <20170507165915.27204-7-pickfire@riseup.net> In-Reply-To: <20170507165915.27204-1-pickfire@riseup.net> References: <20170507165915.27204-1-pickfire@riseup.net> X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: --- testing/py-matplotlib/APKBUILD | 63 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 12 deletions(-) diff --git a/testing/py-matplotlib/APKBUILD b/testing/py-matplotlib/APKBUILD index 36cff4233c..8f8ebe469d 100644 --- a/testing/py-matplotlib/APKBUILD +++ b/testing/py-matplotlib/APKBUILD @@ -8,34 +8,73 @@ pkgdesc="A Python library for plots" url="http://matplotlib.org" arch="all" license="custom" -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="py-numpy py-dateutil py-parsing py-tz py-cycler" +makedepends="gfortran py-numpy-dev freetype-dev libpng-dev tk-dev + python2-dev python3-dev py-setuptools" +subpackages="py2-$_pkgname:_py2 py3-$_pkgname:_py3 $pkgname-doc + py2-$_pkgname-tests:_py2t:noarch py3-$_pkgname-tests:_py3t:noarch" 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 +} + +check() { + cd "$builddir" + python2 setup.py check || return 1 + python3 setup.py check || return 1 } package() { + mkdir -p "$pkgdir" + install -m755 -d "$pkgdir"-doc/usr/share/licenses/custom/$pkgname + install -m644 "$builddir"/LICENSE/* \ + "$pkgdir"-doc/usr/share/licenses/custom/$pkgname/ +} + +_py() { + local python="$1" + pkgdesc="$pkgdesc (for $python)" + depends="$depends $python" + install_if="$pkgname=$pkgver-r$pkgrel $python" + cd "$builddir" + $python setup.py install --prefix=/usr --root="$subpkgdir" || return 1 +} - 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/ +_py2() { + replace="$pkgname" + depends="${depends//py-/py2-} python2-tkinter" + _py python2 } -tests() { - pkgdesc="$pkgdesc (tests)" - arch="noarch" +_py3() { + depends="${depends//py-/py3-} python3-tkinter" + _py python3 +} + +_tests() { + local python="$1" + local sitepath="$($python -c 'import site; print(site.getsitepackages()[0])')/$_pkgname" + + pkgdesc="$pkgdesc ($python tests)" depends="$depends py-nose" - local sitepath="$(python2 -c 'import site; print(site.getsitepackages()[0])')/$_pkgname" mkdir -p "$subpkgdir"$sitepath - mv "$pkgdir"$sitepath/tests "$subpkgdir"$sitepath/ + mv "${subpkgdir%-tests}"$sitepath/tests "$subpkgdir"$sitepath/ +} + +_py2t() { + depends="${depends//py-/py2-} py2-nose" + _tests python2 +} + +_py3t() { + depends="${depends//py-/py3-} py3-nose" + _tests python3 } md5sums="b22dc4962f36aab919a7125b3b35953b matplotlib-1.5.1.tar.gz" -- 2.12.2 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---