1 # Maintainer: Konstantin Gizdov <arch at kge dot pw>
2 # Contributor: Astro Benzene <universebenzene at sina dot com>
4 pkgbase="python-${_pkgname}"
5 pkgname=("python-${_pkgname}" "python-${_pkgname}-docs")
7 _commit=d83dc285b2789ceea620fb3dcdef609e6967d6b7 # refs/tags/v2.21.3
9 pkgdesc="Python interface for MINUIT, a physics analysis tool for function minimization."
11 url="https://iminuit.readthedocs.io"
18 'python-boost-histogram'
31 'python-sphinx_rtd_theme'
34 checkdepends=('python-pytest' 'python-scipy' 'python-tabulate')
37 "${pkgbase}::git+https://github.com/scikit-hep/iminuit#commit=$_commit"
38 "${pkgbase}-pybind11::git+https://github.com/pybind/pybind11.git"
39 "${pkgbase}-root::git+https://github.com/root-project/root.git"
46 python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
50 python -c 'import sys; print(str(sys.version_info[0]) + str(sys.version_info[1]))'
57 git config submodule."extern/root".url "${srcdir}/${pkgname}"-root
58 git submodule deinit "extern/pybind11"
60 # root submodule reference is broken, fix it
61 git -c protocol.file.allow=always submodule update --init --recursive
63 # python-cmake is not needed
64 sed -i '/cmake/d' pyproject.toml
70 # build against system pybind11
71 export CMAKE_ARGS='-DIMINUIT_EXTERNAL_PYBIND11=ON'
72 python -m build --wheel --no-isolation
74 # NOTE: building docs is broken because numba* is not compatible with Python 3.11 and fails to install/build in a venv
76 # python -m venv --system-site-packages test-env
77 # test-env/bin/python -m pip install numba-stats resample
78 # echo 'nbsphinx_allow_errors = True' >> doc/conf.py
79 # PYTHONPATH="${PWD}/test-env/lib/python$(_get_pyver)/site-packages:${PWD}/build/lib.linux-${CARCH}-cpython-$(_get_cpyver)" make build/html/done
81 # NOTE: this is an attempt at building it with system dependencies, unfortunately there are issues with importing nbconvert.RSTExporter() for some reason...
82 # local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
83 # python -m installer --destdir=test_dir dist/*.whl
84 # export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
85 # sphinx-build -v -W -b html -d build/doctrees doc build/html
89 local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
92 # install to temporary location, as importlib is used
93 python -m installer --destdir=test_dir dist/*.whl
94 export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
98 package_python-iminuit() {
106 'python-iminuit-docs: Documentation for python-iminuit'
107 'python-ipython: for plotting'
108 'python-ipywidgets: for plotting'
109 'python-matplotlib: for drawing operations'
110 'python-progressbar: for progressbar support'
111 'python-scipy: for scipy minimizers'
116 install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
117 install -D -m644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
118 python -m installer --destdir="${pkgdir}" dist/*.whl
121 package_python-iminuit-docs() {
124 install -d -m755 "${pkgdir}/usr/share/doc/${pkgname}"
125 # NOTE: there's currently nothing to install... consider dropping as online documentation exists
126 # cp -a build/html "${pkgdir}/usr/share/doc/${pkgname}"
127 install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE