summaryrefslogtreecommitdiff
path: root/python-pymca/PKGBUILD
blob: 81020414b7e54ddc0238a37fb3e39f4d54b551c3 (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
# Maintainer: Erich Eckner <arch at eckner dot net>
pkgbase=python-pymca
pkgname=(python2-pymca python-pymca)
_pkgname="${pkgbase#*-}"
pkgver=5.5.4
pkgrel=1
pkgdesc='Stand-alone application and Python tools for interactive and/or batch processing analysis of X-Ray Fluorescence Spectra'
arch=('i686' 'pentium4' 'x86_64')
url='http://pymca.sourceforge.net/index.html'
license=('MIT License')
_deppy2=(
  'python2>=2.7'
  'python2<2.8'
)
_deppy=(
  'python>=3.8'
  'python<3.9'
)
_depends=(
  'python-fisx>=1.1.5'
  'python-h5py'
  'python-matplotlib>1.0'
  'python-numpy'
  'python-numpy>=1.8'
#  'python-pyopengl'
#  'python-pyqt4'
  'python-pyqt5'
  'python-qtconsole')
_makedepends=(
  'python-setuptools')
_optdepends=(
  'python-pyqt5: gui'
  'python-matplotlib: gui')
makedepends=(
  "${_deppy[@]}"
  "${_deppy2[@]}"
  "${_depends[@]}"
  "${_depends[@]/python/python2}"
  "${_makedepends[@]}"
  "${_makedepends[@]/ython/ython2}"
)
source=(
    "${_pkgname}-v${pkgver}.tar.gz::https://github.com/vasole/${_pkgname}/archive/v${pkgver}.tar.gz"
)
sha512sums=('f9623bab9e44c1a38bc597f70fbea70fc0d493be7f2a83737e6b284c89bbb1e5dcdf2fb6d29b0cfbf87c8bad5fc55ced990917ce7306218b411247885c78fea4')

prepare() {
  cp -a ${_pkgname}-${pkgver}{,-py2}
}

build() {
  echo "Building python..."
  (
    cd ${_pkgname}-${pkgver}
    python setup.py build
  )
  echo "Building python2..."
  (
    cd ${_pkgname}-${pkgver}-py2
    python2 setup.py build
  )
}

package_python2-pymca() {
  depends=(
    "${_deppy2[@]}"
    "${_depends[@]/python/python2}"
  )
  optdepends=(
    "${_optdepends[@]/python/python2}"
  )
  cd ${_pkgname}-${pkgver}-py2
  python2 setup.py install --skip-build --root="${pkgdir}" --prefix=/usr
  find "${pkgdir}" -type f -exec sed -si '1 s#[/ ]python\s*$# python2#' {} +
}

package_python-pymca() {
  depends=(
    "${_deppy[@]}"
    "${_depends[@]}"
  )
  optdepends=(
    "${_optdepends[@]}"
  )
  cd ${_pkgname}-${pkgver}
  python setup.py install --skip-build --root="${pkgdir}" --prefix=/usr
}