From dc2d7d0cd2019c58270c9926bcb9da63b46a57a5 Mon Sep 17 00:00:00 2001 From: Zheng Junjie Date: Sun, 30 Mar 2025 13:38:00 +0800 Subject: gnu: luajit: Add riscv64 support. * gnu/packages/lua.scm (luajit)[arguments]: Use G-expression, when target riscv64, Add luajit-add-riscv64-support.patch. [supported-systems]: Add riscv64-linux. * gnu/packages/patches/luajit-add-riscv64-support.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Change-Id: Ibdb40a99bc0d7709887cfe772e6d9dae5083592c Signed-off-by: Christopher Baines --- gnu/packages/lua.scm | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'gnu/packages/lua.scm') diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index cbac56e1313..59598f20c55 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -23,6 +23,7 @@ ;;; Copyright © 2023 Timo Wilken ;;; Copyright © 2024 Jan Wielkiewicz ;;; Copyright © 2024 Maxim Cournoyer +;;; Copyright © 2025 Zheng Junjie ;;; ;;; This file is part of GNU Guix. ;;; @@ -191,19 +192,28 @@ for configuration, scripting, and rapid prototyping.") "0srwk9nmiz8a93f70inq2597ff6xy203ckr4c0k7jcksdixymi9v")))) (build-system gnu-build-system) (arguments - `(#:tests? #f ; luajit is distributed without tests - #:phases - (modify-phases %standard-phases - (delete 'configure)) ; no configure script - #:make-flags (list (string-append "PREFIX=" - (assoc-ref %outputs "out"))))) + (list #:tests? #f ; luajit is distributed without tests + #:phases + #~(modify-phases %standard-phases + #$@(if (target-riscv64?) + #~((add-after 'unpack 'patch + (lambda _ + (invoke + "patch" "--force" "-p1" "-i" + #$(local-file + (search-patch + "luajit-add-riscv64-support.patch")))))) + #~()) + (delete 'configure)) ; no configure script + #:make-flags #~(list (string-append "PREFIX=" + (assoc-ref %outputs "out"))))) (home-page "https://www.luajit.org/") (synopsis "Just in time compiler for Lua programming language version 5.1") ;; On powerpc64le-linux, the build fails with an error: "No support for ;; PowerPC 64 bit mode (yet)". See: https://issues.guix.gnu.org/49220 (supported-systems (fold delete %supported-systems - (list "powerpc64le-linux" "riscv64-linux"))) + (list "powerpc64le-linux"))) (description "LuaJIT is a Just-In-Time Compiler (JIT) for the Lua programming language. Lua is a powerful, dynamic and light-weight programming -- cgit v1.3