diff mbox series

[4/6,v2] package/luajit: use the git download for known-reproducible tarball

Message ID 1e19b88b0da10c014997ee3f2d2f98921202af7d.1695069059.git.yann.morin.1998@free.fr
State New
Headers show
Series support/downloaf/git: add support for git attirbutes (branch yem/git-attributes) | expand

Commit Message

Yann E. MORIN Sept. 18, 2023, 8:31 p.m. UTC
Since version 2.1, LuaJIT foolows a rolling-release scheme, which means
that any commit is as good as any other; LuaJIT uses the comitter's UNIX
timestamp as its semver patch level. It uses the git-attribute
export-subst for the .relver file that contains the %ct placeholderfor
git-archive to expand it.

In c9dcd9e459d6 (package/luajit: bump to version 41fb94defa8f...), we
switched to such an upstream version. There was some confusion around
the handling of the git-attribute and where/when it is generated, and
the first revision of the patch used the git download method, so had to
use post-extract hooks to do the replacement, but the second iteration
kept retrieving the archive generated by github, which has the
replacement already done, but the post-extract hooks were not dropped
although now useless...

In the future, there is no guarantee that LuaJIT will not change the
format it uses; this will require a bit of care when reviewing every
version bump, to check whether this is the case or not...

To avoid any confusion, and to be future-proof, switch over to using the
git download helper, which now has support for handling export-subst in
a reproducible way. Drop the post-extract hooks as they are not needed.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Francois Perrad <fperrad@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/luajit/luajit.hash |  2 +-
 package/luajit/luajit.mk   | 12 ++----------
 2 files changed, 3 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/package/luajit/luajit.hash b/package/luajit/luajit.hash
index 578bb7a3e2..da243d8c2a 100644
--- a/package/luajit/luajit.hash
+++ b/package/luajit/luajit.hash
@@ -1,5 +1,5 @@ 
 # Locally calculated
-sha256  b518721280390e4cec1af30f6819d86756ce4234d82410a55a4e121855f64e08  luajit-41fb94defa8f830ce69a8122b03f6ac3216d392a.tar.gz
+sha256  df50bfe78919691ce9a630c8312386a8cb6ca49f327922a833e77656e82ef6c6  luajit-41fb94defa8f830ce69a8122b03f6ac3216d392a-br2.tar.gz
 
 # Locally calculated
 sha256  1130331ac861a4b4520e9c8ad0814efdc6f1e79ea55ea9c460c73733d13ccb5f  COPYRIGHT
diff --git a/package/luajit/luajit.mk b/package/luajit/luajit.mk
index 06c8993391..6b1c6b3386 100644
--- a/package/luajit/luajit.mk
+++ b/package/luajit/luajit.mk
@@ -5,7 +5,8 @@ 
 ################################################################################
 
 LUAJIT_VERSION = 41fb94defa8f830ce69a8122b03f6ac3216d392a
-LUAJIT_SITE = $(call github,LuaJIT,LuaJIT,$(LUAJIT_VERSION))
+LUAJIT_SITE = https://github.com/LuaJIT/LuaJIT
+LUAJIT_SITE_METHOD = git
 LUAJIT_LICENSE = MIT
 LUAJIT_LICENSE_FILES = COPYRIGHT
 LUAJIT_CPE_ID_VENDOR = luajit
@@ -33,15 +34,6 @@  LUAJIT_HOST_CC = $(HOSTCC) -m32
 LUAJIT_XCFLAGS += -DLUAJIT_DISABLE_GC64
 endif
 
-# emulation of git archive with .gitattributes & export-subst
-# Timestamp of the $(LUAJIT_VERSION) commit, obtained in the LuaJit
-# repo, with:   git show -s --format=%ct $(LUAJIT_VERSION)
-define LUAJIT_GEN_RELVER_FILE
-	echo 1693350652 >$(@D)/.relver
-endef
-LUAJIT_POST_EXTRACT_HOOKS = LUAJIT_GEN_RELVER_FILE
-HOST_LUAJIT_POST_EXTRACT_HOOKS = LUAJIT_GEN_RELVER_FILE
-
 # We unfortunately can't use TARGET_CONFIGURE_OPTS, because the luajit
 # build system uses non conventional variable names.
 define LUAJIT_BUILD_CMDS