%global debug_package %{nil} %define _build_id_links none %if 0%{?rhel} && 0%{?rhel} < 10 %global gcc_toolset_env /opt/rh/gcc-toolset-15/enable %else %global gcc_toolset_env /usr/lib/gcc-toolset/15-env.source %endif %global luajit_version_major 2 %global luajit_version_minor 1 %global luajit_version_patch 1788460057 # Full commit hash corresponding to 24c20c9 %global luajit_commit 24c20c94e7db195b640854619577441f9b4bc6be %global luajit_commit_short 24c20c9 %global api_ver 2.1 Name: luajit Version: %{luajit_version_major}.%{luajit_version_minor}.%{luajit_version_patch} Release: %autorelease Summary: Just-In-Time Compiler for Lua License: MIT URL: https://luajit.org Source0: https://github.com/LuaJIT/LuaJIT/archive/%{luajit_commit}.tar.gz#/%{name}-%{luajit_commit}.tar.gz BuildRequires: make BuildRequires: pkgconfig BuildRequires: gcc-toolset-15-gcc BuildRequires: gcc-toolset-15-gcc-c++ BuildRequires: gcc-toolset-15-gcc-plugin-annobin Provides: lua(abi) = 5.1 %description LuaJIT implements the full set of language features defined by Lua 5.1. The virtual machine (VM) is API- and ABI-compatible with the standard Lua interpreter and can be deployed as a drop-in replacement. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development headers, pkg-config metadata and linker symlinks for LuaJIT. %prep %autosetup -n LuaJIT-%{luajit_commit} echo "%{luajit_version_patch}" > .relver # Enable Lua 5.2 compatibility sed -i \ -e '/-DLUAJIT_ENABLE_LUA52COMPAT/s/^#//' \ src/Makefile # Preserve timestamps during install sed -i \ -e '/install -m/s/-m/-p -m/' \ Makefile %build . %{gcc_toolset_env} # Build using amalgamation as recommended by upstream. make amalg \ Q= \ E=@: \ PREFIX=%{_prefix} \ TARGET_STRIP=: \ MULTILIB=%{_lib} \ CFLAGS="%{build_cflags}" \ LDFLAGS="%{build_ldflags}" \ %{?_smp_mflags} %install . %{gcc_toolset_env} %make_install \ PREFIX=%{_prefix} \ MULTILIB=%{_lib} # Remove static library find %{buildroot} -type f -name '*.a' -delete %ldconfig_scriptlets %files %license COPYRIGHT %doc README.md %{_bindir}/luajit %{_bindir}/luajit-* %{_libdir}/libluajit-5.1.so.* %{_mandir}/man1/luajit.1* %dir %{_datadir}/luajit-%{luajit_version_major}.%{luajit_version_minor} %{_datadir}/luajit-%{luajit_version_major}.%{luajit_version_minor}/* %files devel %{_includedir}/luajit-%{api_ver}/ %{_libdir}/libluajit-5.1.so %{_libdir}/pkgconfig/luajit.pc %changelog %autochangelog