GNU bug report logs - #61774
[PATCH] gnu: Add luarocks.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Timo Wilken <guix@HIDDEN>; Keywords: moreinfo patch; dated Fri, 24 Feb 2023 22:47:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Added tag(s) moreinfo. Request was from Ludovic Courtès <ludo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 61774 <at> debbugs.gnu.org:


Received: (at 61774) by debbugs.gnu.org; 30 Mar 2023 21:15:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 30 17:15:00 2023
Received: from localhost ([127.0.0.1]:59588 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phzbn-0005mk-VN
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 17:15:00 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41964)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1phzbl-0005mN-St
 for 61774 <at> debbugs.gnu.org; Thu, 30 Mar 2023 17:14:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1phzbg-0006T0-4v; Thu, 30 Mar 2023 17:14:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=n/sIinvZR+Ag81efjbNa524exMmzsYTCiJEvpScUVzI=; b=Pm5BVDVZ4IU77WDvdnfk
 tkl+vd69dK9Xr1mJqcbhevSerlVBTCN01W9qugoLVE+Lx36aikoJVm0X/ihaAWGds1TWKgeW/TFP6
 QSYi4DwQHmbvC6lr5+a3NkbUL4nYfbqOQBDUAP9oD5bb57pPi4kCu2W6kmOPz291rxTF/1nJWVykF
 Q4yTCHwPZeTX2BekbWqAAOKb4huMa8zDYleOgV8G6z6SzYGNm0tfum7jm2O+iOAt0ri5d+frteYUQ
 s+XhIcVTZTgrtXFnN96qygDLlRnm2IRbGGQk1pV9Ya+K6t+ALfklGPpIicgGiOF/u8yrKNdMkd5TK
 zzQ05+ttAsHP0w==;
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1phzbf-0004a0-Ha; Thu, 30 Mar 2023 17:14:51 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Timo Wilken <guix@HIDDEN>
Subject: Re: bug#61774: [PATCH] gnu: Add luarocks.
References: <20230224224613.25630-1-guix@HIDDEN>
Date: Thu, 30 Mar 2023 23:14:49 +0200
In-Reply-To: <20230224224613.25630-1-guix@HIDDEN> (Timo Wilken's message
 of "Fri, 24 Feb 2023 23:46:13 +0100")
Message-ID: <87wn2ygcvq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61774
Cc: 61774 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Timo Wilken <guix@HIDDEN> skribis:

> Luarocks is a package manager for Lua modules.
>
> It is used by the Prosody XMPP server (already packaged in Guix) to
> install extensions.
>
> * gnu/packages/lua.scm (luarocks): Add variable.

Could resend the two patches merged as one?

Some comments:

> +                      (substitute* '("GNUmakefile" "src/luarocks/fs/unix=
.lua"
> +                                     "src/luarocks/core/sysdetect.lua")
> +                        (("/bin/sh")
> +                         (string-append (assoc-ref inputs "bash-minimal")
> +                                        "/bin/sh")))))

Rather (search-input-file inputs "/bin/sh").

> +    (synopsis "A package manager for Lua modules")

I believe =E2=80=98guix lint=E2=80=99 will tel you to remove =E2=80=9CA=E2=
=80=9D.  :-)

> +    ;; The home page says:
> +    ;; "LuaRocks is free software and uses the same license as Lua."
> +    (license license:x11)))

Please double-check the license in the source (and remove the comment).

