blob: c6fb94266a1b953e002168f3f8baadafd6f328b4 (
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
# Maintainer: Astro Benzene <universebenzene at sina dot com>
pkgbase=python-sherpa
_pyname=${pkgbase#python-}
pkgname=("python-${_pyname}" "python-${_pyname}-doc")
pkgver=4.17.1
pkgrel=1
pkgdesc="Modeling and fitting package for scientific data analysis"
arch=('i686' 'x86_64')
url="http://cxc.cfa.harvard.edu/contrib/sherpa"
license=('GPL-3.0-or-later')
makedepends=('python-setuptools'
'python-build'
'python-installer'
'python-numpy'
'fftw'
'gcc14'
'python-sphinx-astropy'
'python-sphinx_rtd_theme'
'python-matplotlib'
'python-nbsphinx>=0.8.6'
'pandoc'
'python-arviz'
'python-bokeh'
'graphviz') # wheel required by new setuptools
#'gcc-fortran')
#checkdepends=('python-pytest-xdist'
## 'python-pytest-xvfb'
# 'python-arviz'
# 'python-typing_extensions'
# 'python-bokeh'
# 'python-astropy'
# ds9
# libxml2-legacy
# xpa
# 'python-matplotlib'
# )
# 'ds9'
# 'stk')-xvfb # bokeh already in makedepends
source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz"
"sherpa-test-data-${pkgver}.tar.gz::https://github.com/sherpa/sherpa-test-data/archive/refs/tags/${pkgver}.tar.gz"
"${pkgver}-setup.cfg::https://github.com/sherpa/sherpa/raw/refs/tags/${pkgver}/setup.cfg"
'sherpa_local_fftw.patch')
md5sums=('3b5aabfb7e11235d01235ac123534e4d'
'20697fdb974f77e9a1261398ad855e51'
'64b3cd860a36845d3d39bce7ec9cd767'
'4f6a822dd67d19c0170521bad3f30b4f')
#get_pyver() {
# python -c "import sys; print('$1'.join(map(str, sys.version_info[:2])))"
#}
get_pyinfo() {
[[ $1 == "site" ]] && python -c "import site; print(site.getsitepackages()[0])" || \
python -c "import sys; print('$1'.join(map(str, sys.version_info[:2])))"
}
prepare() {
cd ${srcdir}/${_pyname}-${pkgver}
mv setup.cfg pypi-setup.cfg
cp {${srcdir}/${pkgver}-,}setup.cfg
sed -n '/egg_info/,$p' pypi-setup.cfg >> setup.cfg
patch -Np1 -i "${srcdir}/sherpa_local_fftw.patch"
rm -r extern/fftw-*
# sed -i -e '/^import\ setuptools/c from setuptools import setup' -e '/distutils/d' setup.py
# sed -i -e '/setuptools.command/s/^#\ //' -e '/distutils/d' helpers/__init__.py
# sed -i -e "/^sherpa_inc/s/]/, numpy.get_include()]/" \
# -e '/^from/a import numpy' helpers/extensions/__init__.py
# sed -e '/'\'nbsphinx\''/a \ '\'IPython\.sphinxext\.ipython_console_highlighting\','' \
# -i docs/conf.py
}
build() {
# unset LDFLAGS
cd ${srcdir}/${_pyname}-${pkgver}
CC=gcc-14 CXX=g++-14 python -m build --wheel --no-isolation --skip-dependency-check
# cp build/{lib/python$(get_pyinfo .)/site-packages/*.so,lib.linux-${CARCH}-cpython-$(get_pyinfo)}
msg "Building Docs"
ln -rs ${srcdir}/${_pyname}-${pkgver}/${_pyname/-/_}*egg-info \
build/lib.linux-${CARCH}-cpython-$(get_pyinfo)/${_pyname/-/_}-${pkgver}-py$(get_pyinfo .).egg-info
PYTHONPATH="../build/lib.linux-${CARCH}-cpython-$(get_pyinfo)" make -C docs html
}
#check() {
# cd ${srcdir}/${_pyname}-${pkgver}
# # Take more than 10 min
# ln -rs ${srcdir}/${_pyname}-${pkgver}/${_pyname/-/_}*egg-info \
# build/lib.linux-${CARCH}-cpython-$(get_pyinfo)/${_pyname/-/_}-${pkgver}-py$(get_pyinfo .).egg-info
# PYTHONPATH="${srcdir}/sherpa-test-data-${pkgver}:$(get_pyinfo site | sed 's:/usr:build:')" \
# pytest --pyargs "build/lib.linux-${CARCH}-cpython-$(get_pyinfo)/sherpa" --runslow --runzenodo -vv -l -ra --color=yes -o console_output_style=count -p xdist -n 4 \
# --deselect=build/lib.linux-${CARCH}-cpython-$(get_pyinfo)/sherpa/tests/test_sherpa.py::test_todo_latest_success #--dist=loadgroup -n 4 #|| warning "Tests failed" # -vv -l -ra --color=yes -o console_output_style=count --dist=loadgroup -n auto --runspeed
#}
package_python-sherpa() {
depends=('python>=3.10' 'python-numpy>=1.21.0' 'fftw')
optdepends=('python-matplotlib: Graphical output'
'python-astropy>=3.2.1: Data I/O support'
'ds9: Imaging requires'
'xpa: Imaging requires'
'python-sherpa-doc: Documentation for Sherpa')
install=python-sherpa.install
cd ${srcdir}/${_pyname}-${pkgver}
install -D -m644 {README.md,CITATION} -t "${pkgdir}/usr/share/doc/${pkgname}"
install -D -m644 notebooks/SherpaQuickStart.ipynb -t "${pkgdir}/usr/share/doc/${pkgname}/notebooks"
install -D -m644 COPYRIGHT -t "${pkgdir}/usr/share/licenses/${pkgname}"
python -m installer --destdir="${pkgdir}" dist/*.whl
# mv ${pkgdir}/{usr/*.so,$(get_pyinfo site)}
# rm ${pkgdir}/usr/lib/python$(get_pyver)/site-packages/sherpa-${pkgver}-py$(get_pyver).egg-info/SOURCES.txt
}
package_python-sherpa-doc() {
pkgdesc="Documentation for Sherpa"
arch=('any')
cd ${srcdir}/${_pyname}-${pkgver}/docs/_build
install -d -m755 "${pkgdir}/usr/share/doc/${pkgbase}"
cp -a html "${pkgdir}/usr/share/doc/${pkgbase}"
}
|