summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 585e590e0bb961f1a2aea42361162280fcaaeb6b (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
# Maintainer: Astro Benzene <universebenzene at sina dot com>
# Contributor: Miguel de Val-Borro <miguel dot deval at gmail dot com>

pkgname=python-ginga
_pyname=${pkgname#python-}
pkgver=5.2.0
pkgrel=1
pkgdesc="A viewer for astronomical data FITS (Flexible Image Transport System) files."
arch=('any')
url="https://ejeschke.github.io/ginga"
license=('BSD-3-Clause')
makedepends=('python-setuptools-scm'
             'python-wheel'
             'python-build'
             'python-installer')
checkdepends=('python-pytest-astropy-header'
              'python-photutils'
              'python-puremagic'
              'python-regions'
              'python-astlib')  # pillow <- matplotlib, scipy required by astlib
#             'python-starlink-pyast'
source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
md5sums=('a488be9ed17f13289c4082b48a9e1fd8')

#prepare() {
#    cd ${srcdir}/${_pyname}-${pkgver}
#
#    sed -i "/ignore:distutils/a \	ignore:the imp module is deprecated:DeprecationWarning" setup.cfg
#}

build() {
    cd ${srcdir}/${_pyname}-${pkgver}

    python -m build --wheel --no-isolation
}

check() {
    cd ${srcdir}/${_pyname}-${pkgver}

    pytest || warning "Tests failed" # -vv -l -ra --color=yes -o console_output_style=count -Wdefault
}

package() {
    depends=('python-astropy>=5.0'
             'python-qtpy>=2.0.1'
             'python-pillow>=9.2'
             'python-puremagic>=1.28'
             'python-yaml>=6.0'
             'python-tomli>=2.0.1'
             'python-packaging>=23.1'
             'hicolor-icon-theme')
    optdepends=('python-scipy>=0.18.1: required by Pick, some built-in auto cuts algorithms used when you load an image'
                'python-matplotlib>=3.8: required by Pick, Cuts, Histogram, LineProfile'
                'python-magic>=0.4.15: aids in identifying files when opening them'
                'python-opencv>=4.5.4.58: speeds up rotation, mosaicing and some transformations'
                'python-exifread>=2.3.2: recommended'
                'python-beautifulsoup4>=4.3.2'
                'python-astroquery>=0.3.5: required by Catalogs'
                'python-dateuil: to display help for plugins'
                'python-photutils'
                'python-fitsio: for opening FITS files'
                'python-astlib: for WCS resolution'
                'python-starlink-pyast: for WCS resolution'
                'python-cairo: for gtk3, web, tk backend'
                'python-gobject: for gtk3 backend'
                'python-pyqt5: for qt5 backend'
                'python-pyqt6: for qt6 backend'
                'pyside2: for pyside2 backend'
                'pyside6: for pyside6 backend'
                'python-tornado: for web backend'
                'python-ginga-doc: Documentation for Python-ASDF')
    cd ${srcdir}/${_pyname}-${pkgver}

    install -D -m644 -t "${pkgdir}/usr/share/applications/${pkgname}" ${_pyname}.desktop
    install -d -m755 "${pkgdir}/usr/share/icons/hicolor/scalable/apps"
    install -m644 ${_pyname}/icons/${_pyname}.svg \
        "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${_pyname}.svg"
    install -D -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE.txt licenses/*
    install -D -m644 -t "${pkgdir}/usr/share/doc/${pkgname}" README.md
    python -m installer --destdir="${pkgdir}" dist/*.whl
}