upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / pymol / trunk / PKGBUILD
blob6562933fee7f81dd9669b9d7c56fbe2338d1a8ed
1 # Maintainer: Caleb Maclennan <caleb@alerque.com>
2 # Contributor: Evgeniy Alekseev <arcanis at archlinux dot org>
3 # Contributor: graysky
4 # Contributor: Tomasz Żok <tomasz dot zok at gmail dot com>
6 pkgname=pymol
7 _project=pymol-open-source
8 pkgver=2.5.0
9 pkgrel=7
10 pkgdesc='Molecular visualization system on an Open Source foundation'
11 arch=(x86_64)
12 url=https://pymol.org
13 license=(custom)
14 depends=(freetype2
15          glew
16          glm
17          glut
18          netcdf
19          netcdf-cxx
20          python-numpy
21          tcsh)
22 makedepends=(desktop-file-utils
23              gendesk
24              mmtf-cpp
25              msgpack-c
26              python-{build,installer,wheel}
27              python-setuptools)
28 optdepends=('python-pyqt5: Qt5 based UI')
29 _archive="$_project-$pkgver"
30 source=("https://github.com/schrodinger/pymol-open-source/archive/v$pkgver/$_archive.tar.gz"
31         "$pkgname.png::https://c.fsdn.com/allura/p/pymol/icon")
32 sha256sums=('aa828bf5719bd9a14510118a93182a6e0cadc03a574ba1e327e1e9780a0e80b3'
33             '0ea81faaf336becc669a193777d0dca55475d303d1236b57df25cf67ff7c2bcd')
34 changelog=ChangeLog
36 prepare() {
37         # create desktop file
38         gendesk -f -n \
39                         --pkgname "$pkgname" \
40                         --name="PyMOL Molecular Graphics System" \
41                         --pkgdesc "$pkgdesc" \
42                         --exec="$pkgname %F" \
43                         --mimetypes="chemical/x-pdb;chemical/pdby;chemical/x-mol2;chemical/x-mdl-molfile;chemical/x-mdl-sdfile;chemical/x-xyz;chemical/x-macromodel-input;chemical/x-vmd" \
44                         --categories="Science;Chemistry"
45         cd "$_archive"
46         # suppress non-zero exit code that breaks makepkg
47         sed -i -e '/sys.exit/ s,2,0,' setup.py
48         # setup script PEP 517 compatiblitiy is broken
49         local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
50         sed -i -E '/def (finalize_options|make_launch_script)/a \        self.install_libbase="'$site_packages'"' setup.py
53 build() {
54         cd "$_archive"
55         python -m build -wn
58 package() {
59         install -Dm0644 -t "$pkgdir/usr/share/applications/" "$pkgname.desktop"
60         install -Dm0644 -t "$pkgdir/usr/share/pixmaps/" "$pkgname.png"
61         cd "$_archive"
62         python -m installer -d "$pkgdir" dist/*.whl
63         install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE