summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 73460d5ec6e221676d2a5294605a6ce2695538a1 (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
# Maintainer: Michael (https://aur.archlinux.org/account/michael_wzq)
# Contributor: Viktor Drobot (aka dviktor) linux776 [at] gmail [dot] com
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Damir Perisa <damir.perisa@bluewin.ch>

pkgname=openbabel2
pkgver=2.4.1
pkgrel=2
pkgdesc="A library designed to interconvert between many file formats used in molecular modeling and computational chemistry (libs only)"
arch=('x86_64')
url="https://openbabel.org/"
license=('GPL-2.0-only')
depends=(
	'cairo'
	'gcc-libs'
	'glibc'
	'libxml2'
	'openbabel'
	'python'
	'zlib'
)
makedepends=(
	'cmake'
	'eigen'
	'python-setuptools'
	'wxwidgets-gtk3'
)
source=("https://downloads.sourceforge.net/${pkgname%2}/${pkgname%2}-${pkgver}.tar.gz")
md5sums=('d9defcd7830b0592fece4fe54a137b99')

prepare() {
	patch "$srcdir/${pkgname%2}-$pkgver/include/openbabel/obutil.h" ../include-openbabel-obutil-ctime.patch
	patch "$srcdir/${pkgname%2}-$pkgver/test/testpdbformat.py" ../test-testpdbformat.patch
}

build() {
	cmake -B build -S "${pkgname%2}-$pkgver" \
		-DCMAKE_BUILD_TYPE='None' \
		-DCMAKE_INSTALL_PREFIX='/usr' \
		-Wno-dev
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure --stop-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	rm -rf "${pkgdir:?}/usr/bin"
	rm -rf "${pkgdir}/usr/include/inchi"
	rm -rf "${pkgdir}/usr/lib/libinchi.so"
	rm -rf "${pkgdir}/usr/lib/libinchi.so.0"
	rm -rf "${pkgdir}/usr/lib/libinchi.so.0.4.1"
	rm -rf "${pkgdir}/usr/lib/libopenbabel.so"
	rm -rf "${pkgdir}/usr/share/man"
}