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 <mail@cbaines.net>
This commit is contained in:
Zheng Junjie 2025-03-30 13:38:00 +08:00 committed by Christopher Baines
parent 926b6d98e5
commit dc2d7d0cd2
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577
3 changed files with 12458 additions and 8 deletions

View file

@ -56,7 +56,7 @@
# Copyright © 2022 Alex Griffin <a@ajgrf.com>
# Copyright © 2022 ( <paren@disroot.org>
# Copyright © 2022 jgart <jgart@dismail.de>
# Copyright © 2023, 2024 Zheng Junjie <873216071@qq.com>
# Copyright © 2023-2025 Zheng Junjie <z572@z572.online>
# Copyright © 2023 Ivana Drazovic <iv.dra@hotmail.com>
# Copyright © 2023 Andy Tai <atai@atai.org>
# Copyright © 2023 B. Wilson <elaexuotee@wilsonb.com>
@ -1817,6 +1817,7 @@ dist_patch_DATA = \
%D%/packages/patches/lua-pkgconfig.patch \
%D%/packages/patches/lua51-liblua-so.patch \
%D%/packages/patches/lua51-pkgconfig.patch \
%D%/packages/patches/luajit-add-riscv64-support.patch \
%D%/packages/patches/lua-liblua-so.patch \
%D%/packages/patches/lua-5.4-pkgconfig.patch \
%D%/packages/patches/lua-5.4-liblua-so.patch \

View file

@ -23,6 +23,7 @@
;;; Copyright © 2023 Timo Wilken <guix@twilken.net>
;;; Copyright © 2024 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
;;; Copyright © 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2025 Zheng Junjie <z572@z572.online>
;;;
;;; 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

File diff suppressed because it is too large Load diff