> +         (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 =3D \\{")
> +                (string-append
> +                 "variables =3D {\n"
> +                 "   AR =3D \"" (assoc-ref inputs "binutils") "/bin/ar\"=
;\n"
> +                 "   BUNZIP2 =3D \"" (assoc-ref inputs "bzip2") "/bin/bu=
nzip2\";\n"
> +                 "   CC =3D \"" (assoc-ref inputs "gcc") "/bin/gcc\";\n"
> +                 "   CHMOD =3D \"" (assoc-ref inputs "coreutils") "/bin/=
chmod\";\n"
> +                 "   CMAKE =3D \"" (assoc-ref inputs "coreutils") "/bin/=
cmake\";\n"

These should all use =E2=80=98search-input-file=E2=80=99.  However=E2=80=A6

> +                 "   CP =3D \"" (assoc-ref inputs "coreutils") "/bin/cp\=
";\n"
> +                 "   CURL =3D \"" (assoc-ref inputs "curl") "/bin/curl\"=
;\n"
> +                 "   CVS =3D \"" (assoc-ref inputs "cvs") "/bin/cvs\";\n"
> +                 "   FIND =3D \"" (assoc-ref inputs "findutils") "/bin/f=
ind\";\n"
> +                 "   GIT =3D \"" (assoc-ref inputs "git") "/bin/git\";\n"
> +                 "   GPG =3D \"" (assoc-ref inputs "gnupg") "/bin/gpg\";=
\n"

[...]

> +                 "   RSYNC =3D \"" (assoc-ref inputs "rsync") "/bin/rsyn=
c\";\n"
> +                 "   SCP =3D \"" (assoc-ref inputs "openssh") "/bin/scp\=
";\n"
> +                 "   SEVENZ =3D \"" (assoc-ref inputs "p7zip") "/bin/7z\=
";\n"
> +                 "   SVN =3D \"" (assoc-ref inputs "subversion") "/bin/s=
vn\";\n"
> +                 "   TAR =3D \"" (assoc-ref inputs "tar") "/bin/tar\";\n"

Does it really need all these things?  What does =E2=80=98guix size luarock=
s=E2=80=99
say now?

Maybe it=E2=80=99s OK to assume that some of the rarely-used dependencies (=
say,
CVS, SVN, 7zip) will be picked from $PATH and that it will fail
otherwise?  That would help keep the closure size under control.

> +    (inputs (list lua bash-minimal
> +                  ;; Executables required by luarocks.
> +                  binutils bzip2 coreutils curl cvs findutils gcc git gn=
upg
> +                  gzip gnu-make mercurial openssh openssl p7zip rsync
> +                  subversion tar unzip wget zip))

Please one per line since there are many of them (you can run =E2=80=98guix
style luarocks=E2=80=99).

Could you send an updated patch?

Thanks!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#61774; Package guix-patches. Full text available.

Message received at 61774 <at> debbugs.gnu.org:


Received: (at 61774) by debbugs.gnu.org; 26 Feb 2023 16:09:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 26 11:09:21 2023
Received: from localhost ([127.0.0.1]:44880 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pWJaS-0004Ea-SJ
	for submit <at> 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 <guix@HIDDEN>) id 1pWJaQ-0004EM-MI
 for 61774 <at> 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 <guix@HIDDEN>)
 id 1pWJaK-00BKy2-FR; Sun, 26 Feb 2023 16:09:12 +0000
From: Timo Wilken <guix@HIDDEN>
To: 61774 <at> debbugs.gnu.org
Subject: [PATCH] gnu: luarocks: Add for Lua 5.2 and fix dependencies.
Date: Sun, 26 Feb 2023 17:08:19 +0100
Message-Id: <20230226160817.12138-1-guix@HIDDEN>
X-Mailer: git-send-email 2.39.1
In-Reply-To: <20230224224613.25630-1-guix@HIDDEN>
References: <20230224224613.25630-1-guix@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BlackCat-Spam-Score: 49
X-Spam-Status: No, score=4.9
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 61774
Cc: Timo Wilken <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

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





Information forwarded to guix-patches@HIDDEN:
bug#61774; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 24 Feb 2023 22:46:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 24 17:46:53 2023
Received: from localhost ([127.0.0.1]:38493 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pVgq4-0004XY-Eg
	for submit <at> debbugs.gnu.org; Fri, 24 Feb 2023 17:46:52 -0500
Received: from lists.gnu.org ([209.51.188.17]:44962)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <guix@HIDDEN>) id 1pVgq2-0004XQ-Ci
 for submit <at> debbugs.gnu.org; Fri, 24 Feb 2023 17:46:51 -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 <guix@HIDDEN>) id 1pVgq1-0001sB-Vr
 for guix-patches@HIDDEN; Fri, 24 Feb 2023 17:46:49 -0500
Received: from mx2.mythic-beasts.com ([2a00:1098:0:82:1000:0:2:1])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <guix@HIDDEN>) id 1pVgq0-0006E9-4o
 for guix-patches@HIDDEN; Fri, 24 Feb 2023 17:46:49 -0500
Received: by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2)
 (envelope-from <guix@HIDDEN>)
 id 1pVgpx-00C6Um-BH; Fri, 24 Feb 2023 22:46:45 +0000
From: Timo Wilken <guix@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: Add luarocks.
Date: Fri, 24 Feb 2023 23:46:13 +0100
Message-Id: <20230224224613.25630-1-guix@HIDDEN>
X-Mailer: git-send-email 2.39.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BlackCat-Spam-Score: 9
X-Spam-Status: No, score=0.9
Received-SPF: pass client-ip=2a00:1098:0:82:1000:0:2:1;
 envelope-from=guix@HIDDEN; helo=mx2.mythic-beasts.com
X-Spam_score_int: -41
X-Spam_score: -4.2
X-Spam_bar: ----
X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Timo Wilken <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Luarocks is a package manager for Lua modules.

It is used by the Prosody XMPP server (already packaged in Guix) to
install extensions.

* gnu/packages/lua.scm (luarocks): Add variable.
---
 gnu/packages/lua.scm | 50 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index d50890bf1e..3d18e18ca9 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2022 Brandon Lucas <br@HIDDEN>
 ;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@HIDDEN>
 ;;; Copyright © 2022 Leo Nikkilä <hello@HIDDEN>
+;;; Copyright © 2023 Timo Wilken <guix@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -49,6 +50,7 @@ (define-module (gnu packages lua)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages build-tools)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages libevent)
@@ -1126,6 +1128,54 @@ (define-public lua-resty-shell
 shell command executions.")
     (license license:bsd-3)))
 
+(define-public luarocks
+  (package
+    (name "luarocks")
+    (version "3.9.2")
+    (home-page "https://luarocks.org/")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://luarocks.org/releases/luarocks-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "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))
+    (native-inputs (list unzip))
+    (synopsis "A package manager for Lua modules")
+    (description
+     "LuaRocks is the package manager for the Lua programming
+language.
+
+It allows you to install Lua modules as self-contained packages called
+@url{https://luarocks.org/en/Types_of_rocks, @emph{rocks}}, which also contain
+version @url{https://luarocks.org/en/Dependencies, dependency} information.
+This information can be used both during installation, so that when one rock
+is requested all rocks it depends on are installed as well, and also
+optionally at run time, so that when a module is required, the correct version
+is loaded.  LuaRocks supports both local and
+@url{http://luarocks.org/en/Rocks_repositories, remote} repositories, and
+multiple local rocks trees.")
+    ;; The home page says:
+    ;; "LuaRocks is free software and uses the same license as Lua."
+    (license license:x11)))
+
 (define-public emilua
   (package
    (name "emilua")
-- 
2.39.1





Acknowledgement sent to Timo Wilken <guix@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#61774; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 8 Aug 2023 15:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.