[packages/luajit] up to 2.1.0 snap
atler
atler at pld-linux.org
Sat Apr 30 23:25:50 CEST 2022
commit e7941b74d1ff3e633e19201d94259bd60952d90b
Author: Jan Palus <atler at pld-linux.org>
Date: Sat Apr 30 23:23:14 2022 +0200
up to 2.1.0 snap
- upstream effectively stopped making releases and recommends using git
instead
- "beta3" was released in 2017 so drop it from version
- updated list of supported archs
- pass ldflags
config.patch | 37 +++++++++++++++++++++++++++++++++++++
luajit.spec | 30 +++++++++++++++++++++++-------
2 files changed, 60 insertions(+), 7 deletions(-)
---
diff --git a/luajit.spec b/luajit.spec
index 07c2752..7b7c5dc 100644
--- a/luajit.spec
+++ b/luajit.spec
@@ -1,18 +1,23 @@
# TODO
# - x32 not supported by upstream: http://www.freelists.org/post/luajit/Building-luajit202-on-x32,1
+
+%define snap 20220429
Summary: Just-in-Time compiler for Lua
Summary(pl.UTF-8): Kompilator JIT dla języka Lua
Name: luajit
-Version: 2.0.5
-Release: 1
+Version: 2.1.0
+Release: 0.%{snap}.1
License: MIT
Group: Libraries
# Source0Download: http://luajit.org/download.html
-Source0: http://luajit.org/download/LuaJIT-%{version}.tar.gz
-# Source0-md5: 48353202cbcacab84ee41a5a70ea0a2c
+Source0: %{name}-%{version}-%{snap}.tar.xz
+# Source0-md5: 201b01f0b6830a1a2bd70341587e868a
+Patch0: config.patch
URL: http://luajit.org/
BuildRequires: sed >= 4.0
-ExclusiveArch: %{ix86} %{x8664} %{arm} mips ppc
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
+ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 mips mips64 mipsel ppc
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define lua_abi 5.1
@@ -49,7 +54,8 @@ Static LuaJIT library.
Statyczna biblioteka LuaJIT.
%prep
-%setup -q -n LuaJIT-%{version}
+%setup -q -n LuaJIT
+%patch0 -p1
# preserve timestamps
sed -i -e '/install -m/s/-m/-p -m/' Makefile
@@ -59,11 +65,13 @@ sed -i -e '/install -m/s/-m/-p -m/' Makefile
# E= @: - disable @echo messages
# NOTE: we use amalgamated build as per documentation suggestion doc/install.html
%{__make} \
+ VERSION="%{version}" \
PREFIX=%{_prefix} \
MULTILIB=%{_lib} \
CC="%{__cc}" \
CCOPT="%{rpmcflags} -fomit-frame-pointer" \
CCOPT_x86= \
+ LDFLAGS="%{rpmldflags}" \
MULTILIB=%{_lib} \
E="@:" \
Q= \
@@ -73,10 +81,18 @@ sed -i -e '/install -m/s/-m/-p -m/' Makefile
rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT \
+ VERSION="%{version}" \
PREFIX=%{_prefix} \
MULTILIB=%{_lib} \
+ INSTALL_BIN=$RPM_BUILD_ROOT%{_bindir} \
+ INSTALL_LIB=$RPM_BUILD_ROOT%{_libdir} \
+ INSTALL_SHARE=$RPM_BUILD_ROOT%{_datadir} \
+ INSTALL_MAN=$RPM_BUILD_ROOT%{_mandir}/man1 \
+ INSTALL_PKGCONFIG=$RPM_BUILD_ROOT%{_pkgconfigdir} \
LDCONFIG="/sbin/ldconfig -n"
+ln -s luajit-%{version} $RPM_BUILD_ROOT%{_bindir}/luajit
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -102,7 +118,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc doc/*
%attr(755,root,root) %{_libdir}/libluajit-%{lua_abi}.so
-%{_includedir}/luajit-2.0
+%{_includedir}/luajit-2.1
%{_pkgconfigdir}/luajit.pc
%files static
diff --git a/config.patch b/config.patch
new file mode 100644
index 0000000..39ec1d8
--- /dev/null
+++ b/config.patch
@@ -0,0 +1,37 @@
+diff -ur LuaJIT.orig/Makefile LuaJIT/Makefile
+--- LuaJIT.orig/Makefile 2022-04-30 23:04:52.495418337 +0200
++++ LuaJIT/Makefile 2022-04-30 23:08:13.919532873 +0200
+@@ -77,7 +77,8 @@
+ UNINSTALL= $(RM)
+ LDCONFIG= ldconfig -n 2>/dev/null
+ SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \
+- -e "s|^multilib=.*|multilib=$(MULTILIB)|"
++ -e "s|^multilib=.*|multilib=$(MULTILIB)|" \
++ -e "s|^version=.*|version=$(VERSION)|"
+
+ FILE_T= luajit
+ FILE_A= libluajit.a
+diff -ur LuaJIT.orig/src/luaconf.h LuaJIT/src/luaconf.h
+--- LuaJIT.orig/src/luaconf.h 2022-04-29 09:13:18.000000000 +0200
++++ LuaJIT/src/luaconf.h 2022-04-30 23:10:10.372451429 +0200
+@@ -37,7 +37,7 @@
+ #endif
+ #define LUA_LROOT "/usr/local"
+ #define LUA_LUADIR "/lua/5.1/"
+-#define LUA_LJDIR "/luajit-2.1.0-beta3/"
++#define LUA_LJDIR "/luajit-" VERSION "/"
+
+ #ifdef LUA_ROOT
+ #define LUA_JROOT LUA_ROOT
+diff -ur LuaJIT.orig/src/Makefile LuaJIT/src/Makefile
+--- LuaJIT.orig/src/Makefile 2022-04-29 09:13:18.000000000 +0200
++++ LuaJIT/src/Makefile 2022-04-30 23:09:37.724030857 +0200
+@@ -283,7 +283,7 @@
+ TARGET_XLIBS+= -lpthread
+ endif
+
+-TARGET_XCFLAGS+= $(CCOPT_$(TARGET_LJARCH))
++TARGET_XCFLAGS+= $(CCOPT_$(TARGET_LJARCH)) -DVERSION=\"$(VERSION)\"
+ TARGET_ARCH+= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET_LJARCH))
+
+ ifneq (,$(PREFIX))
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/luajit.git/commitdiff/e7941b74d1ff3e633e19201d94259bd60952d90b
More information about the pld-cvs-commit
mailing list