aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tarantool/APKBUILD
blob: 20ba83762f760332670cfe5911ee24f7d1bc3af7 (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer:
pkgname=tarantool
pkgver=1.7.4.335
_series=${pkgver%.*}; _series=${_series%.*}  # x.y
pkgrel=4
pkgdesc="Lua application server integrated with a database management system"
url="https://tarantool.org"
# x86, aarch64: fails to build
# armhf: zstd not available (fails to build)
# ppc64le: not supported by LuaJIT w/o patches
# s390x: not supported by LuaJIT
arch="x86_64"
license="BSD-2-Clause MIT Public-Domain"
pkgusers="$pkgname"
pkggroups="$pkgname"
install="$pkgname.pre-install"
checkdepends="python2-dev py2-argparse py2-gevent py2-msgpack py2-six py2-yaml"
makedepends="cmake curl-dev luajit-dev libcoro-dev libressl-dev msgpuck-dev
	perl python2 readline-dev yaml-dev zstd-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="http://download.tarantool.org/tarantool/$_series/src/$pkgname-$pkgver.tar.gz
	$pkgname.initd
	unbundle-dependencies.patch
	tests-musl-compat.patch
	tests-libressl-compat.patch"
builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	default_prepare
	cd "$builddir"

	# XXX: This test doesn't work, probably due to fakeroot.
	rm test/xlog-py/misc.test.py

	# msgpuck.h is in /usr/include, not /usr/include/msgpuck.
	find . -name '*.c' -o -name '*.cc' \
		| xargs -n 1 sed -Ei 's|#include\s*["<]msgpuck/msgpuck\.h[">]|#include <msgpuck.h>|'

	# Remove bundled libraries.
	rm -r src/lib/msgpuck
	cd third_party
	rm -r coro libyaml zstd
}

build() {
	cd "$builddir"

	# Bundled libraries:
	# - libgopt (Public Domain): probably patched, it does not correspond
	#   to 8.1 as stated in header
	# - luajit (MIT): tarantool requires non-exported symbols, so cannot link
	#   dynamically; linking with system static libluajit doesn't work too
	cmake \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DCMAKE_SKIP_RPATH=ON \
		-DCMAKE_VERBOSE_MAKEFILE=ON \
		-DENABLE_BUNDLED_LIBCORO=OFF \
		-DENABLE_BUNDLED_LIBGOPT=ON \
		-DENABLE_BUNDLED_LIBYAML=OFF \
		-DENABLE_BUNDLED_LUAJIT=ON \
		-DENABLE_BUNDLED_MSGPUCK=OFF \
		-DENABLE_BUNDLED_ZSTD=OFF \
		-DENABLE_DIST=ON \
		-DWITH_SYSVINIT=OFF \
		-DWITH_SYSTEMD=OFF
	make VERBOSE=1 -j2  # there's some problem with parallel build
}

check() {
	cd "$builddir"/test

	../src/tarantool --help > /dev/null

	# TODO: Some tests are broken, fix it!
	# --force means that it will not stop after first error.
	#python2 test-run.py --force
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install
	rm -R "$pkgdir"/etc/default

	install -Dm755 "$srcdir"/tarantool.initd "$pkgdir"/etc/init.d/tarantool
}

sha512sums="c95a6900d9e9b9963bb038f28f3e47d0f8fd66159efef99b98b792cd08748481043d9a2a39c1c455094725e1ac213df731280587b93746ecb7bea2431deb7bf3  tarantool-1.7.4.335.tar.gz
fe463c4b6ab8708ea6ec17bb6a887677ae131a489d2ce299ce951790b7c134ff356bc1a4d4745878beec3600ec702944c2329a3f02645f8ab0a0eb24edb6215a  tarantool.initd
b48eefdf71e20db22c4366e4573441a0d4e5f6e727fc23b2b41534e8d5cc7dc9cc08baf2bf1cf1950c7b0e211920abb4254c2d1e972ec884db25800820824f2c  unbundle-dependencies.patch
f6fec037780f830eb353b184d190b5dc8b481164c9cd06991f921d70be8cababb5dba43e5af96abe6fb87fda44c5573d706f7b032bc996d33debb7811b84addb  tests-musl-compat.patch
146744f2e7265de2644c03d7beb6ce1657b63a99db9c4527cb603c915082dc1184a90e92ba39bfb946f2f8f7a2b866cc8343c7e865d4245fe704447a59cc4846  tests-libressl-compat.patch"