* [PATCH 1/7] gnu: lua: Build with support for dynamic libraries.
2016-08-22 19:39 [PATCH 0/7] Add Prosody Ricardo Wurmus
@ 2016-08-22 19:39 ` Ricardo Wurmus
2016-08-22 20:05 ` Leo Famulari
2016-08-23 0:02 ` gno
2016-08-22 19:39 ` [PATCH 2/7] gnu: lua: Use "license:" prefix Ricardo Wurmus
` (6 subsequent siblings)
7 siblings, 2 replies; 20+ messages in thread
From: Ricardo Wurmus @ 2016-08-22 19:39 UTC (permalink / raw)
To: guix-devel
* gnu/packages/lua.scm (lua)[arguments]: Use regular build phase and add
make-flags.
---
gnu/packages/lua.scm | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index b4b5dee..52606f4 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -44,14 +45,15 @@
(inputs `(("readline" ,readline)))
(arguments
'(#:modules ((guix build gnu-build-system)
- (guix build utils)
- (srfi srfi-1))
+ (guix build utils)
+ (srfi srfi-1))
#:test-target "test"
+ #:make-flags
+ '("CFLAGS=-fPIC -DLUA_DL_DLOPEN -DLUA_USE_POSIX"
+ "linux")
#:phases
(modify-phases %standard-phases
(delete 'configure)
- (replace 'build
- (lambda _ (zero? (system* "make" "CFLAGS=-fPIC" "linux"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
--
2.9.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 1/7] gnu: lua: Build with support for dynamic libraries.
2016-08-22 19:39 ` [PATCH 1/7] gnu: lua: Build with support for dynamic libraries Ricardo Wurmus
@ 2016-08-22 20:05 ` Leo Famulari
2016-08-23 0:02 ` gno
1 sibling, 0 replies; 20+ messages in thread
From: Leo Famulari @ 2016-08-22 20:05 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: guix-devel
On Mon, Aug 22, 2016 at 09:39:12PM +0200, Ricardo Wurmus wrote:
> * gnu/packages/lua.scm (lua)[arguments]: Use regular build phase and add
> make-flags.
LGTM. I tried to make this change early in my involvement with Guix, but
my knowledge of the subject and ability to communicate the problem were
too limited.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/7] gnu: lua: Build with support for dynamic libraries.
2016-08-22 19:39 ` [PATCH 1/7] gnu: lua: Build with support for dynamic libraries Ricardo Wurmus
2016-08-22 20:05 ` Leo Famulari
@ 2016-08-23 0:02 ` gno
2016-08-28 8:23 ` Ricardo Wurmus
2016-08-30 6:37 ` Leo Famulari
1 sibling, 2 replies; 20+ messages in thread
From: gno @ 2016-08-23 0:02 UTC (permalink / raw)
To: rekado, guix-devel
On Mon, 22 Aug 2016 21:39:12 +0200
Ricardo Wurmus <rekado@elephly.net> wrote:
> * gnu/packages/lua.scm (lua)[arguments]: Use regular build phase and
> add make-flags.
> ---
> gnu/packages/lua.scm | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
> index b4b5dee..52606f4 100644
> --- a/gnu/packages/lua.scm
> +++ b/gnu/packages/lua.scm
> @@ -4,6 +4,7 @@
> ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
> ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
> ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
> +;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -44,14 +45,15 @@
> (inputs `(("readline" ,readline)))
> (arguments
> '(#:modules ((guix build gnu-build-system)
> - (guix build utils)
> - (srfi srfi-1))
> + (guix build utils)
> + (srfi srfi-1))
> #:test-target "test"
> + #:make-flags
> + '("CFLAGS=-fPIC -DLUA_DL_DLOPEN -DLUA_USE_POSIX"
> + "linux")
> #:phases
> (modify-phases %standard-phases
> (delete 'configure)
> - (replace 'build
> - (lambda _ (zero? (system* "make" "CFLAGS=-fPIC"
> "linux")))) (replace 'install
> (lambda* (#:key outputs #:allow-other-keys)
> (let ((out (assoc-ref outputs "out")))
This doesn't work for me - lua-lgi still complains about lua not being
able to dynamically load. But this does work:
(replace 'build
(lambda _ (zero? (system* "make"
"LDFLAGS=-ldl" "CFLAGS=-fPIC -DLUA_USE_DLOPEN" "linux"))))
I tried adding LDFLAGS in #make-flags to no avail.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/7] gnu: lua: Build with support for dynamic libraries.
2016-08-23 0:02 ` gno
@ 2016-08-28 8:23 ` Ricardo Wurmus
2016-08-30 6:37 ` Leo Famulari
1 sibling, 0 replies; 20+ messages in thread
From: Ricardo Wurmus @ 2016-08-28 8:23 UTC (permalink / raw)
To: gno; +Cc: guix-devel
gno <gnopap@gmail.com> writes:
> On Mon, 22 Aug 2016 21:39:12 +0200
> Ricardo Wurmus <rekado@elephly.net> wrote:
>
>> * gnu/packages/lua.scm (lua)[arguments]: Use regular build phase and
>> add make-flags.
>> ---
>> gnu/packages/lua.scm | 10 ++++++----
>> 1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
>> index b4b5dee..52606f4 100644
>> --- a/gnu/packages/lua.scm
>> +++ b/gnu/packages/lua.scm
>> @@ -4,6 +4,7 @@
>> ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
>> ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
>> ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>> +;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
>> ;;;
>> ;;; This file is part of GNU Guix.
>> ;;;
>> @@ -44,14 +45,15 @@
>> (inputs `(("readline" ,readline)))
>> (arguments
>> '(#:modules ((guix build gnu-build-system)
>> - (guix build utils)
>> - (srfi srfi-1))
>> + (guix build utils)
>> + (srfi srfi-1))
>> #:test-target "test"
>> + #:make-flags
>> + '("CFLAGS=-fPIC -DLUA_DL_DLOPEN -DLUA_USE_POSIX"
>> + "linux")
>> #:phases
>> (modify-phases %standard-phases
>> (delete 'configure)
>> - (replace 'build
>> - (lambda _ (zero? (system* "make" "CFLAGS=-fPIC"
>> "linux")))) (replace 'install
>> (lambda* (#:key outputs #:allow-other-keys)
>> (let ((out (assoc-ref outputs "out")))
>
>
> This doesn't work for me - lua-lgi still complains about lua not being
> able to dynamically load. But this does work:
>
> (replace 'build
> (lambda _ (zero? (system* "make"
> "LDFLAGS=-ldl" "CFLAGS=-fPIC -DLUA_USE_DLOPEN" "linux"))))
>
> I tried adding LDFLAGS in #make-flags to no avail.
I don’t have a package for “lua-lgi” so I cannot reproduce this. All I
can say is that it appears to work in the case of prosody. Without
LUA_DL_DLOPEN defined Lua will not even attempt to load dynamic
libraries.
~~ Ricardo
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/7] gnu: lua: Build with support for dynamic libraries.
2016-08-23 0:02 ` gno
2016-08-28 8:23 ` Ricardo Wurmus
@ 2016-08-30 6:37 ` Leo Famulari
1 sibling, 0 replies; 20+ messages in thread
From: Leo Famulari @ 2016-08-30 6:37 UTC (permalink / raw)
To: gno; +Cc: guix-devel
On Tue, Aug 23, 2016 at 02:02:40AM +0200, gno wrote:
> On Mon, 22 Aug 2016 21:39:12 +0200
> Ricardo Wurmus <rekado@elephly.net> wrote:
> > + #:make-flags
> > + '("CFLAGS=-fPIC -DLUA_DL_DLOPEN -DLUA_USE_POSIX"
> > + "linux")
>
> This doesn't work for me - lua-lgi still complains about lua not being
> able to dynamically load. But this does work:
>
> (replace 'build
> (lambda _ (zero? (system* "make"
> "LDFLAGS=-ldl" "CFLAGS=-fPIC -DLUA_USE_DLOPEN" "linux"))))
>
> I tried adding LDFLAGS in #make-flags to no avail.
Based on my reading of the Makefile (and the 'src/Makefile'), I think we
should be using MYCFLAGS and MYLDFLAGS.
CFLAGS and LDFLAGS include MYCFLAGS and MYLDFLAGS, respectively, but
they also include some default flags and platform-dependent flags. By
setting CFLAGS and LDFLAGS directly, we lose those default and
platform-dependent values.
By the way, '-ldl' does get passed to GCC in 'src/Makefile', but I don't
think it gets passed to the linker, although my knowledge here is not
strong.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 2/7] gnu: lua: Use "license:" prefix.
2016-08-22 19:39 [PATCH 0/7] Add Prosody Ricardo Wurmus
2016-08-22 19:39 ` [PATCH 1/7] gnu: lua: Build with support for dynamic libraries Ricardo Wurmus
@ 2016-08-22 19:39 ` Ricardo Wurmus
2016-08-22 19:39 ` [PATCH 3/7] gnu: Add lua5.1-expat Ricardo Wurmus
` (5 subsequent siblings)
7 siblings, 0 replies; 20+ messages in thread
From: Ricardo Wurmus @ 2016-08-22 19:39 UTC (permalink / raw)
To: guix-devel
* gnu/packages/gstreamer.scm (define-module): Import guix licenses with
"license:" prefix.
---
gnu/packages/lua.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 52606f4..5ba83d7 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -22,7 +22,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages lua)
- #:use-module (guix licenses)
+ #:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
@@ -70,7 +70,7 @@ based on associative arrays and extensible semantics. Lua is dynamically typed,
runs by interpreting bytecode for a register-based virtual machine, and has
automatic memory management with incremental garbage collection, making it ideal
for configuration, scripting, and rapid prototyping.")
- (license x11)))
+ (license license:x11)))
(define-public lua-5.1
(package (inherit lua)
@@ -108,4 +108,4 @@ for configuration, scripting, and rapid prototyping.")
programming language. Lua is a powerful, dynamic and light-weight programming
language. It may be embedded or used as a general-purpose, stand-alone
language.")
- (license x11)))
+ (license license:x11)))
--
2.9.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 3/7] gnu: Add lua5.1-expat.
2016-08-22 19:39 [PATCH 0/7] Add Prosody Ricardo Wurmus
2016-08-22 19:39 ` [PATCH 1/7] gnu: lua: Build with support for dynamic libraries Ricardo Wurmus
2016-08-22 19:39 ` [PATCH 2/7] gnu: lua: Use "license:" prefix Ricardo Wurmus
@ 2016-08-22 19:39 ` Ricardo Wurmus
2016-08-22 19:53 ` Leo Famulari
2016-08-22 19:39 ` [PATCH 4/7] gnu: Add lua5.1-socket Ricardo Wurmus
` (4 subsequent siblings)
7 siblings, 1 reply; 20+ messages in thread
From: Ricardo Wurmus @ 2016-08-22 19:39 UTC (permalink / raw)
To: guix-devel
* gnu/packages/lua.scm (lua5.1-expat): New variable.
---
gnu/packages/lua.scm | 38 +++++++++++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 5ba83d7..1ac9b11 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -27,7 +27,8 @@
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
- #:use-module (gnu packages readline))
+ #:use-module (gnu packages readline)
+ #:use-module (gnu packages xml))
(define-public lua
(package
@@ -109,3 +110,38 @@ programming language. Lua is a powerful, dynamic and light-weight programming
language. It may be embedded or used as a general-purpose, stand-alone
language.")
(license license:x11)))
+
+(define-public lua5.1-expat
+ (package
+ (name "lua-expat")
+ (version "1.3.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://matthewwild.co.uk/projects/"
+ "luaexpat/luaexpat-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1hvxqngn0wf5642i5p3vcyhg3pmp102k63s9ry4jqyyqc1wkjq6h"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (let ((out (assoc-ref %outputs "out")))
+ (list "CC=gcc"
+ (string-append "LUA_LDIR=" out "/share/lua/$(LUA_V)")
+ (string-append "LUA_CDIR=" out "/lib/lua/$(LUA_V)")))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'check
+ (lambda _
+ (setenv "LUA_CPATH" "src/?.so;;")
+ (setenv "LUA_PATH" "src/?.lua;;")
+ (and (zero? (system* "lua" "tests/test.lua"))
+ (zero? (system* "lua" "tests/test-lom.lua"))))))))
+ (inputs
+ `(("lua" ,lua-5.1)
+ ("expat" ,expat)))
+ (home-page "http://matthewwild.co.uk/projects/luaexpat/")
+ (synopsis "SAX XML parser based on the Expat library.")
+ (description "LuaExpat is a SAX XML parser based on the Expat library.")
+ (license (package-license lua-5.1))))
--
2.9.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 4/7] gnu: Add lua5.1-socket.
2016-08-22 19:39 [PATCH 0/7] Add Prosody Ricardo Wurmus
` (2 preceding siblings ...)
2016-08-22 19:39 ` [PATCH 3/7] gnu: Add lua5.1-expat Ricardo Wurmus
@ 2016-08-22 19:39 ` Ricardo Wurmus
2016-08-22 19:39 ` [PATCH 5/7] gnu: Add lua5.1-filesystem Ricardo Wurmus
` (3 subsequent siblings)
7 siblings, 0 replies; 20+ messages in thread
From: Ricardo Wurmus @ 2016-08-22 19:39 UTC (permalink / raw)
To: guix-devel
* gnu/packages/lua.scm (lua5.1-socket): New variable.
---
gnu/packages/lua.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 1ac9b11..85c2727 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -145,3 +145,49 @@ language.")
(synopsis "SAX XML parser based on the Expat library.")
(description "LuaExpat is a SAX XML parser based on the Expat library.")
(license (package-license lua-5.1))))
+
+(define-public lua5.1-socket
+ (package
+ (name "lua-socket")
+ (version "2.0.2")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://files.luaforge.net/releases/"
+ "luasocket/luasocket/luasocket-"
+ version "/luasocket-" version ".tar.gz"))
+ (sha256
+ (base32
+ "19ichkbc4rxv00ggz8gyf29jibvc2wq9pqjik0ll326rrxswgnag"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (let ((out (assoc-ref %outputs "out")))
+ (list (string-append "INSTALL_TOP_SHARE=" out "/share/lua/5.1")
+ (string-append "INSTALL_TOP_LIB=" out "/lib/lua/5.1")))
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'check
+ (lambda _
+ (setenv "LUA_CPATH" (string-append "src/?.so." ,version ";;"))
+ (setenv "LUA_PATH" "src/?.lua;;")
+ (when (zero? (primitive-fork))
+ (system* "lua" "test/testsrvr.lua"))
+ (zero? (system* "lua" "test/testclnt.lua")))))))
+ (inputs
+ `(("lua" ,lua-5.1)))
+ (home-page "http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/")
+ (synopsis "Socket library for Lua")
+ (description "LuaSocket is a Lua extension library that is composed by two
+parts: a C core that provides support for the TCP and UDP transport layers,
+and a set of Lua modules that add support for functionality commonly needed by
+applications that deal with the Internet.
+
+Among the supported modules, the most commonly used implement the
+SMTP (sending e-mails), HTTP (WWW access) and FTP (uploading and downloading
+files) client protocols. These provide a very natural and generic interface
+to the functionality defined by each protocol. In addition, you will find
+that the MIME (common encodings), URL (anything you could possible want to do
+with one) and LTN12 (filters, sinks, sources and pumps) modules can be very
+handy.")
+ (license (package-license lua-5.1))))
--
2.9.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 5/7] gnu: Add lua5.1-filesystem.
2016-08-22 19:39 [PATCH 0/7] Add Prosody Ricardo Wurmus
` (3 preceding siblings ...)
2016-08-22 19:39 ` [PATCH 4/7] gnu: Add lua5.1-socket Ricardo Wurmus
@ 2016-08-22 19:39 ` Ricardo Wurmus
2016-08-22 19:39 ` [PATCH 6/7] gnu: Add luasec Ricardo Wurmus
` (2 subsequent siblings)
7 siblings, 0 replies; 20+ messages in thread
From: Ricardo Wurmus @ 2016-08-22 19:39 UTC (permalink / raw)
To: guix-devel
* gnu/packages/lua.scm (lua5.1-filesystem): New variable.
---
gnu/packages/lua.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index 85c2727..a8acadb 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -191,3 +191,34 @@ that the MIME (common encodings), URL (anything you could possible want to do
with one) and LTN12 (filters, sinks, sources and pumps) modules can be very
handy.")
(license (package-license lua-5.1))))
+
+(define-public lua5.1-filesystem
+ (package
+ (name "lua-filesystem")
+ (version "1.6.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/keplerproject/"
+ "luafilesystem/archive/v_"
+ "1_6_3" ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0s10ckxin0bysd6gaywqhxkpw3ybjhprr8m655b8cx3pxjwd49am"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
+ #:test-target "test"
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure))))
+ (inputs
+ `(("lua" ,lua-5.1)))
+ (home-page "https://keplerproject.github.io/luafilesystem/index.html")
+ (synopsis "File system library for Lua")
+ (description "LuaFileSystem is a Lua library developed to complement the
+set of functions related to file systems offered by the standard Lua
+distribution. LuaFileSystem offers a portable way to access the underlying
+directory structure and file attributes.")
+ (license (package-license lua-5.1))))
--
2.9.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 6/7] gnu: Add luasec.
2016-08-22 19:39 [PATCH 0/7] Add Prosody Ricardo Wurmus
` (4 preceding siblings ...)
2016-08-22 19:39 ` [PATCH 5/7] gnu: Add lua5.1-filesystem Ricardo Wurmus
@ 2016-08-22 19:39 ` Ricardo Wurmus
2016-08-22 19:39 ` [PATCH 7/7] gnu: Add prosody Ricardo Wurmus
2016-08-22 20:03 ` [PATCH 0/7] Add Prosody Leo Famulari
7 siblings, 0 replies; 20+ messages in thread
From: Ricardo Wurmus @ 2016-08-22 19:39 UTC (permalink / raw)
To: guix-devel
* gnu/packages/lua.scm (lua5.1-sec): New variable.
---
gnu/packages/lua.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm
index a8acadb..ea1e1a3 100644
--- a/gnu/packages/lua.scm
+++ b/gnu/packages/lua.scm
@@ -28,6 +28,7 @@
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
#:use-module (gnu packages readline)
+ #:use-module (gnu packages tls)
#:use-module (gnu packages xml))
(define-public lua
@@ -222,3 +223,39 @@ set of functions related to file systems offered by the standard Lua
distribution. LuaFileSystem offers a portable way to access the underlying
directory structure and file attributes.")
(license (package-license lua-5.1))))
+
+(define-public lua5.1-sec
+ (package
+ (name "lua-sec")
+ (version "0.6")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/brunoos/luasec/archive/"
+ "luasec-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0pgd1anzznl4s0h16wg8dlw9mgdb9h52drlcki6sbf5y31fa7wyf"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:make-flags
+ (let ((out (assoc-ref %outputs "out")))
+ (list "linux"
+ "CC=gcc"
+ "LD=gcc"
+ (string-append "LUAPATH=" out "/share/lua/5.1")
+ (string-append "LUACPATH=" out "/lib/lua/5.1")))
+ #:tests? #f ; no tests included
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure))))
+ (inputs
+ `(("lua" ,lua-5.1)
+ ("openssl" ,openssl)))
+ (propagated-inputs
+ `(("lua-socket" ,lua5.1-socket)))
+ (home-page "https://github.com/brunoos/luasec/wiki")
+ (synopsis "OpenSSL bindings for Lua")
+ (description "LuaSec is a binding for OpenSSL library to provide TLS/SSL
+communication. It takes an already established TCP connection and creates a
+secure session between the peers.")
+ (license (package-license lua-5.1))))
--
2.9.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 7/7] gnu: Add prosody.
2016-08-22 19:39 [PATCH 0/7] Add Prosody Ricardo Wurmus
` (5 preceding siblings ...)
2016-08-22 19:39 ` [PATCH 6/7] gnu: Add luasec Ricardo Wurmus
@ 2016-08-22 19:39 ` Ricardo Wurmus
2016-08-23 1:33 ` Leo Famulari
2016-08-22 20:03 ` [PATCH 0/7] Add Prosody Leo Famulari
7 siblings, 1 reply; 20+ messages in thread
From: Ricardo Wurmus @ 2016-08-22 19:39 UTC (permalink / raw)
To: guix-devel
* gnu/packages/messaging.scm (prosody): New variable.
---
gnu/packages/messaging.scm | 78 ++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 76 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index de9ac17..2f81ff8 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -3,7 +3,7 @@
;;; Copyright © 2014 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
@@ -24,7 +24,7 @@
(define-module (gnu packages messaging)
#:use-module ((guix licenses)
#:select (gpl3+ gpl2+ gpl2 lgpl2.1 lgpl2.0+ bsd-2 non-copyleft
- asl2.0))
+ asl2.0 x11))
#:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix download)
@@ -45,6 +45,7 @@
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages libcanberra)
#:use-module (gnu packages libidn)
+ #:use-module (gnu packages lua)
#:use-module (gnu packages xml)
#:use-module (gnu packages gnupg)
#:use-module (gnu packages ncurses)
@@ -492,4 +493,77 @@ transformation; audio and video conferences; file transfer; TLS, GPG and
end-to-end encryption support; XML console.")
(license gpl3+)))
+(define-public prosody
+ (package
+ (name "prosody")
+ (version "0.9.10")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://prosody.im/downloads/source/"
+ "prosody-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0bv6s5c0iizz015hh1lxlwlw1iwvisywajm2rcrbdfyrskzfwdj8"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; no "check" target
+ #:modules ((ice-9 match)
+ (srfi srfi-1)
+ (guix build gnu-build-system)
+ (guix build utils))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-configure-script
+ (lambda _
+ ;; The configure script aborts when it encounters unexpected
+ ;; arguments. Make it more tolerant.
+ (substitute* "configure"
+ (("exit 1") ""))
+ #t))
+ (add-after 'install 'wrap-programs
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; Make sure all executables in "bin" find the required Lua
+ ;; modules at runtime.
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin/"))
+ (deps (delete #f (map (match-lambda
+ ((label . directory)
+ (if (string-prefix? "lua-" label)
+ directory #f)))
+ inputs)))
+ (path (string-join
+ (map (lambda (path)
+ (string-append path "/share/lua/5.1/?.lua;"
+ path "/share/lua/5.1/?/?.lua"))
+ (cons out deps))
+ ";"))
+ (cpath (string-join
+ (map (lambda (path)
+ (string-append path "/lib/lua/5.1/?.so;"
+ path "/lib/lua/5.1/?/?.so"))
+ (cons out deps))
+ ";")))
+ (for-each (lambda (file)
+ (wrap-program file
+ `("LUA_PATH" ";" = (,path))
+ `("LUA_CPATH" ";" = (,cpath))))
+ (find-files bin ".*"))
+ #t))))))
+ (inputs
+ `(("libidn" ,libidn)
+ ("openssl" ,openssl)
+ ("lua" ,lua-5.1)
+ ("lua-expat" ,lua5.1-expat)
+ ("lua-socket" ,lua5.1-socket)
+ ("lua-filesystem" ,lua5.1-filesystem)
+ ("lua-sec" ,lua5.1-sec)))
+ (home-page "https://prosody.im/")
+ (synopsis "Jabber (XMPP) server")
+ (description "Prosody is a modern XMPP communication server. It aims to
+be easy to set up and configure, and efficient with system resources.
+Additionally, for developers it aims to be easy to extend and give a flexible
+system on which to rapidly develop added functionality, or prototype new
+protocols.")
+ (license x11)))
+
;;; messaging.scm ends here
--
2.9.2
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 7/7] gnu: Add prosody.
2016-08-22 19:39 ` [PATCH 7/7] gnu: Add prosody Ricardo Wurmus
@ 2016-08-23 1:33 ` Leo Famulari
2016-08-28 10:37 ` Ricardo Wurmus
0 siblings, 1 reply; 20+ messages in thread
From: Leo Famulari @ 2016-08-23 1:33 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: guix-devel
On Mon, Aug 22, 2016 at 09:39:18PM +0200, Ricardo Wurmus wrote:
> * gnu/packages/messaging.scm (prosody): New variable.
> + (inputs
> + `(("libidn" ,libidn)
> + ("openssl" ,openssl)
> + ("lua" ,lua-5.1)
> + ("lua-expat" ,lua5.1-expat)
> + ("lua-socket" ,lua5.1-socket)
> + ("lua-filesystem" ,lua5.1-filesystem)
> + ("lua-sec" ,lua5.1-sec)))
I used `guix environment --ad-hoc` to put prosody in my environment, and
then I ran it without any configuration. It created the log file
'prosody.err', which contained this line, twice:
Aug 22 21:31:33 localhost:tls error Unable to initialize TLS: LuaSec (required for encryption) was not found
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 7/7] gnu: Add prosody.
2016-08-23 1:33 ` Leo Famulari
@ 2016-08-28 10:37 ` Ricardo Wurmus
2016-08-30 1:36 ` Leo Famulari
0 siblings, 1 reply; 20+ messages in thread
From: Ricardo Wurmus @ 2016-08-28 10:37 UTC (permalink / raw)
To: Leo Famulari; +Cc: guix-devel
Leo Famulari <leo@famulari.name> writes:
> On Mon, Aug 22, 2016 at 09:39:18PM +0200, Ricardo Wurmus wrote:
>> * gnu/packages/messaging.scm (prosody): New variable.
>
>> + (inputs
>> + `(("libidn" ,libidn)
>> + ("openssl" ,openssl)
>> + ("lua" ,lua-5.1)
>> + ("lua-expat" ,lua5.1-expat)
>> + ("lua-socket" ,lua5.1-socket)
>> + ("lua-filesystem" ,lua5.1-filesystem)
>> + ("lua-sec" ,lua5.1-sec)))
>
> I used `guix environment --ad-hoc` to put prosody in my environment, and
> then I ran it without any configuration. It created the log file
> 'prosody.err', which contained this line, twice:
>
> Aug 22 21:31:33 localhost:tls error Unable to initialize TLS: LuaSec (required for encryption) was not found
Hmm, I see the same. I don’t know why this happens. With LUA_CPATH and
LUA_PATH set as they are in the wrapper I can load the “ssl” module just
fine.
./pre-inst-env guix environment --ad-hoc lua@5.1 lua5.1-sec
export LUA_PATH="/gnu/store/y9qhxky4dcgaiar7cw3fkzy8b4nqdx4z-prosody-0.9.10/share/lua/5.1/?.lua;/gnu/store/y9qhxky4dcgaiar7cw3fkzy8b4nqdx4z-prosody-0.9.10/share/lua/5.1/?/?.lua;/gnu/store/j5xs64837lcab0nkhywlq22gvbcgg2wy-lua-5.1.5/share/lua/5.1/?.lua;/gnu/store/j5xs64837lcab0nkhywlq22gvbcgg2wy-lua-5.1.5/share/lua/5.1/?/?.lua;/gnu/store/chl4bnz42nsjplvhq1vz91y0i1n4b35c-lua5.1-expat-1.3.0/share/lua/5.1/?.lua;/gnu/store/chl4bnz42nsjplvhq1vz91y0i1n4b35c-lua5.1-expat-1.3.0/share/lua/5.1/?/?.lua;/gnu/store/129p6qd6ffqq36zilgxancigaa201qqv-lua5.1-socket-2.0.2/share/lua/5.1/?.lua;/gnu/store/129p6qd6ffqq36zilgxancigaa201qqv-lua5.1-socket-2.0.2/share/lua/5.1/?/?.lua;/gnu/store/3g6p2qq0y4nz9q9wx6am9sadhifxsabv-lua5.1-filesystem-1.6.3/share/lua/5.1/?.lua;/gnu/store/3g6p2qq0y4nz9q9wx6am9sadhifxsabv-lua5.1-filesystem-1.6.3/share/lua/5.1/?/?.lua;/gnu/store/bvf9yz1xci6i811ls37aji9w71fxhx8y-lua5.1-sec-0.6/share/lua/5.1/?.lua;/gnu/store/bvf9yz1xci6i811ls37aji9w71fxhx8y-lua5.1-sec-0.6/share/lua/5.1/?/?.lua"
export
LUA_CPATH="/gnu/store/y9qhxky4dcgaiar7cw3fkzy8b4nqdx4z-prosody-0.9.10/lib/lua/5.1/?.so;/gnu/store/y9qhxky4dcgaiar7cw3fkzy8b4nqdx4z-prosody-0.9.10/lib/lua/5.1/?/?.so;/gnu/store/j5xs64837lcab0nkhywlq22gvbcgg2wy-lua-5.1.5/lib/lua/5.1/?.so;/gnu/store/j5xs64837lcab0nkhywlq22gvbcgg2wy-lua-5.1.5/lib/lua/5.1/?/?.so;/gnu/store/chl4bnz42nsjplvhq1vz91y0i1n4b35c-lua5.1-expat-1.3.0/lib/lua/5.1/?.so;/gnu/store/chl4bnz42nsjplvhq1vz91y0i1n4b35c-lua5.1-expat-1.3.0/lib/lua/5.1/?/?.so;/gnu/store/129p6qd6ffqq36zilgxancigaa201qqv-lua5.1-socket-2.0.2/lib/lua/5.1/?.so;/gnu/store/129p6qd6ffqq36zilgxancigaa201qqv-lua5.1-socket-2.0.2/lib/lua/5.1/?/?.so;/gnu/store/3g6p2qq0y4nz9q9wx6am9sadhifxsabv-lua5.1-filesystem-1.6.3/lib/lua/5.1/?.so;/gnu/store/3g6p2qq0y4nz9q9wx6am9sadhifxsabv-lua5.1-filesystem-1.6.3/lib/lua/5.1/?/?.so;/gnu/store/bvf9yz1xci6i811ls37aji9w71fxhx8y-lua5.1-sec-0.6/lib/lua/5.1/?.so;/gnu/store/bvf9yz1xci6i811ls37aji9w71fxhx8y-lua5.1-sec-0.6/lib/lua/5.1/?/?.so"
lua
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
> require "ssl"
> ssl_available = pcall(require, "ssl");
> print(ssl_available);
true
The error is reported in “core/certmanager.lua” in the function
“create_context”, which contains this line:
if not ssl then return nil, "LuaSec (required for encryption) was not found"; end
“ssl” doesn’t appear to be defined anywhere. At the top of the file
it’s just “local ssl = ssl;”.
LuaSec is found by “util/dependencies.lua” or else we would see a
complaint printed to stdout upon application start.
Archlinux users also reported problems with latest prosody and latest
luasec: https://bugs.archlinux.org/task/48480
This makes me think that this is not a problem with this package per se,
but with Prosody.
~~ Ricardo
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/7] Add Prosody
2016-08-22 19:39 [PATCH 0/7] Add Prosody Ricardo Wurmus
` (6 preceding siblings ...)
2016-08-22 19:39 ` [PATCH 7/7] gnu: Add prosody Ricardo Wurmus
@ 2016-08-22 20:03 ` Leo Famulari
2016-08-22 20:37 ` Ricardo Wurmus
7 siblings, 1 reply; 20+ messages in thread
From: Leo Famulari @ 2016-08-22 20:03 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: guix-devel
On Mon, Aug 22, 2016 at 09:39:11PM +0200, Ricardo Wurmus wrote:
> Hi Guix,
>
> this patch series adds a package for the XMPP server Prosody.
>
> The first patch is needed to allow Lua to load dynamic libraries via dlopen.
>
> I'm not sure about the naming. Prosody needs Lua 5.1, so I didn't even
> attempt to build the Lua packages for any later version. The variable names
> all have a "lua5.1-" prefix, but the packages themselves don't; should they?
I'm not sure either; I think this is fine.
I found the commit messages a little confusing, especially the luasec
commit. It adds "luasec", but there is no package name or variable
called "luasec". I know that the upstream package name is "LuaSec". A
very minor quibble...
>
> ~~ Ricardo
>
> Ricardo Wurmus (7):
> gnu: lua: Build with support for dynamic libraries.
> gnu: lua: Use "license:" prefix.
> gnu: Add lua5.1-expat.
> gnu: Add lua5.1-socket.
> gnu: Add lua5.1-filesystem.
> gnu: Add luasec.
> gnu: Add prosody.
>
> gnu/packages/lua.scm | 168 ++++++++++++++++++++++++++++++++++++++++++---
> gnu/packages/messaging.scm | 78 ++++++++++++++++++++-
> 2 files changed, 236 insertions(+), 10 deletions(-)
>
> --
> 2.9.2
>
>
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 0/7] Add Prosody
2016-08-22 20:03 ` [PATCH 0/7] Add Prosody Leo Famulari
@ 2016-08-22 20:37 ` Ricardo Wurmus
0 siblings, 0 replies; 20+ messages in thread
From: Ricardo Wurmus @ 2016-08-22 20:37 UTC (permalink / raw)
To: Leo Famulari; +Cc: guix-devel
Leo Famulari <leo@famulari.name> writes:
> On Mon, Aug 22, 2016 at 09:39:11PM +0200, Ricardo Wurmus wrote:
>> Hi Guix,
>>
>> this patch series adds a package for the XMPP server Prosody.
>>
>> The first patch is needed to allow Lua to load dynamic libraries via dlopen.
>>
>> I'm not sure about the naming. Prosody needs Lua 5.1, so I didn't even
>> attempt to build the Lua packages for any later version. The variable names
>> all have a "lua5.1-" prefix, but the packages themselves don't; should they?
>
> I'm not sure either; I think this is fine.
On second thought we should change the package names to have a “lua5.1-”
prefix, because we do something similar with Python packages.
> I found the commit messages a little confusing, especially the luasec
> commit. It adds "luasec", but there is no package name or variable
> called "luasec". I know that the upstream package name is "LuaSec". A
> very minor quibble...
True. I’ll change this so that the Guix package names are used. In
this case this would mean changing “luasec” to “lua5.1-sec” in the
commit message.
~~ Ricardo
^ permalink raw reply [flat|nested] 20+ messages in thread