From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id gFMtLF6E+2MnxgAAbAwnHQ (envelope-from ) for ; Sun, 26 Feb 2023 17:10:06 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id QJk3K16E+2NzxgAAG6o9tA (envelope-from ) for ; Sun, 26 Feb 2023 17:10:06 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 23C3D2E867 for ; Sun, 26 Feb 2023 17:10:06 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677427806; a=rsa-sha256; cv=none; b=oLd7lgAxG+SNcdi+T8pOKaLZypINltCgeSZVEnasEFyUhH9Ao/3XGOi5QaL/1SU38B6J9j +JV9aNpr5PABPbHogEObdYSouI9Bv/I8O3v+t3iFLOikt6my84067I2aNQeD5+ZauzZmd3 QPWI6ziGTr9bNmK5i12UHK0PR5isySlp+PALC9f0DHEpraRjyAukZiKxWBpl89mryLF8WV 6xBxtDF2bMYC7jsjWyg+yqeZavYT3TsNL4HpHA8a6p3ffvrxJg00oKk0aQH1TLV/65bnvy cYV8osFEQEaWaSXr/NDj3QicbYMYaMnzdcyzlcWCOk8Ae14QiB8UJHUV+qil9g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677427806; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=5ocDvf2nw5I63mAI51+Keq8nJU8Ax4RZoFUGG2kylXI=; b=vCJS9jE2yOdN2QwdVJC2skvacAwhMSFKQA2uF1KXA1uPr0qw5ovet128fYUV13cqgwjAFY GAji6QITyQfgVRcfEu0s7iAGuKCYp7iYdHBQl8W0kqxV5IkefQmn7d2qYrQeQTc7q/nIvD aX0nlvSFzK3n5OeH+WhWmpsw6cIrZh2NEVu4QOGHJm4pKxvnDhDtJklfwdWCNU/T8GT5hC 7aKFncbKItJyUa4i1UVJEZiWEQ1gy7lilpzopv6UQ3QcNQAQgX6CfVRzVibQM+NNSNqtu0 l0M7FuLk0lZg3xX4hSWkctuJ3nULvTqZKYARUWqethD3ld3dWuyAqBN70VEykg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWJbA-0000FX-4D; Sun, 26 Feb 2023 11:10:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWJb8-0000F0-G8 for guix-patches@gnu.org; Sun, 26 Feb 2023 11:10:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWJb8-0006YV-6l for guix-patches@gnu.org; Sun, 26 Feb 2023 11:10:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWJb8-0004Fb-2I for guix-patches@gnu.org; Sun, 26 Feb 2023 11:10:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61774] [PATCH] gnu: luarocks: Add for Lua 5.2 and fix dependencies. Resent-From: Timo Wilken Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 26 Feb 2023 16:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61774 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61774@debbugs.gnu.org Cc: Timo Wilken Received: via spool by 61774-submit@debbugs.gnu.org id=B61774.167742776116284 (code B ref 61774); Sun, 26 Feb 2023 16:10:02 +0000 Received: (at 61774) by debbugs.gnu.org; 26 Feb 2023 16:09:21 +0000 Received: from localhost ([127.0.0.1]:44880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWJaS-0004Ea-SJ for submit@debbugs.gnu.org; Sun, 26 Feb 2023 11:09:21 -0500 Received: from mx1.mythic-beasts.com ([46.235.224.141]:38435) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWJaQ-0004EM-MI for 61774@debbugs.gnu.org; Sun, 26 Feb 2023 11:09:19 -0500 Received: by mailhub-cam-d.mythic-beasts.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pWJaK-00BKy2-FR; Sun, 26 Feb 2023 16:09:12 +0000 From: Timo Wilken Date: Sun, 26 Feb 2023 17:08:19 +0100 Message-Id: <20230226160817.12138-1-guix@twilken.net> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230224224613.25630-1-guix@twilken.net> References: <20230224224613.25630-1-guix@twilken.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BlackCat-Spam-Score: 49 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Queue-Id: 23C3D2E867 X-Spam-Score: -2.49 X-Migadu-Spam-Score: -2.49 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-TUID: fJ+yzpQiHvfr Luarocks requires some external binaries, which should be set in its config file instead of relying on the calling user's PATH containing them. Also, for use with Prosody, luarocks needs to be built against Lua 5.2, so provide multiple versions of the package, like for other Lua packages. * gnu/packages/lua.scm (make-luarocks): New function. * gnu/packages/lua.scm (lua5.2-luarocks): New variable. --- gnu/packages/lua.scm | 94 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 78 insertions(+), 16 deletions(-) diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index 3d18e18ca9..4771fa1d42 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -47,11 +47,15 @@ (define-module (gnu packages lua) #:use-module (guix build-system meson) #:use-module (guix build-system trivial) #:use-module (gnu packages) + #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages boost) + #:use-module (gnu packages curl) #:use-module (gnu packages build-tools) #:use-module (gnu packages compression) + #:use-module (gnu packages gcc) #:use-module (gnu packages glib) + #:use-module (gnu packages gnupg) #:use-module (gnu packages gtk) #:use-module (gnu packages libevent) #:use-module (gnu packages libffi) @@ -61,11 +65,15 @@ (define-module (gnu packages lua) #:use-module (gnu packages pretty-print) #:use-module (gnu packages re2c) #:use-module (gnu packages readline) + #:use-module (gnu packages rsync) + #:use-module (gnu packages ssh) #:use-module (gnu packages tls) + #:use-module (gnu packages version-control) #:use-module (gnu packages vim) + #:use-module (gnu packages wget) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) - #:use-module (srfi srfi-1)) + #:use-module ((srfi srfi-1) #:hide (zip))) (define-public lua (package @@ -1142,21 +1150,69 @@ (define-public luarocks "1nsfp7cwqcxa8vmkcqkgi5wc0iax0j3gbdfd183kw81cq3nf99mw")))) (build-system gnu-build-system) (arguments - '(#:tests? #f ;upstream has no tests - #:phases (modify-phases %standard-phases - (add-before 'build 'patch-bin-sh - (lambda* (#:key inputs #:allow-other-keys) - (substitute* '("GNUmakefile" "src/luarocks/fs/unix.lua" - "src/luarocks/core/sysdetect.lua") - (("/bin/sh") - (string-append (assoc-ref inputs "bash-minimal") - "/bin/sh"))))) - (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (invoke "./configure" - (string-append "--prefix=" out)))))))) - (inputs (list lua bash-minimal)) + `(#:tests? #f ;upstream has no tests + #:phases + (modify-phases %standard-phases + (add-before 'build 'patch-bin-sh + (lambda* (#:key inputs #:allow-other-keys) + (substitute* '("GNUmakefile" "src/luarocks/fs/unix.lua" + "src/luarocks/core/sysdetect.lua") + (("/bin/sh") + (string-append (assoc-ref inputs "bash-minimal") + "/bin/sh"))))) + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (invoke "./configure" + (string-append "--prefix=" out))))) + (add-after 'install 'patch-unzip + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* + (string-append + (assoc-ref outputs "out") "/etc/luarocks/config-" + ,(substring (package-version lua) 0 3) ".lua") ;e.g. "5.2" + (("variables = \\{") + (string-append + "variables = {\n" + " AR = \"" (assoc-ref inputs "binutils") "/bin/ar\";\n" + " BUNZIP2 = \"" (assoc-ref inputs "bzip2") "/bin/bunzip2\";\n" + " CC = \"" (assoc-ref inputs "gcc") "/bin/gcc\";\n" + " CHMOD = \"" (assoc-ref inputs "coreutils") "/bin/chmod\";\n" + " CMAKE = \"" (assoc-ref inputs "coreutils") "/bin/cmake\";\n" + " CP = \"" (assoc-ref inputs "coreutils") "/bin/cp\";\n" + " CURL = \"" (assoc-ref inputs "curl") "/bin/curl\";\n" + " CVS = \"" (assoc-ref inputs "cvs") "/bin/cvs\";\n" + " FIND = \"" (assoc-ref inputs "findutils") "/bin/find\";\n" + " GIT = \"" (assoc-ref inputs "git") "/bin/git\";\n" + " GPG = \"" (assoc-ref inputs "gnupg") "/bin/gpg\";\n" + " GUNZIP = \"" (assoc-ref inputs "gzip") "/bin/gunzip\";\n" + " HG = \"" (assoc-ref inputs "mercurial") "/bin/hg\";\n" + " LD = \"" (assoc-ref inputs "binutils") "/bin/ld\";\n" + " LS = \"" (assoc-ref inputs "coreutils") "/bin/ls\";\n" + " MAKE = \"" (assoc-ref inputs "make") "/bin/make\";\n" + " MD5SUM = \"" (assoc-ref inputs "coreutils") "/bin/md5sum\";\n" + " MKDIR = \"" (assoc-ref inputs "coreutils") "/bin/mkdir\";\n" + " MKTEMP = \"" (assoc-ref inputs "coreutils") "/bin/mktemp\";\n" + " OPENSSL = \"" (assoc-ref inputs "openssl") "/bin/openssl\";\n" + " PWD = \"" (assoc-ref inputs "coreutils") "/bin/pwd\";\n" + " RANLIB = \"" (assoc-ref inputs "binutils") "/bin/ranlib\";\n" + " RM = \"" (assoc-ref inputs "coreutils") "/bin/rm\";\n" + " RMDIR = \"" (assoc-ref inputs "coreutils") "/bin/rmdir\";\n" + " RSYNC = \"" (assoc-ref inputs "rsync") "/bin/rsync\";\n" + " SCP = \"" (assoc-ref inputs "openssh") "/bin/scp\";\n" + " SEVENZ = \"" (assoc-ref inputs "p7zip") "/bin/7z\";\n" + " SVN = \"" (assoc-ref inputs "subversion") "/bin/svn\";\n" + " TAR = \"" (assoc-ref inputs "tar") "/bin/tar\";\n" + " TEST = \"" (assoc-ref inputs "coreutils") "/bin/test\";\n" + " TOUCH = \"" (assoc-ref inputs "coreutils") "/bin/touch\";\n" + " UNZIP = \"" (assoc-ref inputs "unzip") "/bin/unzip -n\";\n" + " WGET = \"" (assoc-ref inputs "wget") "/bin/wget\";\n" + " ZIP = \"" (assoc-ref inputs "zip") "/bin/zip\";")))))))) + (inputs (list lua bash-minimal + ;; Executables required by luarocks. + binutils bzip2 coreutils curl cvs findutils gcc git gnupg + gzip gnu-make mercurial openssh openssl p7zip rsync + subversion tar unzip wget zip)) (native-inputs (list unzip)) (synopsis "A package manager for Lua modules") (description @@ -1176,6 +1232,12 @@ (define-public luarocks ;; "LuaRocks is free software and uses the same license as Lua." (license license:x11))) +(define-public lua5.2-luarocks + (make-luarocks "lua5.2-luarocks" lua-5.2)) + +(define-public luarocks + (make-luarocks "luarocks" lua)) + (define-public emilua (package (name "emilua") -- 2.39.1