From 56bd759df1d0c750a065b8c845e93d5dfa6b549d Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sat, 8 Aug 2015 13:49:04 -0700 Subject: proj/gentoo: Initial commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson X-Thanks: Alec Warner - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring - wrote much python to improve cvs2svn X-Thanks: Rich Freeman - validation scripts X-Thanks: Patrick Lauer - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed --- dev-python/matplotlib/Manifest | 2 + .../files/matplotlib-1.3.1-unbundle-agg.patch | 26 +++ .../files/matplotlib-1.3.1-unbundle-pycxx.patch | 22 ++ .../files/matplotlib-1.4.3-cross-compile-1.patch | 50 ++++ .../files/matplotlib-1.4.3-cross-compile-2.patch | 54 +++++ .../files/matplotlib-1.4.3-cross-compile-3.patch | 58 +++++ dev-python/matplotlib/matplotlib-1.4.2.ebuild | 248 ++++++++++++++++++++ dev-python/matplotlib/matplotlib-1.4.3.ebuild | 258 +++++++++++++++++++++ dev-python/matplotlib/matplotlib-9999.ebuild | 251 ++++++++++++++++++++ dev-python/matplotlib/metadata.xml | 19 ++ 10 files changed, 988 insertions(+) create mode 100644 dev-python/matplotlib/Manifest create mode 100644 dev-python/matplotlib/files/matplotlib-1.3.1-unbundle-agg.patch create mode 100644 dev-python/matplotlib/files/matplotlib-1.3.1-unbundle-pycxx.patch create mode 100644 dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-1.patch create mode 100644 dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-2.patch create mode 100644 dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-3.patch create mode 100644 dev-python/matplotlib/matplotlib-1.4.2.ebuild create mode 100644 dev-python/matplotlib/matplotlib-1.4.3.ebuild create mode 100644 dev-python/matplotlib/matplotlib-9999.ebuild create mode 100644 dev-python/matplotlib/metadata.xml (limited to 'dev-python/matplotlib') diff --git a/dev-python/matplotlib/Manifest b/dev-python/matplotlib/Manifest new file mode 100644 index 000000000000..a73396a88671 --- /dev/null +++ b/dev-python/matplotlib/Manifest @@ -0,0 +1,2 @@ +DIST matplotlib-1.4.2.tar.gz 50139344 SHA256 17a3c7154f152d8dfed1f37517c0a8c5db6ade4f6334f684989c36dab84ddb54 SHA512 3525f4e6414042fabf8d18ce9041d61197465dc07c766730c187a512277907ba33f56d49d5a468d82f65bce57217e8eb48ecfa143e55152a15607b79a7b25adc WHIRLPOOL ce6e5a15676b939bda7ad1be0f27766314f60ed44ebfba1e73d2c3d00a31d5492722cde73f943de72da038772519068602e60c830af9ffdf52710a24ce98fe7a +DIST matplotlib-1.4.3.tar.gz 49933525 SHA256 5b9544472d9d6ab3d47423bdb5a0e64fdf913e505c1c083f25283dd0362bc0b6 SHA512 51b0f58b2618b47b653e17e4f6b6a1215d3a3b0f1331ce3555cc7435e365d9c75693f289ce12fe3bf8f69fd57b663e545f0f1c2c94e81eaa661cac0689e125f5 WHIRLPOOL 160ca48ecb44db58f1c56bd6e89592c5d1badd8e434fc25d32aa6d4d7a346ae7c7444d1c8e0c2ca2bf5c3246fd56cd93856ec7b1e3e51f5e471b9b55a0f2c1ad diff --git a/dev-python/matplotlib/files/matplotlib-1.3.1-unbundle-agg.patch b/dev-python/matplotlib/files/matplotlib-1.3.1-unbundle-agg.patch new file mode 100644 index 000000000000..d5a4ae39bad5 --- /dev/null +++ b/dev-python/matplotlib/files/matplotlib-1.3.1-unbundle-agg.patch @@ -0,0 +1,26 @@ +--- setupext.py.orig 2013-08-02 09:39:43.914247832 +0200 ++++ setupext.py 2013-08-02 09:40:14.785304342 +0200 +@@ -749,22 +749,7 @@ + return str(e) + ' Using local copy.' + + def add_flags(self, ext): +- if self.found_external: +- pkg_config.setup_extension(ext, 'libagg') +- else: +- ext.include_dirs.append('agg24/include') +- agg_sources = [ +- 'agg_bezier_arc.cpp', +- 'agg_curves.cpp', +- 'agg_image_filters.cpp', +- 'agg_trans_affine.cpp', +- 'agg_vcgen_contour.cpp', +- 'agg_vcgen_dash.cpp', +- 'agg_vcgen_stroke.cpp', +- 'agg_vpgen_segmentator.cpp' +- ] +- ext.sources.extend( +- os.path.join('agg24', 'src', x) for x in agg_sources) ++ pkg_config.setup_extension(ext, 'libagg', default_include_dirs=["/usr/include/agg2"]) + + + class FreeType(SetupPackage): diff --git a/dev-python/matplotlib/files/matplotlib-1.3.1-unbundle-pycxx.patch b/dev-python/matplotlib/files/matplotlib-1.3.1-unbundle-pycxx.patch new file mode 100644 index 000000000000..c27922eb11d6 --- /dev/null +++ b/dev-python/matplotlib/files/matplotlib-1.3.1-unbundle-pycxx.patch @@ -0,0 +1,22 @@ +diff --git a/setupext.py b/setupext.py +index 7b629b6..8131bb1 100644 +--- a/setupext.py ++++ b/setupext.py +@@ -674,16 +674,9 @@ class CXX(SetupPackage): + name = 'pycxx' + + def check(self): +- if sys.version_info[0] >= 3: +- # There is no version of PyCXX in the wild that will work +- # with Python 3.x +- self.__class__.found_external = False +- return ("Official versions of PyCXX are not compatible with " +- "Python 3.x. Using local copy") +- + self.__class__.found_external = True + old_stdout = sys.stdout +- sys.stdout = io.BytesIO() ++ #sys.stdout = io.BytesIO() + try: + import CXX + except ImportError: diff --git a/dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-1.patch b/dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-1.patch new file mode 100644 index 000000000000..065731441311 --- /dev/null +++ b/dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-1.patch @@ -0,0 +1,50 @@ +https://github.com/matplotlib/matplotlib/pull/4430 + +From 08d26a80859023963bc2ffb41a0b6aed942685a9 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Fri, 15 May 2015 03:36:45 -0400 +Subject: [PATCH 1/3] setupext: respect $PKG_CONFIG + +When cross-compiling, it is common to set the PKG_CONFIG env var to a +custom pkg-config that knows about the target. Make sure we respect +that just like the standard pkg-config tools suggest (pkg.m4). If it +isn't set, we use the same default as today -- "pkg-config". +--- + setupext.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/setupext.py b/setupext.py +index 80b2a6c..29cddf9 100755 +--- a/setupext.py ++++ b/setupext.py +@@ -253,7 +253,8 @@ class PkgConfig(object): + self.has_pkgconfig = False + else: + self.set_pkgconfig_path() +- status, output = getstatusoutput("pkg-config --help") ++ self.pkgconfig = os.environ.get('PKG_CONFIG', 'pkg-config') ++ status, output = getstatusoutput("%s --help" % self.pkgconfig) + self.has_pkgconfig = (status == 0) + if not self.has_pkgconfig: + print("IMPORTANT WARNING:") +@@ -286,7 +287,7 @@ class PkgConfig(object): + + executable = alt_exec + if self.has_pkgconfig: +- executable = 'pkg-config {0}'.format(package) ++ executable = '%s %s' % (self.pkgconfig, package) + + use_defaults = True + +@@ -330,7 +331,7 @@ class PkgConfig(object): + return None + + status, output = getstatusoutput( +- "pkg-config %s --modversion" % (package)) ++ '%s %s --modversion' % (self.pkgconfig, package)) + if status == 0: + return output + return None +-- +2.4.0 + diff --git a/dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-2.patch b/dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-2.patch new file mode 100644 index 000000000000..9580c70b2ae9 --- /dev/null +++ b/dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-2.patch @@ -0,0 +1,54 @@ +https://github.com/matplotlib/matplotlib/pull/4430 + +From 3761303016cab0542891374032eca87e74d585bf Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Fri, 15 May 2015 03:43:17 -0400 +Subject: [PATCH 2/3] setupext: do not mess with PKG_CONFIG_PATH + +The current code always sets PKG_CONFIG_PATH to build paths in / which +breaks cross-compiling -- things like /usr/lib are for the build system +(e.g. x86) and not for the target (e.g. arm). Since we're adding paths +that are already the default for pkg-config, there's no point in trying +to be smart here. Just punt the code. + +This basically reverts commit 101beb975d3a1218350f02bf68dc2a43ac8ff148. +--- + setupext.py | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/setupext.py b/setupext.py +index 29cddf9..57d80e7 100755 +--- a/setupext.py ++++ b/setupext.py +@@ -252,7 +252,6 @@ class PkgConfig(object): + if sys.platform == 'win32': + self.has_pkgconfig = False + else: +- self.set_pkgconfig_path() + self.pkgconfig = os.environ.get('PKG_CONFIG', 'pkg-config') + status, output = getstatusoutput("%s --help" % self.pkgconfig) + self.has_pkgconfig = (status == 0) +@@ -262,20 +261,6 @@ class PkgConfig(object): + " pkg-config is not installed.\n" + " matplotlib may not be able to find some of its dependencies") + +- def set_pkgconfig_path(self): +- pkgconfig_path = sysconfig.get_config_var('LIBDIR') +- if pkgconfig_path is None: +- return +- +- pkgconfig_path = os.path.join(pkgconfig_path, 'pkgconfig') +- if not os.path.isdir(pkgconfig_path): +- return +- +- try: +- os.environ['PKG_CONFIG_PATH'] += ':' + pkgconfig_path +- except KeyError: +- os.environ['PKG_CONFIG_PATH'] = pkgconfig_path +- + def setup_extension(self, ext, package, default_include_dirs=[], + default_library_dirs=[], default_libraries=[], + alt_exec=None): +-- +2.4.0 + diff --git a/dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-3.patch b/dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-3.patch new file mode 100644 index 000000000000..21fdf128863c --- /dev/null +++ b/dev-python/matplotlib/files/matplotlib-1.4.3-cross-compile-3.patch @@ -0,0 +1,58 @@ +https://github.com/matplotlib/matplotlib/pull/4430 + +From d077e49be318c851f6bbd64708efeed78a3ece3f Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Fri, 15 May 2015 03:49:02 -0400 +Subject: [PATCH 3/3] setupext: do not hardcode system -I/-L paths + +The native compiler should already know the right paths to look for +includes and libraries. Hardcoding a specific list of those paths +breaks both cross-compiling and multilib. In the former, paths like +/usr/include and /usr/lib are for x86 but when you want to build for +arm, mixing them leads to bad failures. In the latter, paths like +/usr/lib typically hold 32it libraries, but when you're building for +64bit, you want the libs from /usr/lib64. This goes even further as +there are other mixed ABIs like /usr/libx32 and /usr/lib32, neither +of which are handled here. + +Instead, delete the code entirely and rely on the compiler being +properly configured. If you want to use a misconfigured compiler, +you can always set CFLAGS/CPPFLAGS/LDFLAGS to include the -I/-L +that your system needs. +--- + setupext.py | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +diff --git a/setupext.py b/setupext.py +index 57d80e7..7473e3a 100755 +--- a/setupext.py ++++ b/setupext.py +@@ -216,9 +216,7 @@ sysconfig.customize_compiler = my_customize_compiler + + def make_extension(name, files, *args, **kwargs): + """ +- Make a new extension. Automatically sets include_dirs and +- library_dirs to the base directories appropriate for this +- platform. ++ Make a new extension. + + `name` is the name of the extension. + +@@ -228,14 +226,6 @@ def make_extension(name, files, *args, **kwargs): + `distutils.core.Extension` constructor. + """ + ext = DelayedExtension(name, files, *args, **kwargs) +- for dir in get_base_dirs(): +- include_dir = os.path.join(dir, 'include') +- if os.path.exists(include_dir): +- ext.include_dirs.append(include_dir) +- for lib in ('lib', 'lib64'): +- lib_dir = os.path.join(dir, lib) +- if os.path.exists(lib_dir): +- ext.library_dirs.append(lib_dir) + ext.include_dirs.append('.') + + return ext +-- +2.4.0 + diff --git a/dev-python/matplotlib/matplotlib-1.4.2.ebuild b/dev-python/matplotlib/matplotlib-1.4.2.ebuild new file mode 100644 index 000000000000..defc79b79f4b --- /dev/null +++ b/dev-python/matplotlib/matplotlib-1.4.2.ebuild @@ -0,0 +1,248 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_3,3_4} ) + +PYTHON_REQ_USE='tk?' + +inherit distutils-r1 eutils flag-o-matic virtualx + +DESCRIPTION="Pure python plotting library with matlab like syntax" +HOMEPAGE="http://matplotlib.org/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +SLOT="0" +# Main license: matplotlib +# Some modules: BSD +# matplotlib/backends/qt4_editor: MIT +# Fonts: BitstreamVera, OFL-1.1 +LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1" +KEYWORDS="amd64 arm ppc ~ppc64 x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="cairo doc excel examples fltk gtk gtk3 latex pyside qt4 test tk wxwidgets" + +# #456704 -- a lot of py2-only deps +PY2_USEDEP=$(python_gen_usedep python2_7) +COMMON_DEPEND=" + >=dev-python/numpy-1.6[${PYTHON_USEDEP}] + dev-python/python-dateutil:0[${PYTHON_USEDEP}] + dev-python/pytz[${PYTHON_USEDEP}] + >=dev-python/six-1.4[${PYTHON_USEDEP}] + media-fonts/stix-fonts + >=media-libs/freetype-2.3 + media-libs/libpng:0 + media-libs/qhull + gtk? ( + dev-libs/glib:2= + x11-libs/gdk-pixbuf + x11-libs/gtk+:2= + dev-python/pygtk[${PY2_USEDEP}] ) + wxwidgets? ( >=dev-python/wxpython-2.8:*[${PY2_USEDEP}] )" + +# internal copy of pycxx highly patched +# dev-python/pycxx + +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig + doc? ( + app-text/dvipng + virtual/python-imaging[${PYTHON_USEDEP}] + dev-python/ipython[${PYTHON_USEDEP}] + dev-python/numpydoc[${PYTHON_USEDEP}] + dev-python/xlwt[${PY2_USEDEP}] + dev-python/sphinx[${PYTHON_USEDEP}] + dev-texlive/texlive-latexextra + dev-texlive/texlive-fontsrecommended + dev-texlive/texlive-latexrecommended + media-gfx/graphviz[cairo] + ) + test? ( + dev-python/mock[${PYTHON_USEDEP}] + >=dev-python/nose-0.11.1[${PYTHON_USEDEP}] + )" + +RDEPEND="${COMMON_DEPEND} + >=dev-python/pyparsing-1.5.6[${PYTHON_USEDEP}] + cairo? ( + || ( + dev-python/pycairo[${PYTHON_USEDEP}] + dev-python/cairocffi[${PYTHON_USEDEP}] + ) + ) + excel? ( dev-python/xlwt[${PY2_USEDEP}] ) + fltk? ( dev-python/pyfltk[${PY2_USEDEP}] ) + gtk3? ( + dev-python/pygobject:3[${PYTHON_USEDEP}] + x11-libs/gtk+:3[introspection] ) + latex? ( + virtual/latex-base + app-text/ghostscript-gpl + app-text/dvipng + app-text/poppler[utils] + dev-texlive/texlive-fontsrecommended + dev-texlive/texlive-latexextra + dev-texlive/texlive-xetex + ) + pyside? ( dev-python/pyside[X,${PYTHON_USEDEP}] ) + qt4? ( dev-python/PyQt4[X,${PYTHON_USEDEP}] )" + +PY2_FLAGS="|| ( $(python_gen_useflags python2_7) )" +REQUIRED_USE=" + doc? ( ${PY2_FLAGS} ) + excel? ( ${PY2_FLAGS} ) + fltk? ( ${PY2_FLAGS} ) + gtk? ( ${PY2_FLAGS} ) + wxwidgets? ( ${PY2_FLAGS} ) + test? ( + cairo fltk latex pyside qt4 tk wxwidgets + || ( gtk gtk3 ) + )" + +RESTRICT="mirror" + +# A few C++ source files are written to srcdir. +# Other than that, the ebuild shall be fit for out-of-source build. +DISTUTILS_IN_SOURCE_BUILD=1 + +pkg_setup() { + unset DISPLAY # bug #278524 +} + +use_setup() { + local uword="${2:-${1}}" + if use ${1}; then + echo "${uword} = True" + echo "${uword}agg = True" + else + echo "${uword} = False" + echo "${uword}agg = False" + fi +} + +python_prepare_all() { +# Generates test failures, but fedora does it +# local PATCHES=( +# "${FILESDIR}"/${P}-unbundle-pycxx.patch +# "${FILESDIR}"/${P}-unbundle-agg.patch +# ) +# rm -r agg24 CXX || die +# rm -r agg24 || die + + sed \ + -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \ + -i lib/matplotlib/{mathtext,fontconfig_pattern}.py \ + || die "sed pyparsing failed" + + # suggested by upstream + sed \ + -e '/tol/s:32:35:g' \ + -i lib/matplotlib/tests/test_mathtext.py || die + + export XDG_RUNTIME_DIR="${T}/runtime-dir" + mkdir "${XDG_RUNTIME_DIR}" || die + chmod 0700 "${XDG_RUNTIME_DIR}" || die + + distutils-r1_python_prepare_all +} + +python_configure_all() { + append-flags -fno-strict-aliasing + append-cppflags -DNDEBUG # or get old trying to do triangulation +} + +python_configure() { + mkdir -p "${BUILD_DIR}" || die + + # create setup.cfg (see setup.cfg.template for any changes). + + # common switches. + cat > "${BUILD_DIR}"/setup.cfg <<- EOF + [directories] + basedirlist = "${EPREFIX}/usr" + [provide_packages] + pytz = False + dateutil = False + [gui_support] + agg = True + $(use_setup cairo) + $(use_setup pyside) + $(use_setup qt4) + $(use_setup tk) + EOF + + if use gtk3 && use cairo; then + echo "gtk3cairo = True" >> "${BUILD_DIR}"/setup.cfg || die + else + echo "gtk3cairo = False" >> "${BUILD_DIR}"/setup.cfg || die + fi + + if $(python_is_python3); then + cat >> "${BUILD_DIR}"/setup.cfg <<- EOF + six = True + fltk = False + fltkagg = False + gtk = False + gtkagg = False + wx = False + wxagg = False + EOF + else + cat >> "${BUILD_DIR}"/setup.cfg <<-EOF + six = False + $(use_setup fltk) + $(use_setup gtk) + $(use_setup gtk3) + $(use_setup wxwidgets wx) + EOF + fi +} + +wrap_setup() { + local MPLSETUPCFG=${BUILD_DIR}/setup.cfg + export MPLSETUPCFG + + # Note: remove build... if switching to out-of-source build + "${@}" build --build-lib="${BUILD_DIR}"/build/lib +} + +python_compile() { + wrap_setup distutils-r1_python_compile +} + +python_compile_all() { + if use doc; then + cd doc || die + + # necessary for in-source build + local -x PYTHONPATH="${BUILD_DIR}"/build/lib:${PYTHONPATH} + + VARTEXFONTS="${T}"/fonts \ + "${PYTHON}" ./make.py --small html || die + fi +} + +python_test() { + wrap_setup distutils_install_for_testing + + cd "${TMPDIR}" || die + VIRTUALX_COMMAND="${PYTHON}" + virtualmake -c "import sys, matplotlib as m; sys.exit(0 if m.test(verbosity=2) else 1)" || \ + die "Tests fail with ${EPYTHON}" +} + +python_install() { + wrap_setup distutils-r1_python_install +} + +python_install_all() { + use doc && local HTML_DOCS=( doc/build/html/. ) + + distutils-r1_python_install_all + + if use examples; then + dodoc -r examples + docompress -x /usr/share/doc/${PF}/examples + fi +} diff --git a/dev-python/matplotlib/matplotlib-1.4.3.ebuild b/dev-python/matplotlib/matplotlib-1.4.3.ebuild new file mode 100644 index 000000000000..df777aa8c329 --- /dev/null +++ b/dev-python/matplotlib/matplotlib-1.4.3.ebuild @@ -0,0 +1,258 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_3,3_4} ) + +PYTHON_REQ_USE='tk?' + +inherit distutils-r1 eutils flag-o-matic virtualx toolchain-funcs + +DESCRIPTION="Pure python plotting library with matlab like syntax" +HOMEPAGE="http://matplotlib.org/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +SLOT="0" +# Main license: matplotlib +# Some modules: BSD +# matplotlib/backends/qt4_editor: MIT +# Fonts: BitstreamVera, OFL-1.1 +LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +IUSE="cairo doc excel examples fltk gtk gtk3 latex pyside qt4 qt5 test tk wxwidgets" + +# #456704 -- a lot of py2-only deps +PY2_USEDEP=$(python_gen_usedep python2_7) +COMMON_DEPEND=" + >=dev-python/numpy-1.6[${PYTHON_USEDEP}] + dev-python/python-dateutil:0[${PYTHON_USEDEP}] + dev-python/pytz[${PYTHON_USEDEP}] + >=dev-python/six-1.4[${PYTHON_USEDEP}] + media-fonts/stix-fonts + media-libs/freetype:2 + media-libs/libpng:0 + media-libs/qhull + gtk? ( + dev-libs/glib:2= + x11-libs/gdk-pixbuf + x11-libs/gtk+:2 + dev-python/pygtk[${PY2_USEDEP}] ) + wxwidgets? ( >=dev-python/wxpython-2.8:*[${PY2_USEDEP}] )" + +# internal copy of pycxx highly patched +# dev-python/pycxx + +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig + doc? ( + app-text/dvipng + virtual/python-imaging[${PYTHON_USEDEP}] + dev-python/ipython[${PYTHON_USEDEP}] + dev-python/numpydoc[${PYTHON_USEDEP}] + dev-python/xlwt[${PY2_USEDEP}] + dev-python/sphinx[${PYTHON_USEDEP}] + dev-texlive/texlive-latexextra + dev-texlive/texlive-fontsrecommended + dev-texlive/texlive-latexrecommended + media-gfx/graphviz[cairo] + ) + test? ( + dev-python/mock[${PYTHON_USEDEP}] + >=dev-python/nose-0.11.1[${PYTHON_USEDEP}] + )" + +RDEPEND="${COMMON_DEPEND} + >=dev-python/pyparsing-1.5.6[${PYTHON_USEDEP}] + cairo? ( + || ( + dev-python/pycairo[${PYTHON_USEDEP}] + dev-python/cairocffi[${PYTHON_USEDEP}] + ) + ) + excel? ( dev-python/xlwt[${PY2_USEDEP}] ) + fltk? ( dev-python/pyfltk[${PY2_USEDEP}] ) + gtk3? ( + dev-python/pygobject:3[${PYTHON_USEDEP}] + x11-libs/gtk+:3[introspection] ) + latex? ( + virtual/latex-base + app-text/ghostscript-gpl + app-text/dvipng + app-text/poppler[utils] + dev-texlive/texlive-fontsrecommended + dev-texlive/texlive-latexextra + dev-texlive/texlive-xetex + ) + pyside? ( dev-python/pyside[X,${PYTHON_USEDEP}] ) + qt4? ( dev-python/PyQt4[X,${PYTHON_USEDEP}] ) + qt5? ( dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}] ) + " + +PY2_FLAGS="|| ( $(python_gen_useflags python2_7) )" +REQUIRED_USE=" + doc? ( ${PY2_FLAGS} ) + excel? ( ${PY2_FLAGS} ) + fltk? ( ${PY2_FLAGS} ) + gtk? ( ${PY2_FLAGS} ) + wxwidgets? ( ${PY2_FLAGS} ) + test? ( + cairo fltk latex pyside qt5 qt4 tk wxwidgets + || ( gtk gtk3 ) + )" + +RESTRICT="mirror" + +# A few C++ source files are written to srcdir. +# Other than that, the ebuild shall be fit for out-of-source build. +DISTUTILS_IN_SOURCE_BUILD=1 + +pkg_setup() { + unset DISPLAY # bug #278524 +} + +use_setup() { + local uword="${2:-${1}}" + if use ${1}; then + echo "${uword} = True" + echo "${uword}agg = True" + else + echo "${uword} = False" + echo "${uword}agg = False" + fi +} + +python_prepare_all() { +# Generates test failures, but fedora does it +# local PATCHES=( +# "${FILESDIR}"/${P}-unbundle-pycxx.patch +# "${FILESDIR}"/${P}-unbundle-agg.patch +# ) +# rm -r agg24 CXX || die +# rm -r agg24 || die + + epatch "${FILESDIR}"/${PN}-1.4.3-cross-compile-{1,2,3}.patch + + sed \ + -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \ + -i lib/matplotlib/{mathtext,fontconfig_pattern}.py \ + || die "sed pyparsing failed" + + # suggested by upstream + sed \ + -e '/tol/s:32:35:g' \ + -i lib/matplotlib/tests/test_mathtext.py || die + + sed \ + -e "s:/usr/:${EPREFIX}/usr/:g" \ + -i setupext.py || die + + export XDG_RUNTIME_DIR="${T}/runtime-dir" + mkdir "${XDG_RUNTIME_DIR}" || die + chmod 0700 "${XDG_RUNTIME_DIR}" || die + + distutils-r1_python_prepare_all +} + +python_configure_all() { + append-flags -fno-strict-aliasing + append-cppflags -DNDEBUG # or get old trying to do triangulation + tc-export PKG_CONFIG +} + +python_configure() { + mkdir -p "${BUILD_DIR}" || die + + # create setup.cfg (see setup.cfg.template for any changes). + + # common switches. + cat > "${BUILD_DIR}"/setup.cfg <<- EOF + [directories] + basedirlist = "${EPREFIX}/usr" + [provide_packages] + pytz = False + dateutil = False + [gui_support] + agg = True + $(use_setup cairo) + $(use_setup pyside) + $(use_setup qt4) + $(use_setup qt5) + $(use_setup tk) + EOF + + if use gtk3 && use cairo; then + echo "gtk3cairo = True" >> "${BUILD_DIR}"/setup.cfg || die + else + echo "gtk3cairo = False" >> "${BUILD_DIR}"/setup.cfg || die + fi + + if $(python_is_python3); then + cat >> "${BUILD_DIR}"/setup.cfg <<- EOF + six = True + fltk = False + fltkagg = False + gtk = False + gtkagg = False + wx = False + wxagg = False + EOF + else + cat >> "${BUILD_DIR}"/setup.cfg <<-EOF + six = False + $(use_setup fltk) + $(use_setup gtk) + $(use_setup gtk3) + $(use_setup wxwidgets wx) + EOF + fi +} + +wrap_setup() { + local MPLSETUPCFG=${BUILD_DIR}/setup.cfg + export MPLSETUPCFG + + # Note: remove build... if switching to out-of-source build + "${@}" build --build-lib="${BUILD_DIR}"/build/lib +} + +python_compile() { + wrap_setup distutils-r1_python_compile +} + +python_compile_all() { + if use doc; then + cd doc || die + + # necessary for in-source build + local -x PYTHONPATH="${BUILD_DIR}"/build/lib:${PYTHONPATH} + + VARTEXFONTS="${T}"/fonts \ + "${PYTHON}" ./make.py --small html || die + fi +} + +python_test() { + wrap_setup distutils_install_for_testing + + cd "${TMPDIR}" || die + VIRTUALX_COMMAND="${PYTHON}" + virtualmake -c "import sys, matplotlib as m; sys.exit(0 if m.test(verbosity=2) else 1)" || \ + die "Tests fail with ${EPYTHON}" +} + +python_install() { + wrap_setup distutils-r1_python_install +} + +python_install_all() { + use doc && local HTML_DOCS=( doc/build/html/. ) + + distutils-r1_python_install_all + + if use examples; then + dodoc -r examples + docompress -x /usr/share/doc/${PF}/examples + fi +} diff --git a/dev-python/matplotlib/matplotlib-9999.ebuild b/dev-python/matplotlib/matplotlib-9999.ebuild new file mode 100644 index 000000000000..1e63422cbf85 --- /dev/null +++ b/dev-python/matplotlib/matplotlib-9999.ebuild @@ -0,0 +1,251 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python{2_7,3_3,3_4} ) + +PYTHON_REQ_USE='tk?' + +inherit distutils-r1 eutils flag-o-matic git-r3 virtualx + +DESCRIPTION="Pure python plotting library with matlab like syntax" +HOMEPAGE="http://matplotlib.org/" +SRC_URI="" +EGIT_REPO_URI="https://github.com/matplotlib/matplotlib.git" + +SLOT="0" +# Main license: matplotlib +# Some modules: BSD +# matplotlib/backends/qt4_editor: MIT +# Fonts: BitstreamVera, OFL-1.1 +LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1" +KEYWORDS="" +IUSE="cairo doc excel examples fltk gtk gtk3 latex pyside qt4 qt5 test tk wxwidgets" + +# #456704 -- a lot of py2-only deps +PY2_USEDEP=$(python_gen_usedep python2_7) +COMMON_DEPEND=" + >=dev-python/numpy-1.6[${PYTHON_USEDEP}] + dev-python/python-dateutil:0[${PYTHON_USEDEP}] + dev-python/pytz[${PYTHON_USEDEP}] + >=dev-python/six-1.4[${PYTHON_USEDEP}] + media-fonts/stix-fonts + media-libs/freetype:2 + media-libs/libpng:0 + media-libs/qhull + gtk? ( + dev-libs/glib:2= + x11-libs/gdk-pixbuf + x11-libs/gtk+:2 + dev-python/pygtk[${PY2_USEDEP}] ) + wxwidgets? ( >=dev-python/wxpython-2.8:*[${PY2_USEDEP}] )" + +# internal copy of pycxx highly patched +# dev-python/pycxx + +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig + doc? ( + app-text/dvipng + virtual/python-imaging[${PYTHON_USEDEP}] + dev-python/ipython[${PYTHON_USEDEP}] + dev-python/numpydoc[${PYTHON_USEDEP}] + dev-python/xlwt[${PY2_USEDEP}] + dev-python/sphinx[${PYTHON_USEDEP}] + dev-texlive/texlive-latexextra + dev-texlive/texlive-fontsrecommended + dev-texlive/texlive-latexrecommended + media-gfx/graphviz[cairo] + ) + test? ( + dev-python/mock[${PYTHON_USEDEP}] + >=dev-python/nose-0.11.1[${PYTHON_USEDEP}] + )" + +RDEPEND="${COMMON_DEPEND} + dev-python/pyparsing[${PYTHON_USEDEP}] + cairo? ( dev-python/pycairo[${PYTHON_USEDEP}] ) + excel? ( dev-python/xlwt[${PY2_USEDEP}] ) + fltk? ( dev-python/pyfltk[${PY2_USEDEP}] ) + gtk3? ( + dev-python/pygobject:3[${PYTHON_USEDEP}] + x11-libs/gtk+:3[introspection] ) + latex? ( + virtual/latex-base + app-text/ghostscript-gpl + app-text/dvipng + app-text/poppler[utils] + dev-texlive/texlive-fontsrecommended + dev-texlive/texlive-latexextra + dev-texlive/texlive-xetex + ) + pyside? ( dev-python/pyside[X,${PYTHON_USEDEP}] ) + qt4? ( dev-python/PyQt4[X,${PYTHON_USEDEP}] ) + qt5? ( dev-python/PyQt5[X,${PYTHON_USEDEP}] ) + " + +PY2_FLAGS="|| ( $(python_gen_useflags python2_7) )" +REQUIRED_USE=" + doc? ( ${PY2_FLAGS} ) + excel? ( ${PY2_FLAGS} ) + fltk? ( ${PY2_FLAGS} ) + gtk? ( ${PY2_FLAGS} ) + wxwidgets? ( ${PY2_FLAGS} ) + test? ( + cairo fltk latex pyside qt4 tk wxwidgets + || ( gtk gtk3 ) + )" + +RESTRICT="mirror" + +# A few C++ source files are written to srcdir. +# Other than that, the ebuild shall be fit for out-of-source build. +DISTUTILS_IN_SOURCE_BUILD=1 + +pkg_setup() { + unset DISPLAY # bug #278524 +} + +use_setup() { + local uword="${2:-${1}}" + if use ${1}; then + echo "${uword} = True" + echo "${uword}agg = True" + else + echo "${uword} = False" + echo "${uword}agg = False" + fi +} + +python_prepare_all() { +# Generates test failures, but fedora does it +# local PATCHES=( +# "${FILESDIR}"/${P}-unbundle-pycxx.patch +# "${FILESDIR}"/${P}-unbundle-agg.patch +# ) +# rm -r agg24 CXX || die +# rm -r agg24 || die + + sed \ + -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \ + -i lib/matplotlib/{mathtext,fontconfig_pattern}.py \ + || die "sed pyparsing failed" + + # suggested by upstream + sed \ + -e '/tol/s:32:35:g' \ + -i lib/matplotlib/tests/test_mathtext.py || die + + sed \ + -e "s:/usr/:${EPREFIX}/usr/:g" \ + -i setupext.py || die + + export XDG_RUNTIME_DIR="${T}/runtime-dir" + mkdir "${XDG_RUNTIME_DIR}" || die + chmod 0700 "${XDG_RUNTIME_DIR}" || die + + distutils-r1_python_prepare_all +} + +python_configure_all() { + append-flags -fno-strict-aliasing + append-cppflags -DNDEBUG # or get old trying to do triangulation +} + +python_configure() { + mkdir -p "${BUILD_DIR}" || die + + # create setup.cfg (see setup.cfg.template for any changes). + + # common switches. + cat > "${BUILD_DIR}"/setup.cfg <<- EOF + [directories] + basedirlist = "${EPREFIX}/usr" + [provide_packages] + pytz = False + dateutil = False + [gui_support] + agg = True + $(use_setup cairo) + $(use_setup pyside) + $(use_setup qt4) + $(use_setup qt5) + $(use_setup tk) + EOF + + if use gtk3 && use cairo; then + echo "gtk3cairo = True" >> "${BUILD_DIR}"/setup.cfg || die + else + echo "gtk3cairo = False" >> "${BUILD_DIR}"/setup.cfg || die + fi + + if $(python_is_python3); then + cat >> "${BUILD_DIR}"/setup.cfg <<- EOF + six = True + fltk = False + fltkagg = False + gtk = False + gtkagg = False + wx = False + wxagg = False + EOF + else + cat >> "${BUILD_DIR}"/setup.cfg <<-EOF + six = False + $(use_setup fltk) + $(use_setup gtk) + $(use_setup gtk3) + $(use_setup wxwidgets wx) + EOF + fi +} + +wrap_setup() { + local MPLSETUPCFG=${BUILD_DIR}/setup.cfg + export MPLSETUPCFG + + # Note: remove build... if switching to out-of-source build + "${@}" build --build-lib="${BUILD_DIR}"/build/lib +} + +python_compile() { + wrap_setup distutils-r1_python_compile +} + +python_compile_all() { + if use doc; then + cd doc || die + + # necessary for in-source build + local -x PYTHONPATH="${BUILD_DIR}"/build/lib:${PYTHONPATH} + + VARTEXFONTS="${T}"/fonts \ + "${PYTHON}" ./make.py --small html || die + fi +} + +python_test() { + wrap_setup distutils_install_for_testing + + cd "${TMPDIR}" || die + VIRTUALX_COMMAND="${PYTHON}" + virtualmake -c "import sys, matplotlib as m; sys.exit(0 if m.test(verbosity=2) else 1)" || \ + die "Tests fail with ${EPYTHON}" +} + +python_install() { + wrap_setup distutils-r1_python_install +} + +python_install_all() { + use doc && local HTML_DOCS=( doc/build/html/. ) + + distutils-r1_python_install_all + + if use examples; then + dodoc -r examples + docompress -x /usr/share/doc/${PF}/examples + fi +} diff --git a/dev-python/matplotlib/metadata.xml b/dev-python/matplotlib/metadata.xml new file mode 100644 index 000000000000..99ad12592dcb --- /dev/null +++ b/dev-python/matplotlib/metadata.xml @@ -0,0 +1,19 @@ + + + + python + + matplotlib is an interactive library for plotting and doing basic + data analysis in python with a syntax similar to matlab. It provides a + variety of backends and hard copy formats for almost ready + publication plots. + + + Pull dev-python/xlwt for the exceltools toolkit + Use x11-libs/gtk+:3 instead of x11-libs/gtk+:2 + Qt support via dev-python/pyside + + + matplotlib + + -- cgit v1.2.3-65-gdbad