summaryrefslogtreecommitdiff
path: root/community/python2-matplotlib/PKGBUILD
blob: debc1a6399623052a23f4df6a9f2cbcb11ea4b84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# $Id: PKGBUILD 73010 2012-06-27 23:33:52Z stephane $
# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve> 
# Contributor: Douglas Soares de Andrade <dsa@aur.archlinux.org>

pkgname=python2-matplotlib
pkgver=1.1.0
pkgrel=3
pkgdesc="A python plotting library, making publication quality plots"
arch=('i686' 'x86_64')
url="http://matplotlib.sourceforge.net/"
backup=(usr/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc)
depends=('python2-pytz' 'python2-numpy' 'python2-pyparsing' 'python2-pyqt')
optdepends=('pygtk: for use with the GTK or GTKAgg backend'
            'tk: used by the TkAgg backend'
            'wxpython: for use with the WXAgg backend')
makedepends=('pygtk' 'tk' 'wxpython')
provides=('matplotlib' "python-matplotlib=${pkgver}")
replaces=('python-matplotlib')
conflicts=('python-matplotlib')
source=("http://downloads.sourceforge.net/matplotlib/matplotlib-${pkgver}.tar.gz"
         setup.cfg)
sha1sums=('435b4f04a7e099b79f66451d69ad0b5ce66030ae'
          'bcb5a83db9d95c96a57ca518fa6bd1897b23558f')
license=('custom')

build() {
   cd "${srcdir}/matplotlib-${pkgver}"

   cp ../setup.cfg .

   # remove internal copy of pyparsing
   rm lib/matplotlib/pyparsing.py
   sed -i "s/matplotlib.pyparsing/pyparsing/g" lib/matplotlib/{mathtext,fontconfig_pattern}.py

   # python2 fix
   for file in $(find . -name '*.py' -print); do
      sed -i -e "s|^#!.*/usr/bin/python|#!/usr/bin/python2|" \
             -e "s|^#!.*/usr/bin/env *python|#!/usr/bin/env python2|" ${file}
   done

   python2 setup.py build
}

package() {
   cd "${srcdir}/matplotlib-${pkgver}"
   python2 setup.py install -O1 --skip-build --root "${pkgdir}" --prefix=/usr
    
   install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
   install -m 644 doc/users/license.rst "${pkgdir}/usr/share/licenses/${pkgname}"
}