Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/imexam/, dev-python/imexam/files/
Date: Wed, 19 Jul 2017 17:00:31
Message-Id: 1500483605.072da0c6dc2cb8d563b7a02773380fab926580af.bicatali@gentoo
1 commit: 072da0c6dc2cb8d563b7a02773380fab926580af
2 Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 18 17:18:11 2017 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 19 17:00:05 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=072da0c6
7
8 dev-python/imexam: initial import
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 dev-python/imexam/Manifest | 1 +
13 .../imexam/files/imexam-0.7.1-system-xpa.patch | 52 +++++++++++++++++++++
14 dev-python/imexam/imexam-0.7.1.ebuild | 54 ++++++++++++++++++++++
15 dev-python/imexam/metadata.xml | 21 +++++++++
16 4 files changed, 128 insertions(+)
17
18 diff --git a/dev-python/imexam/Manifest b/dev-python/imexam/Manifest
19 new file mode 100644
20 index 00000000000..d9b7fcaf431
21 --- /dev/null
22 +++ b/dev-python/imexam/Manifest
23 @@ -0,0 +1 @@
24 +DIST imexam-0.7.1.tar.gz 20264259 SHA256 99579305e71f22fd06e4ed95e0d38edd0474832e9b87ef3f6abcd243ed8ad46f SHA512 cb09d1764de19333fa6be1bbb9e6efd3d59943fdef4ccac4e8429e436dd615fa5be3a06c9473cc2c3ff1de1a8987d02ef24765de5b36131c31451b013be8d776 WHIRLPOOL 6c45aa0006d1217df6fd7fc4c2b0fa01a6cf4efcb26bd8adf16832823b229407ed20394202b3298f9e5433e3330cbd33469eaf215af863523011d6286afff89b
25
26 diff --git a/dev-python/imexam/files/imexam-0.7.1-system-xpa.patch b/dev-python/imexam/files/imexam-0.7.1-system-xpa.patch
27 new file mode 100644
28 index 00000000000..fc90ffef7f3
29 --- /dev/null
30 +++ b/dev-python/imexam/files/imexam-0.7.1-system-xpa.patch
31 @@ -0,0 +1,52 @@
32 +From: Ole Streicher <ole@×××.de>
33 +Date: Fri, 21 Apr 2017 13:40:06 +0200
34 +Subject: Use external xpa
35 +
36 +---
37 + setup.py | 15 +++------------
38 + 1 file changed, 3 insertions(+), 12 deletions(-)
39 +
40 +diff --git a/setup.py b/setup.py
41 +index f0dd5d5..f291201 100644
42 +--- a/setup.py
43 ++++ b/setup.py
44 +@@ -121,24 +121,20 @@ if not sys.platform.startswith('win'):
45 + xpaio.c
46 + """.split()
47 +
48 +- XPA_SOURCES = [os.path.join(XPALIB_DIR, c) for c in XPA_FILES]
49 +- XPALIB_DEFINES = [("HAVE_CONFIG_H", "1")]
50 ++ XPA_SOURCES = []
51 ++ XPALIB_DEFINES = []
52 + XPA_SOURCES.append(CYTHON_SOURCE)
53 +
54 + xpa_module = Extension("xpa",
55 + sources=XPA_SOURCES,
56 +- include_dirs=[XPALIB_DIR],
57 + define_macros=XPALIB_DEFINES,
58 +- depends=[CONF_H_NAME],
59 ++ libraries = ['xpa'],
60 + )
61 + if use_cython:
62 + ext = cythonize(xpa_module)
63 +
64 + class my_clean(clean):
65 + def run(self):
66 +- import subprocess
67 +- subprocess.call(["make", "clean"],
68 +- cwd=XPALIB_DIR)
69 + if os.access(CONF_H_NAME, os.F_OK):
70 + os.remove(CONF_H_NAME)
71 + os.remove("wrappers/xpa.c")
72 +@@ -147,11 +143,6 @@ if not sys.platform.startswith('win'):
73 +
74 + class build_ext_with_configure(build_ext):
75 + def build_extensions(self):
76 +- import subprocess
77 +- subprocess.call(["make", "-f", "Makefile", "clean"],
78 +- cwd=XPALIB_DIR)
79 +- subprocess.call(["sh", "./configure"], cwd=XPALIB_DIR)
80 +- subprocess.call(["make", "-f", "Makefile"], cwd=XPALIB_DIR)
81 + build_ext.build_extensions(self)
82 +
83 + cmdclass.update({'build_ext': build_ext_with_configure,
84
85 diff --git a/dev-python/imexam/imexam-0.7.1.ebuild b/dev-python/imexam/imexam-0.7.1.ebuild
86 new file mode 100644
87 index 00000000000..65296b55c7c
88 --- /dev/null
89 +++ b/dev-python/imexam/imexam-0.7.1.ebuild
90 @@ -0,0 +1,54 @@
91 +# Copyright 1999-2017 Gentoo Foundation
92 +# Distributed under the terms of the GNU General Public License v2
93 +
94 +EAPI=6
95 +PYTHON_COMPAT=( python{2_7,3_5,3_6} )
96 +
97 +inherit distutils-r1 xdg-utils
98 +
99 +DESCRIPTION="Simple interactive astronomical image examination and plotting"
100 +HOMEPAGE="https://imexam.readthedocs.io"
101 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
102 +
103 +LICENSE="BSD"
104 +SLOT="0"
105 +KEYWORDS="~amd64 ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
106 +IUSE="doc test"
107 +
108 +RDEPEND="
109 + dev-python/astropy[${PYTHON_USEDEP}]
110 + dev-python/ginga[${PYTHON_USEDEP}]
111 + dev-python/ipython[${PYTHON_USEDEP}]
112 + dev-python/matplotlib[${PYTHON_USEDEP}]
113 + sci-libs/scipy[${PYTHON_USEDEP}]"
114 +DEPEND="${RDEPEND}
115 + dev-python/astropy-helpers[${PYTHON_USEDEP}]
116 + dev-python/cython[${PYTHON_USEDEP}]
117 + dev-python/setuptools[${PYTHON_USEDEP}]
118 + doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
119 + test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
120 +
121 +PATCHES=( "${FILESDIR}"/${P}-system-xpa.patch )
122 +
123 +python_prepare_all() {
124 + # use system astropy-helpers instead of bundled one
125 + sed -i -e '/auto_use/s/True/False/' setup.cfg || die
126 + echo "backend: Agg" > "${T}"/matplotlibrc || die
127 + xdg_environment_reset
128 + distutils-r1_python_prepare_all
129 +}
130 +
131 +python_compile_all() {
132 + if use doc; then
133 + python_setup
134 + VARTEXFONTS="${T}"/fonts \
135 + MPLCONFIGDIR="${T}" \
136 + PYTHONPATH="${BUILD_DIR}"/lib \
137 + esetup.py build_docs --no-intersphinx
138 + HTML_DOCS=( docs/_build/html/. )
139 + fi
140 +}
141 +
142 +python_test() {
143 + esetup.py test -v
144 +}
145
146 diff --git a/dev-python/imexam/metadata.xml b/dev-python/imexam/metadata.xml
147 new file mode 100644
148 index 00000000000..6a478af7b2b
149 --- /dev/null
150 +++ b/dev-python/imexam/metadata.xml
151 @@ -0,0 +1,21 @@
152 +<?xml version="1.0" encoding="UTF-8"?>
153 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
154 +<pkgmetadata>
155 + <maintainer type="project">
156 + <email>sci-astronomy@g.o</email>
157 + <name>Gentoo Astronomy Project</name>
158 + </maintainer>
159 + <longdescription lang="en">
160 + Imexam is an affiliated package of AstroPy. It was designed to be a
161 + lightweight library which enables users to explore data using common
162 + methods which are consistent across viewers. It can be used from a
163 + command line interface, through a Jupyter notebook or through a
164 + Jupyter console. It can be used with multiple viewers, such as DS9 or
165 + Ginga, or without a viewer as a simple library to make plots and grab
166 + quick photometry information.
167 + </longdescription>
168 + <upstream>
169 + <remote-id type="pypi">imexam</remote-id>
170 + <remote-id type="github">spacetelescope/imexam</remote-id>
171 + </upstream>
172 +</pkgmetadata>