aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tarantool/APKBUILD
blob: 104f22d22e7366e7b5ad360195adf2ae56438dc3 (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
# 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=1
pkgdesc="Lua application server integrated with a database management system"
url="https://tarantool.org"
arch="all !x86 !ppc64le !s390x"  # bundled LuaJIT is not supported on these
license="BSD-2-Clause MIT Public-Domain"
pkgusers="$pkgname"
pkggroups="$pkgname"
install="$pkgname.pre-install"
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"
builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	default_prepare
	cd "$builddir"

	# 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_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() {
	"$builddir"/src/tarantool --help > /dev/null
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	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"