]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Revert "Use PUC-Rio Lua in packages" 5809/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Tue, 30 Dec 2025 09:47:39 +0000 (09:47 +0000)
committerGitHub <noreply@github.com>
Tue, 30 Dec 2025 09:47:39 +0000 (09:47 +0000)
debian/control
debian/rules
rpm/rspamd.spec

index 30f32ededb5e295e1676856643db34858293653c..e61c5cc35854855fcfbe00aa0bffdd8544840a8e 100644 (file)
@@ -15,7 +15,6 @@ Build-Depends: cmake,
                libssl-dev (>= 1.0),
                libunwind-dev | libunwind-13-dev,
                binutils-dev,
-               liblua5.4-dev | liblua5.3-dev,
                perl,
                ragel,
                zlib1g-dev
index 3999d91b999b45fbf5cfe2052c83d67aa3473d9c..8c3ed647b90048b7679f95151a6f4a225f7940ab 100755 (executable)
@@ -10,7 +10,7 @@ FLAVORS = release asan
 CONFIG_asan = -DCMAKE_BUILD_TYPE=Debug -DSANITIZE=address -DENABLE_LTO=OFF -DENABLE_FULL_DEBUG=ON
 CONFIG_release = -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_LTO=ON
 
-ENABLE_LUAJIT := -DENABLE_LUAJIT=OFF
+ENABLE_LUAJIT := -DENABLE_LUAJIT=ON -DLUA_ROOT=/luajit-build
 
 # Can be filled by a build system
 EXTRA_ARGS :=
index 0c45acbf7380dc5ba9aa6b81114096fca304888a..3f9a3cb37b2974d2fca32360a420787111f835ea 100644 (file)
@@ -63,7 +63,11 @@ BuildRequires:    jemalloc-devel
 %endif
 %endif
 
+%if 0%{getenv:LUAJIT}
+BuildRequires:    git
+%else
 BuildRequires:    lua-devel
+%endif
 BuildRequires:    openblas-devel
 BuildRequires:    openssl-devel
 BuildRequires:    pcre2-devel
@@ -85,6 +89,11 @@ lua.
 
 %prep
 %setup -q -n %{name}-%{version}
+%if 0%{getenv:LUAJIT}
+rm -fr %{_builddir}/luajit-src || true
+rm -fr %{_builddir}/luajit-build || true
+git clone -b v2.1 https://luajit.org/git/luajit-2.0.git %{_builddir}/luajit-src
+%endif
 
 %build
 %if 0%{?el7}
@@ -100,7 +109,10 @@ source /opt/rh/gcc-toolset-12/enable
 source /usr/lib/gcc-toolset/15-env.source
 %endif
 
-
+%if 0%{getenv:LUAJIT}
+pushd %{_builddir}/luajit-src && make clean && make %{?_smp_mflags} CC="gcc -fPIC" PREFIX=%{_builddir}/luajit-build && make install PREFIX=%{_builddir}/luajit-build ; popd
+rm -f %{_builddir}/luajit-build/lib/*.so || true
+%endif
 %if 0%{?el7}
 %{cmake3} \
 %else
@@ -155,8 +167,13 @@ source /usr/lib/gcc-toolset/15-env.source
         -DENABLE_JEMALLOC=ON \
 %endif
 %endif
-         -DENABLE_LUAJIT=OFF \
-         -DENABLE_FASTTEXT=ON \
+%if 0%{getenv:LUAJIT}
+        -DENABLE_LUAJIT=ON \
+             -DLUA_ROOT=%{_builddir}/luajit-build \
+%else
+        -DENABLE_LUAJIT=OFF \
+%endif
+        -DENABLE_FASTTEXT=ON \
         -DFASTTEXT_ROOT_DIR=/fasttext \
         -DENABLE_BLAS=ON
 make %{?_smp_mflags}