added package python-matplotlib
This commit is contained in:
126
mingw-w64-python-matplotlib/PKGBUILD
Normal file
126
mingw-w64-python-matplotlib/PKGBUILD
Normal file
@@ -0,0 +1,126 @@
|
||||
# Contributor: Runar Tenfjord < runar dot tenfjord at gmail dot com >
|
||||
|
||||
_pkgname=matplotlib
|
||||
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-$_pkgname" "${MINGW_PACKAGE_PREFIX}-python3-$_pkgname")
|
||||
pkgver=1.4.0
|
||||
pkgrel=2
|
||||
pkgdesc="A python plotting library, making publication quality plots"
|
||||
arch=('i686' 'x86_64')
|
||||
url='http://matplotlib.org'
|
||||
license=('custom')
|
||||
makedepends=(
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-pytz"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-pytz"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-numpy"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-numpy"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-cairo"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-cairo"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-pyqt5"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-pyqt5"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-dateutil"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-dateutil"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-pyparsing"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-pyparsing"
|
||||
)
|
||||
source=("matplotlib-1.4.0.tar.gz") # "https://github.com/matplotlib/matplotlib/archive/v$pkgver.tar.gz")
|
||||
md5sums=('fe5e319b85df48cbfe2e8f3d1a9c60f0')
|
||||
|
||||
prepare() {
|
||||
cp -a $_pkgname-$pkgver $_pkgname-py2-$pkgver
|
||||
cp -a $_pkgname-$pkgver $_pkgname-py3-$pkgver
|
||||
|
||||
cd ${srcdir}/$_pkgname-py3-$pkgver
|
||||
# remove cairo which fails for python3
|
||||
sed -i 's/setupext\.BackendGtk3Cairo/#setupext\.BackendGtk3Cairo/g' setup.py
|
||||
sed -i 's/setupext\.BackendCairo/#setupext\.BackendCairo/g' setup.py
|
||||
|
||||
cd ${srcdir}/$_pkgname-py2-$pkgver
|
||||
sed -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
|
||||
-e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
|
||||
-e "s|#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
|
||||
-i $(find . -name '*.py')
|
||||
}
|
||||
|
||||
build() {
|
||||
cd ${srcdir}/$_pkgname-py3-$pkgver
|
||||
|
||||
# can not find freetype2 in a clean way
|
||||
if [ -d /mingw64/include/freetype2 ]; then
|
||||
cp -a /mingw64/include/freetype2/* extern/
|
||||
fi
|
||||
|
||||
if [ -d /mingw32/include/freetype2 ]; then
|
||||
cp -a /mingw32/include/freetype2/* extern/
|
||||
fi
|
||||
|
||||
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
||||
${MINGW_PREFIX}/bin/python3 setup.py build
|
||||
|
||||
cd ${srcdir}/$_pkgname-py2-$pkgver
|
||||
|
||||
# can not find freetype2 in a clean way
|
||||
if [ -d /mingw64/include/freetype2 ]; then
|
||||
cp -a /mingw64/include/freetype2/* extern/
|
||||
fi
|
||||
|
||||
if [ -d /mingw32/include/freetype2 ]; then
|
||||
cp -a /mingw32/include/freetype2/* extern/
|
||||
fi
|
||||
|
||||
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
||||
${MINGW_PREFIX}/bin/python2 setup.py build
|
||||
}
|
||||
|
||||
package_python3-matplotlib() {
|
||||
depends=(
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-pytz"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-numpy"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-cairo"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-pyqt5"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-dateutil"
|
||||
"${MINGW_PACKAGE_PREFIX}-python3-pyparsing"
|
||||
)
|
||||
cd ${srcdir}/$_pkgname-py3-$pkgver
|
||||
|
||||
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
||||
${MINGW_PREFIX}/bin/python3 setup.py install -O1 --skip-build \
|
||||
--root "${pkgdir}" --prefix=${MINGW_PREFIX}
|
||||
|
||||
install -dm755 "${pkgdir}"/usr/share/licenses/python-matplotlib
|
||||
install -m 644 doc/users/license.rst "${pkgdir}"/usr/share/licenses/python-matplotlib
|
||||
}
|
||||
|
||||
package_python2-matplotlib() {
|
||||
depends=(
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-pytz"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-numpy"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-cairo"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-pyqt5"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-dateutil"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-pyparsing"
|
||||
)
|
||||
cd ${srcdir}/$_pkgname-py2-$pkgver
|
||||
|
||||
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
||||
${MINGW_PREFIX}/bin/python2 setup.py install -O1 --skip-build \
|
||||
--root "${pkgdir}" --prefix=${MINGW_PREFIX}
|
||||
|
||||
install -dm755 "${pkgdir}"/usr/share/licenses/python-matplotlib
|
||||
install -m 644 doc/users/license.rst "${pkgdir}"/usr/share/licenses/python-matplotlib
|
||||
}
|
||||
|
||||
package_mingw-w64-i686-python2-matplotlib() {
|
||||
package_python2-matplotlib
|
||||
}
|
||||
|
||||
package_mingw-w64-i686-python3-matplotlib() {
|
||||
package_python3-matplotlib
|
||||
}
|
||||
|
||||
package_mingw-w64-x86_64-python2-matplotlib() {
|
||||
package_python2-matplotlib
|
||||
}
|
||||
|
||||
package_mingw-w64-x86_64-python3-matplotlib() {
|
||||
package_python3-matplotlib
|
||||
}
|
||||
Reference in New Issue
Block a user