aboutsummaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2020-05-31 16:50:03 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2020-05-31 16:50:03 +0200
commita4f57ed44816a99f2ba81f514c146ec3d681a1b7 (patch)
tree6e10ee9ee4c17bcfdd63f4df11290cd733fd69e4 /testing
parent73f6143a0e54095d813eb741ffa6cc05724d9120 (diff)
downloadalpine_aports-a4f57ed44816a99f2ba81f514c146ec3d681a1b7.tar.bz2
alpine_aports-a4f57ed44816a99f2ba81f514c146ec3d681a1b7.tar.xz
alpine_aports-a4f57ed44816a99f2ba81f514c146ec3d681a1b7.zip
unmaintained/tarantool: move from testing
* Disabled on all arches * Doesn't have a maintainer * Still requires python2
Diffstat (limited to 'testing')
-rw-r--r--testing/tarantool/APKBUILD102
-rw-r--r--testing/tarantool/fix-compilation-with-libcurl-7.62.0.patch46
-rw-r--r--testing/tarantool/tarantool.initd19
-rw-r--r--testing/tarantool/tarantool.pre-install6
-rw-r--r--testing/tarantool/tests-libressl-compat.patch35
-rw-r--r--testing/tarantool/tests-musl-compat.patch13
-rw-r--r--testing/tarantool/unbundle-dependencies.patch266
7 files changed, 0 insertions, 487 deletions
diff --git a/testing/tarantool/APKBUILD b/testing/tarantool/APKBUILD
deleted file mode 100644
index 177b7cec63..0000000000
--- a/testing/tarantool/APKBUILD
+++ /dev/null
@@ -1,102 +0,0 @@
1# Contributor: Carlo Landmeter <clandmeter@gmail.com>
2# Contributor: Jakub Jirutka <jakub@jirutka.cz>
3# Maintainer:
4pkgname=tarantool
5pkgver=1.7.4.335
6_series=${pkgver%.*}; _series=${_series%.*} # x.y
7pkgrel=8
8pkgdesc="Lua application server integrated with a database management system"
9url="https://tarantool.org"
10# x86, aarch64: fails to build
11# armhf: zstd not available (fails to build)
12# ppc64le: not supported by LuaJIT w/o patches
13# s390x: not supported by LuaJIT
14arch=""
15license="BSD-2-Clause MIT Public-Domain"
16pkgusers="$pkgname"
17pkggroups="$pkgname"
18install="$pkgname.pre-install"
19checkdepends="python2-dev py2-argparse py2-gevent py2-msgpack py2-six py2-yaml"
20makedepends="cmake curl-dev luajit-dev libcoro-dev openssl-dev msgpuck-dev
21 perl python2 readline-dev yaml-dev zstd-dev"
22subpackages="$pkgname-dev $pkgname-doc"
23source="http://download.tarantool.org/tarantool/$_series/src/$pkgname-$pkgver.tar.gz
24 $pkgname.initd
25 unbundle-dependencies.patch
26 tests-musl-compat.patch
27 tests-libressl-compat.patch
28 fix-compilation-with-libcurl-7.62.0.patch
29 "
30builddir="$srcdir/$pkgname-$pkgver"
31
32prepare() {
33 default_prepare
34 cd "$builddir"
35
36 # XXX: This test doesn't work, probably due to fakeroot.
37 rm test/xlog-py/misc.test.py
38
39 # msgpuck.h is in /usr/include, not /usr/include/msgpuck.
40 find . -name '*.c' -o -name '*.cc' \
41 | xargs -n 1 sed -Ei 's|#include\s*["<]msgpuck/msgpuck\.h[">]|#include <msgpuck.h>|'
42
43 # Remove bundled libraries.
44 rm -r src/lib/msgpuck
45 cd third_party
46 rm -r coro libyaml zstd
47}
48
49build() {
50 cd "$builddir"
51
52 # Bundled libraries:
53 # - libgopt (Public Domain): probably patched, it does not correspond
54 # to 8.1 as stated in header
55 # - luajit (MIT): tarantool requires non-exported symbols, so cannot link
56 # dynamically; linking with system static libluajit doesn't work too
57 cmake \
58 -DCMAKE_BUILD_TYPE=None \
59 -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
60 -DCMAKE_C_FLAGS="$CFLAGS" \
61 -DCMAKE_INSTALL_PREFIX=/usr \
62 -DCMAKE_INSTALL_LIBDIR=lib \
63 -DCMAKE_INSTALL_SYSCONFDIR=/etc \
64 -DCMAKE_SKIP_RPATH=ON \
65 -DCMAKE_VERBOSE_MAKEFILE=ON \
66 -DENABLE_BUNDLED_LIBCORO=OFF \
67 -DENABLE_BUNDLED_LIBGOPT=ON \
68 -DENABLE_BUNDLED_LIBYAML=OFF \
69 -DENABLE_BUNDLED_LUAJIT=ON \
70 -DENABLE_BUNDLED_MSGPUCK=OFF \
71 -DENABLE_BUNDLED_ZSTD=OFF \
72 -DENABLE_DIST=ON \
73 -DWITH_SYSVINIT=OFF \
74 -DWITH_SYSTEMD=OFF
75 make VERBOSE=1 -j2 # there's some problem with parallel build
76}
77
78check() {
79 cd "$builddir"/test
80
81 ../src/tarantool --help > /dev/null
82
83 # TODO: Some tests are broken, fix it!
84 # --force means that it will not stop after first error.
85 #python2 test-run.py --force
86}
87
88package() {
89 cd "$builddir"
90
91 make DESTDIR="$pkgdir" install
92 rm -R "$pkgdir"/etc/default
93
94 install -Dm755 "$srcdir"/tarantool.initd "$pkgdir"/etc/init.d/tarantool
95}
96
97sha512sums="c95a6900d9e9b9963bb038f28f3e47d0f8fd66159efef99b98b792cd08748481043d9a2a39c1c455094725e1ac213df731280587b93746ecb7bea2431deb7bf3 tarantool-1.7.4.335.tar.gz
98fe463c4b6ab8708ea6ec17bb6a887677ae131a489d2ce299ce951790b7c134ff356bc1a4d4745878beec3600ec702944c2329a3f02645f8ab0a0eb24edb6215a tarantool.initd
99b48eefdf71e20db22c4366e4573441a0d4e5f6e727fc23b2b41534e8d5cc7dc9cc08baf2bf1cf1950c7b0e211920abb4254c2d1e972ec884db25800820824f2c unbundle-dependencies.patch
100f6fec037780f830eb353b184d190b5dc8b481164c9cd06991f921d70be8cababb5dba43e5af96abe6fb87fda44c5573d706f7b032bc996d33debb7811b84addb tests-musl-compat.patch
101146744f2e7265de2644c03d7beb6ce1657b63a99db9c4527cb603c915082dc1184a90e92ba39bfb946f2f8f7a2b866cc8343c7e865d4245fe704447a59cc4846 tests-libressl-compat.patch
102db687fee5cc6cc975d560f17abf51a6a258a964ab1322ee5d209a153d98c80263fc36f0ae8e78d480dc9f0fb68d4de1e01174d111eb21e794c89d38934b85b01 fix-compilation-with-libcurl-7.62.0.patch"
diff --git a/testing/tarantool/fix-compilation-with-libcurl-7.62.0.patch b/testing/tarantool/fix-compilation-with-libcurl-7.62.0.patch
deleted file mode 100644
index 41d5cc5382..0000000000
--- a/testing/tarantool/fix-compilation-with-libcurl-7.62.0.patch
+++ /dev/null
@@ -1,46 +0,0 @@
1From 02da15f7109b8bb7921eb97a751607b9dd2885b2 Mon Sep 17 00:00:00 2001
2From: Vladimir Davydov <vdavydov.dev@gmail.com>
3Date: Thu, 1 Nov 2018 13:35:24 +0300
4Subject: [PATCH] httpc: fix compilation with libcurl >= 7.62.0
5
6Starting from libcurl 7.62.0, CURL_SSL_CACERT is defined as a macro
7alias to CURLE_PEER_FAILED_VERIFICATION, see
8
9 https://github.com/curl/curl/commit/3f3b26d6feb0667714902e836af608094235fca2
10
11This breaks compilation:
12
13 httpc.c:337:7: error: duplicate case value 'CURLE_PEER_FAILED_VERIFICATION'
14 case CURLE_PEER_FAILED_VERIFICATION:
15 ^
16 httpc.c:336:7: note: previous case defined here
17 case CURLE_SSL_CACERT:
18 ^
19 curl.h:589:26: note: expanded from macro 'CURLE_SSL_CACERT'
20 #define CURLE_SSL_CACERT CURLE_PEER_FAILED_VERIFICATION
21 ^
22
23Fix this by using CURLE_SSL_CACERT only if libcurl version is less
24than 7.62.0.
25
26Note, we can't use CURL_AT_LEAST_VERSION to check libcurl version,
27because it isn't available in libcurl shipped with CentOS 6.
28---
29 src/httpc.c | 4 +++-
30 1 file changed, 3 insertions(+), 1 deletion(-)
31
32diff --git a/src/httpc.c b/src/httpc.c
33index 4d48a313d8..950f8b32f6 100644
34--- a/src/httpc.c
35+++ b/src/httpc.c
36@@ -333,7 +333,9 @@ httpc_execute(struct httpc_request *req, double timeout)
37 ++env->stat.http_other_responses;
38 }
39 break;
40- case CURLE_SSL_CACERT:
41+#if LIBCURL_VERSION_NUM < 0x073e00
42+ case CURLE_SSL_CACERT: /* deprecated in libcurl 7.62.0 */
43+#endif
44 case CURLE_PEER_FAILED_VERIFICATION:
45 /* 495 SSL Certificate Error (nginx non-standard) */
46 req->status = 495;
diff --git a/testing/tarantool/tarantool.initd b/testing/tarantool/tarantool.initd
deleted file mode 100644
index 18bc5c128f..0000000000
--- a/testing/tarantool/tarantool.initd
+++ /dev/null
@@ -1,19 +0,0 @@
1#!/sbin/openrc-run
2
3INSTANCE=default
4[ "${RC_SVCNAME}" != "${RC_SVCNAME##*.}" ] && INSTANCE=${RC_SVCNAME##*.}
5command="/usr/bin/tarantoolctl"
6command_user="${TARANTOOL_USER:-tarantool}"
7command_args="start ${INSTANCE}"
8pidfile="/run/${INSTANCE}.pid"
9
10depend() {
11 use logger dns
12 need net
13 after firewall
14}
15
16start_pre() {
17 checkpath --owner ${TARANTOOL_USER:-tarantool}:${TARANTOOL_USER:-tarantool} \
18 --directory --mode 0775 /var/log/tarantool /var/run/tarantool
19}
diff --git a/testing/tarantool/tarantool.pre-install b/testing/tarantool/tarantool.pre-install
deleted file mode 100644
index ba1ed08258..0000000000
--- a/testing/tarantool/tarantool.pre-install
+++ /dev/null
@@ -1,6 +0,0 @@
1#!/bin/sh
2
3addgroup -S tarantool 2>/dev/null
4adduser -S -D -h /var/lib/tarantool -s /sbin/nologin -G tarantool -g tarantool tarantool 2>/dev/null
5
6exit 0
diff --git a/testing/tarantool/tests-libressl-compat.patch b/testing/tarantool/tests-libressl-compat.patch
deleted file mode 100644
index 7816bf406a..0000000000
--- a/testing/tarantool/tests-libressl-compat.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1Fix crypto/digest tests to be compatible with LibreSSL.
2
3--- a/test/app/crypto.result
4+++ b/test/app/crypto.result
5@@ -111,13 +111,13 @@
6 ...
7 ciph.decrypt(enc, bad_pass, iv)
8 ---
9-- error: 'builtin/crypto.lua:<line>"]: Can''t finalize cipher:error:06065064:digital envelope
10- routines:EVP_DecryptFinal_ex:bad decrypt'
11+- error: 'builtin/crypto.lua:<line>"]: Can''t finalize cipher:error:06FFF064:digital envelope
12+ routines:CRYPTO_internal:bad decrypt'
13 ...
14 ciph.decrypt(enc, pass, bad_iv)
15 ---
16-- error: 'builtin/crypto.lua:<line>"]: Can''t finalize cipher:error:06065064:digital envelope
17- routines:EVP_DecryptFinal_ex:bad decrypt'
18+- error: 'builtin/crypto.lua:<line>"]: Can''t finalize cipher:error:06FFF064:digital envelope
19+ routines:CRYPTO_internal:bad decrypt'
20 ...
21 test_run:cmd("clear filter")
22 ---
23--- a/test/app/digest.result
24+++ b/test/app/digest.result
25@@ -445,8 +445,8 @@
26 ...
27 digest.aes256cbc.decrypt(digest.aes256cbc.encrypt('test123', 'passpasspasspasspasspasspasspass', 'iv12tras8712cvbh'), 'nosspasspasspasspasspasspasspass', 'iv12tras8712cvbh')
28 ---
29-- error: 'builtin/crypto.lua:<line>"]: Can''t finalize cipher:error:06065064:digital envelope
30- routines:EVP_DecryptFinal_ex:bad decrypt'
31+- error: 'builtin/crypto.lua:<line>"]: Can''t finalize cipher:error:06FFF064:digital envelope
32+ routines:CRYPTO_internal:bad decrypt'
33 ...
34 digest = nil
35 ---
diff --git a/testing/tarantool/tests-musl-compat.patch b/testing/tarantool/tests-musl-compat.patch
deleted file mode 100644
index f39fb8735b..0000000000
--- a/testing/tarantool/tests-musl-compat.patch
+++ /dev/null
@@ -1,13 +0,0 @@
1Fix fiber test to be compatible with musl libc.
2
3--- a/test/unit/fiber.result
4+++ b/test/unit/fiber.result
5@@ -1,6 +1,6 @@
6-#gh-1238: log uncaught errors
7-SystemError Failed to allocate 42 bytes in allocator for exception: Cannot allocate memory
8 *** fiber_name_test ***
9+#gh-1238: log uncaught errors
10+SystemError Failed to allocate 42 bytes in allocator for exception: Out of memory
11 # name of a new fiber: main.
12
13 # set new fiber name: Horace.
diff --git a/testing/tarantool/unbundle-dependencies.patch b/testing/tarantool/unbundle-dependencies.patch
deleted file mode 100644
index 864873e3f9..0000000000
--- a/testing/tarantool/unbundle-dependencies.patch
+++ /dev/null
@@ -1,266 +0,0 @@
1--- a/CMakeLists.txt
2+++ b/CMakeLists.txt
3@@ -330,18 +330,29 @@
4 # in the top level CMakeLists.txt, to ensure a consistent
5 # header file layout across the entire project.
6 #
7-set(ENABLE_BUNDLED_LIBCORO ON)
8-include(BuildLibCORO)
9-libcoro_build()
10-add_dependencies(build_bundled_libs coro)
11+option(ENABLE_BUNDLED_LIBCORO "Enable building of the bundled libcoro" ON)
12+if (ENABLE_BUNDLED_LIBCORO)
13+ include(BuildLibCORO)
14+ libcoro_build()
15+ add_dependencies(build_bundled_libs coro)
16+else()
17+ set(LIBCORO_FIND_REQUIRED ON)
18+ find_package(LibCORO)
19+endif()
20
21 #
22 # LibGOPT
23 #
24
25-include(BuildLibGOPT)
26-libgopt_build()
27-add_dependencies(build_bundled_libs gopt)
28+option(ENABLE_BUNDLED_LIBGOPT "Enable building of the bundled gopt" ON)
29+if (ENABLE_BUNDLED_LIBGOPT)
30+ include(BuildLibGOPT)
31+ libgopt_build()
32+ add_dependencies(build_bundled_libs gopt)
33+else()
34+ set(LIBGOPT_FIND_REQUIRED ON)
35+ find_package(LibGOPT)
36+endif()
37
38 #
39 # MsgPuck
40@@ -377,11 +388,14 @@
41 # zstd
42 #
43
44-# Debian: missing zstd_static.h in libzstd-dev
45-# Fedora: not found
46-# => always use bundled version
47-include(BuildZSTD)
48-zstd_build()
49+option(ENABLE_BUNDLED_ZSTD "Enable building of the bundled zstd" ON)
50+if (ENABLE_BUNDLED_ZSTD)
51+ include(BuildZSTD)
52+ zstd_build()
53+else()
54+ set(LIBZSTD_FIND_REQUIRED ON)
55+ find_package(ZSTD)
56+endif()
57
58 #
59 # OpenSSL
60--- /dev/null
61+++ b/cmake/FindLibCORO.cmake
62@@ -0,0 +1,24 @@
63+find_path(LIBCORO_INCLUDE_DIR
64+ NAMES coro.h
65+)
66+
67+find_library(LIBCORO_LIBRARY
68+ NAMES libcoro.a coro
69+)
70+
71+set(LIBCORO_INCLUDE_DIRS "${LIBCORO_INCLUDE_DIR}")
72+set(LIBCORO_LIBRARIES "${LIBCORO_LIBRARY}")
73+
74+include(FindPackageHandleStandardArgs)
75+find_package_handle_standard_args(LIBCORO REQUIRED_VARS
76+ LIBCORO_LIBRARIES LIBCORO_INCLUDE_DIRS)
77+
78+mark_as_advanced(LIBCORO_LIBRARY LIBCORO_LIBRARIES
79+ LIBCORO_INCLUDE_DIR LIBCORO_INCLUDE_DIRS)
80+
81+if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "amd64"
82+ OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
83+ add_definitions("-DCORO_ASM")
84+else()
85+ add_definitions("-DCORO_SJLJ")
86+endif()
87--- /dev/null
88+++ b/cmake/FindLibGOPT.cmake
89@@ -0,0 +1,17 @@
90+find_path(LIBGOPT_INCLUDE_DIR
91+ NAMES gopt.h
92+)
93+
94+find_library(LIBGOPT_LIBRARY
95+ NAMES libgopt.a gopt
96+)
97+
98+set(LIBGOPT_INCLUDE_DIRS "${LIBGOPT_INCLUDE_DIR}")
99+set(LIBGOPT_LIBRARIES "${LIBGOPT_LIBRARY}")
100+
101+include(FindPackageHandleStandardArgs)
102+find_package_handle_standard_args(LIBGOPT REQUIRED_VARS
103+ LIBGOPT_LIBRARIES LIBGOPT_INCLUDE_DIRS)
104+
105+mark_as_advanced(LIBGOPT_LIBRARY LIBGOPT_LIBRARIES
106+ LIBGOPT_INCLUDE_DIR LIBGOPT_INCLUDE_DIRS)
107--- /dev/null
108+++ b/cmake/FindZSTD.cmake
109@@ -0,0 +1,17 @@
110+find_path(ZSTD_INCLUDE_DIR
111+ NAMES zstd.h
112+)
113+
114+find_library(ZSTD_LIBRARY
115+ NAMES zstd
116+)
117+
118+set(ZSTD_INCLUDE_DIRS "${ZSTD_INCLUDE_DIR}")
119+set(ZSTD_LIBRARIES "${ZSTD_LIBRARY}")
120+
121+include(FindPackageHandleStandardArgs)
122+find_package_handle_standard_args(ZSTD REQUIRED_VARS
123+ ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS)
124+
125+mark_as_advanced(ZSTD_LIBRARY ZSTD_LIBRARIES
126+ ZSTD_INCLUDE_DIR ZSTD_INCLUDE_DIRS)
127--- a/src/main.cc
128+++ b/src/main.cc
129@@ -67,7 +67,7 @@
130 #include "random.h"
131 #include "tt_uuid.h"
132 #include "iobuf.h"
133-#include <third_party/gopt/gopt.h>
134+#include <gopt.h>
135 #include "cfg.h"
136 #include "version.h"
137 #include <readline/readline.h>
138--- a/src/fiber.h
139+++ b/src/fiber.h
140@@ -44,7 +44,7 @@
141 #include "small/rlist.h"
142 #include "salad/stailq.h"
143
144-#include <third_party/coro/coro.h>
145+#include <coro.h>
146
147 #if defined(__cplusplus)
148 extern "C" {
149--- a/src/opts.c
150+++ b/src/opts.c
151@@ -31,7 +31,7 @@
152 #include "trivia/config.h"
153 #include <stddef.h>
154
155-#include <third_party/gopt/gopt.h>
156+#include <gopt.h>
157
158 const void *opt_def =
159 gopt_start(
160--- a/src/CMakeLists.txt
161+++ b/src/CMakeLists.txt
162@@ -47,15 +47,15 @@
163 lua_source(lua_sources lua/httpc.lua)
164 lua_source(lua_sources lua/iconv.lua)
165 # LuaJIT jit.* library
166-lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/bc.lua")
167-lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/bcsave.lua")
168-lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/dis_x86.lua")
169-lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/dis_x64.lua")
170-lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/dump.lua")
171-lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/vmdef.lua")
172-lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/v.lua")
173-lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/p.lua")
174-lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/zone.lua")
175+lua_source(lua_sources "${LUAJIT_JITLIB_DIR}/bc.lua")
176+lua_source(lua_sources "${LUAJIT_JITLIB_DIR}/bcsave.lua")
177+lua_source(lua_sources "${LUAJIT_JITLIB_DIR}/dis_x86.lua")
178+lua_source(lua_sources "${LUAJIT_JITLIB_DIR}/dis_x64.lua")
179+lua_source(lua_sources "${LUAJIT_JITLIB_DIR}/dump.lua")
180+lua_source(lua_sources "${LUAJIT_JITLIB_DIR}/vmdef.lua")
181+lua_source(lua_sources "${LUAJIT_JITLIB_DIR}/v.lua")
182+lua_source(lua_sources "${LUAJIT_JITLIB_DIR}/p.lua")
183+lua_source(lua_sources "${LUAJIT_JITLIB_DIR}/zone.lua")
184
185 add_custom_target(generate_lua_sources
186 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src/box
187
188@@ -197,10 +197,11 @@
189 # Rule of thumb: if exporting a symbol from a static library, list the
190 # library here.
191 set (reexport_libraries server core misc bitset csv
192- ${LUAJIT_LIBRARIES} ${MSGPUCK_LIBRARIES})
193+ ${MSGPUCK_LIBRARIES})
194
195 set (common_libraries
196 ${reexport_libraries}
197+ ${LUAJIT_LIBRARIES}
198 ${LIBEIO_LIBRARIES}
199 ${LIBGOPT_LIBRARIES}
200 ${LIBYAML_LIBRARIES}
201--- a/cmake/luajit.cmake
202+++ b/cmake/luajit.cmake
203@@ -38,6 +38,7 @@
204 set (LUAJIT_PREFIX "${LUAJIT_BUNDLED_PREFIX}")
205 set (LUAJIT_INCLUDE "${PROJECT_SOURCE_DIR}/third_party/luajit/src")
206 set (LUAJIT_LIB "${LUAJIT_BUNDLED_LIB}")
207+ set (LUAJIT_JITLIB_DIR "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit")
208 set (ENABLE_BUNDLED_LUAJIT True)
209 endmacro()
210
211@@ -63,10 +64,12 @@
212 # usable with the server (determined by a compiled test).
213 #
214 macro (luajit_try_system)
215- find_path (LUAJIT_INCLUDE lj_obj.h PATH_SUFFIXES luajit-2.0 luajit)
216+ find_path (LUAJIT_INCLUDE lj_obj.h PATH_SUFFIXES luajit-2.1 luajit)
217 find_library (LUAJIT_LIB NAMES luajit luajit-5.1 PATH_SUFFIXES x86_64-linux-gnu)
218- if (LUAJIT_INCLUDE AND LUAJIT_LIB)
219- message (STATUS "include: ${LUAJIT_INCLUDE}, lib: ${LUAJIT_LIB}")
220+ file (GLOB LUAJIT_JITLIB_SEARCH_PATHS "/usr/local/share/luajit-2.1*/jit" "/usr/share/luajit-2.1*/jit" "/share/luajit-2.1*/jit")
221+ find_path (LUAJIT_JITLIB_DIR vmdef.lua PATHS ${LUAJIT_JITLIB_SEARCH_PATHS})
222+ if (LUAJIT_INCLUDE AND LUAJIT_LIB AND LUAJIT_JITLIB_DIR)
223+ message (STATUS "include: ${LUAJIT_INCLUDE}, lib: ${LUAJIT_LIB}, jitlib_dir: ${LUAJIT_JITLIB_DIR}")
224 message (STATUS "Found a system-wide LuaJIT.")
225 luajit_test()
226 if ("${LUAJIT_RUNS}" STREQUAL "1")
227@@ -79,6 +82,7 @@
228 message (FATAL_ERROR "Not found a system LuaJIT")
229 #luajit_use_bundled()
230 endif()
231+ unset(LUAJIT_JITLIB_SEARCH_PATHS)
232 endmacro()
233
234 #
235@@ -87,7 +91,8 @@
236 macro (luajit_try_prefix)
237 find_path (LUAJIT_INCLUDE "lua.h" ${LUAJIT_PREFIX} NO_DEFAULT_PATH)
238 find_library (LUAJIT_LIB "luajit" ${LUAJIT_PREFIX} NO_DEFAULT_PATH)
239- if (LUAJIT_INCLUDE AND LUAJIT_LIB)
240+ find_path (LUAJIT_JITLIB_DIR "vmdef.lua" ${LUAJIT_PREFIX}/jit NO_DEFAULT_PATH)
241+ if (LUAJIT_INCLUDE AND LUAJIT_LIB AND LUAJIT_JITLIB_DIR)
242 include_directories("${LUAJIT_INCLUDE}")
243 luajit_test()
244 if (LUAJIT_RUNS)
245--- a/cmake/utils.cmake
246+++ b/cmake/utils.cmake
247@@ -41,8 +41,8 @@
248 function(lua_source varname filename)
249 if (IS_ABSOLUTE "${filename}")
250 set (srcfile "${filename}")
251- set (tmpfile "${filename}.new.c")
252- set (dstfile "${filename}.c")
253+ set (tmpfile "${CMAKE_CURRENT_BINARY_DIR}${filename}.new.c")
254+ set (dstfile "${CMAKE_CURRENT_BINARY_DIR}${filename}.c")
255 else(IS_ABSOLUTE "${filename}")
256 set (srcfile "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
257 set (tmpfile "${CMAKE_CURRENT_BINARY_DIR}/${filename}.new.c")
258@@ -62,7 +62,7 @@
259 COMMAND ${ECHO} '\;' >> ${tmpfile}
260 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${tmpfile} ${dstfile}
261 COMMAND ${CMAKE_COMMAND} -E remove ${tmpfile}
262- DEPENDS ${srcfile} txt2c libluajit)
263+ DEPENDS ${srcfile} txt2c)
264
265 set(var ${${varname}})
266 set(${varname} ${var} ${dstfile} PARENT_SCOPE)