blob: 8cd29538a9f0ddd7b89bd0fc50090b76668e128e (
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
|
# Maintainer: Jingbei Li <i@jingbei.li>
# Contributor: Chih-Hsuan Yen <yan12125@archlinux.org>
# Contributor: Filipe Bertelli <filipebertelli@tutanota.com>
# Contributor: J. C. Hammons <jch at bitma dot st>
# Contributor: Amr Okasha <amradel55 at gmail dot com>
# Contributor: Dimitris Kiziridis <ragouel at outlook dot com>
pkgbase=netron
pkgname=(netron)
##pkgname+=(netron-cli)
pkgdesc='Visualizer for neural network, deep learning, and machine learning models'
pkgver=7.8.9
pkgrel=1
url='https://netron.app/'
arch=(x86_64)
license=(MIT)
depends=(python)
makedepends=(gendesk npm python-setuptools python-build python-installer python-wheel)
optdepends=(
'python-onnx: serializing ONNX models'
'python-pytorch: serializing PyTorch models'
)
source=("https://github.com/lutzroeder/netron/archive/v${pkgver}/netron-${pkgver}.tar.gz")
sha256sums=('9fea57f8296728af802584d98925648ec0881dae1077c060aba21c8d227bf41d')
prepare() {
cd "${pkgbase}-${pkgver}"
# Use dependencies from Arch
sed '/python -m pip/d' -i package.js
# Disable mac and windows builds
sed -e '/--mac /d' -e '/--win /d' -i package.js
}
build() {
cd "${pkgbase}-${pkgver}"
npm run clean
npm run build python
npm run build electron
}
package_netron() {
depends+=('gtk3' 'nss' 'dbus-glib' 'libdbusmenu-glib')
provides=('netron' 'netron-cli')
conflicts=('netron-cli' 'netron-bin')
cd "${pkgbase}-${pkgver}"
python -m installer --destdir="$pkgdir" dist/pypi/*.whl
#mv "${pkgdir}/usr/bin/${pkgbase}" "${pkgdir}/usr/bin/${pkgbase}-cli"
mkdir -p "${pkgdir}/opt/"
cp -r dist/linux-unpacked "${pkgdir}/opt/${pkgname}"
#ln -s "/opt/${pkgname}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
install -Dm644 publish/icon.png "${pkgdir}/usr/share/pixmaps/${pkgbase}.png"
gendesk -f -n --pkgname "${pkgname}" \
--pkgdesc "${pkgdesc}" \
--name "Netron" \
--comment "${pkgdesc}" \
--exec "/opt/${pkgname}/${pkgname}" \
--categories 'Development;Application;' \
--icon "${pkgname}"
install -Dm644 "${pkgname}.desktop" -t "${pkgdir}/usr/share/applications"
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
package_netron-cli() {
pkgdesc="${pkgdesc} (CLI only)"
arch=(any)
conflicts=('netron')
cd "${pkgbase}-${pkgver}"
python -m installer --destdir="$pkgdir" dist/pypi/*.whl
#mv "${pkgdir}/usr/bin/${pkgbase}" "${pkgdir}/usr/bin/${pkgbase}-cli"
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
|