summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a7ac671fcc441ce8f112a6b402b8c63f6b3dc9ad (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
# Maintainer:  Vitalii Kuzhdin <vitaliikuzhdin@gmail.com>

pkgname="matlab-proxy"
pkgver=0.34.0
pkgrel=1
pkgdesc="Open a MATLABĀ® desktop in a web browser tab"
arch=(
  'any'
)
url="https://github.com/mathworks/${pkgname}"
license=(
  'custom:MATHWORKS CLOUD REFERENCE ARCHITECTURE LICENSE'
)
depends=(
  'matlab-release>=R2020b'

  'python>=3.10'
  'python-aiohttp-session'
  'python-aiohttp>=3.7.4'
  'python-psutil'
  'python-requests'
  'python-rich'
  'python-watchdog'

  'python-cryptography'
  'python-urllib3' # listed in test depends
)
# checkdepends=(
#   'python-pytest'
#   # 'python-pytest-env'
#   # 'python-pytest-cov'
#   # 'python-pytest-timeout'
#   'python-pytest-mock'
#   # 'python-pytest-aiohttp'
#   # 'python-pytest-playwright'
#   'python-pytest-asyncio'
# )
makedepends=(
  'npm>=11.6'
  'python-build'
  'python-installer'
  'python-hatchling>=1.27'
)
optdepends=(
  'xorg-server-xvfb: support graphical abilities like plots and figures in the MATLAB desktop'
  'fluxbox: support Simulink Online'
)
provides=(
  "python-${pkgname}=${pkgver}"
)
conflicts=(
  "python-${pkgname}"
)
_pkgsrc="${url##*/}-${pkgver}"
source=(
  "${url}/archive/refs/tags/v${pkgver}/${_pkgsrc}.tar.gz"
)
sha256sums=('429dd04e3ba45f25cfb2f98082a345724d5a457b4ff24d039aa98bf957eaa6b6')

_source() {
  export NPM_CONFIG_CACHE="${srcdir}/.npm"
}

prepare() {
  _source

  cd "${srcdir}/${_pkgsrc}/gui"
  npm install
}

build() {
  _source

  cd "${srcdir}/${_pkgsrc}"
  python -m build --wheel --no-isolation
}

# check() {
#   _source

#   cd "${srcdir}/${_pkgsrc}"
#   pytest
# }

package() {
  local site_packages="$(python -c "import site; print(site.getsitepackages()[0])")"

  cd "${srcdir}/${_pkgsrc}"
  python -m installer --destdir="${pkgdir}" dist/*.whl

  install -vDm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"

  install -vd "${pkgdir}/usr/share/licenses/${pkgname}"
  ln -vsf "${site_packages}/${pkgname//-/_}-${pkgver}.dist-info/licenses/LICENSE.md" \
    "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.md"
}