summaryrefslogtreecommitdiff
path: root/ipython-ipyparallel/PKGBUILD
blob: d54869e5235a1f03ebb8ba0c9d96e5d20dd7b539 (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
# Maintainer: Erich Eckner <arch at eckner dot net>

pkgbase=ipython-ipyparallel
pkgname=('ipython-ipyparallel' 'ipython2-ipyparallel' 'ipython-ipyparallel-common')
pkgver=6.2.3
pkgrel=1
pkgdesc="Interactive Parallel Computing in Python"
url="https://github.com/ipython/ipyparallel"
arch=(any)
license=('BSD')
_deppy2=(
  'python2>=2.7'
  'python2<2.8'
)
_deppy=(
  'python>=3.7'
  'python<3.8'
)
_depends=(
  'ipython'
)
_makedepends=(
  'python-setuptools'
)
makedepends=(
  "${_deppy[@]}"
  "${_deppy2[@]}"
  "${_makedepends[@]}"
  "${_makedepends[@]/python/python2}"
  "${_depends[@]}"
  "${_depends[@]/python/python2}"
)
source=("https://github.com/ipython/ipyparallel/archive/${pkgver}.tar.gz")
sha512sums=('09b642e37b1a8ad9ccd2cbf3a56112b947325e71893c5f720bdcc7c93c81c68f9ca658caeebd9bc1d5841e5254c899f2e7dddea8e1a5c69fd292a4b17c7aaec4')

_common_files=(
  'etc/'
  'usr/share/'
)

prepare() {
  cp -r "${srcdir}/ipyparallel-$pkgver" "${srcdir}/ipyparallel-$pkgver-py2"
}

build() {
  cd "${srcdir}/ipyparallel-$pkgver"
  python setup.py build
  
  cd "${srcdir}/ipyparallel-$pkgver-py2"
  python2 setup.py build
} 

_package_ipython-ipyparallel() {
  cd "${srcdir}/ipyparallel-$pkgver"
  python setup.py install --root="${pkgdir}"
  mv "${pkgdir}/usr/etc" "${pkgdir}/"
}

package_ipython-ipyparallel() {
  depends=(
    "${_deppy[@]}"
    "${_depends[@]}"
    'ipython-ipyparallel-common'
  )

  _package_ipython-ipyparallel
  for f in "${_common_files[@]}"; do
    rm -r --one-file-system "${pkgdir}/${f}"
  done
}

_package_ipython2-ipyparallel() {
  cd "${srcdir}/ipyparallel-$pkgver-py2"
  python2 setup.py install --root="${pkgdir}"
  mv "${pkgdir}"/usr/bin/ipcluster "${pkgdir}"/usr/bin/ipcluster2
  mv "${pkgdir}"/usr/bin/ipcontroller "${pkgdir}"/usr/bin/ipcontroller2
  mv "${pkgdir}"/usr/bin/ipengine "${pkgdir}"/usr/bin/ipengine2
  mv "${pkgdir}/usr/etc" "${pkgdir}/"
}

package_ipython2-ipyparallel() {
  depends=(
    "${_deppy2[@]}"
    "${_depends[@]/python/python2}"
    'ipython-ipyparallel-common'
  )

  _package_ipython2-ipyparallel
  for f in "${_common_files[@]}"; do
    rm -r --one-file-system "${pkgdir}/${f}"
  done
}

package_ipython-ipyparallel-common() {
  mkdir -p "${srcdir}/pkg" "${srcdir}/pkg2"
  pkgdir="${srcdir}/pkg" _package_ipython-ipyparallel
  pkgdir="${srcdir}/pkg2" _package_ipython2-ipyparallel

  for f in "${_common_files[@]}"; do
    diff -r "${srcdir}/pkg"{,2}"/${f}"
    mkdir -p "${pkgdir}/${f}"
    cp -ra "${srcdir}/pkg/${f}" "${pkgdir}/${f}"
  done
}