From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id eDIeAOdhwV5+NAAA0tVLHw (envelope-from ) for ; Sun, 17 May 2020 16:10:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 0G2ZN+ZhwV54SwAA1q6Kng (envelope-from ) for ; Sun, 17 May 2020 16:10:14 +0000 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 1147794060B for ; Sun, 17 May 2020 16:10:14 +0000 (UTC) Received: from localhost ([::1]:47696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaLrg-0001RC-KV for larch@yhetil.org; Sun, 17 May 2020 12:10:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaLrX-0001Qb-VF for guix-patches@gnu.org; Sun, 17 May 2020 12:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:32884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaLrX-0003NU-MB for guix-patches@gnu.org; Sun, 17 May 2020 12:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jaLrX-00063A-Gf for guix-patches@gnu.org; Sun, 17 May 2020 12:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41363] [PATCH 2/3] gnu: Add lua-cqueues. Resent-From: Simon South Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 May 2020 16:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41363 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 41363@debbugs.gnu.org Received: via spool by 41363-submit@debbugs.gnu.org id=B41363.158973180223238 (code B ref 41363); Sun, 17 May 2020 16:10:03 +0000 Received: (at 41363) by debbugs.gnu.org; 17 May 2020 16:10:02 +0000 Received: from localhost ([127.0.0.1]:44428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaLrU-00062X-S8 for submit@debbugs.gnu.org; Sun, 17 May 2020 12:10:01 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:48880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaLrT-00062B-Kh for 41363@debbugs.gnu.org; Sun, 17 May 2020 12:10:00 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 87A6E21218 for <41363@debbugs.gnu.org>; Sun, 17 May 2020 16:09:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo06-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo06-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Iv3Zefq-ThAe for <41363@debbugs.gnu.org>; Sun, 17 May 2020 16:09:54 +0000 (UTC) Received: from mercury.simonsouth.net (unknown [108.162.141.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 40D49211FB for <41363@debbugs.gnu.org>; Sun, 17 May 2020 16:09:52 +0000 (UTC) From: Simon South Date: Sun, 17 May 2020 12:09:39 -0400 Message-Id: <20200517160940.5132-2-simon@simonsouth.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200517160940.5132-1-simon@simonsouth.net> References: <20200517160940.5132-1-simon@simonsouth.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 3.99 X-TUID: hff85ZTjsEpA * gnu/packages/lua.scm (make-lua-cqueues): New function. (lua-cqueues, lua5.1-cqueues, lua5.2-cqueues): New variables. --- gnu/packages/lua.scm | 106 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index 147ed8d9f7..958b317d62 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -403,6 +403,112 @@ secure session between the peers.") (define-public lua5.2-sec (make-lua-sec "lua5.2-sec" lua-5.2)) +(define (make-lua-cqueues name lua lua-ossl) + (package + (name name) + (version "20171014") + (source (origin + (method url-fetch) + (uri (string-append "https://25thandclement.com/~william/" + "projects/releases/cqueues-" version ".tgz")) + (sha256 + (base32 + "1dabhpn6r0hlln8vx9hxm34pfcm46qzgpb2apmziwg5z51fi4ksb")))) + (build-system gnu-build-system) + (arguments + `(#:modules ((guix build gnu-build-system) + (guix build utils) + (ice-9 string-fun)) + #:make-flags + (let ((out (assoc-ref %outputs "out")) + (lua-api-version ,(version-major+minor (package-version lua)))) + (list "CC=gcc" + (string-append "LUA_APIS=" lua-api-version))) + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (replace 'install + (lambda* (#:key make-flags outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (apply invoke "make" "install" + (append make-flags + (list (string-append "DESTDIR=" out) + "prefix=")))))) + (add-after 'install 'check + (lambda* (#:key inputs outputs make-flags #:allow-other-keys) + (let* + ((lua-version ,(version-major+minor (package-version lua))) + (env-suffix (if (equal? lua-version "5.1") + "" + (string-append + "_" + (string-replace-substring lua-version "." "_")))) + + (lua-ossl (assoc-ref inputs "lua-ossl")) + (out (assoc-ref outputs "out")) + + (lua-cpath (lambda (p) + (string-append p "/lib/lua/" lua-version "/?.so"))) + (lua-path (lambda (p) + (string-append p "/share/lua/" lua-version "/?.lua")))) + ;; The test suite sets Lua-version-specific search-path variables + ;; when available so we must do the same, as these take + ;; precedence over the generic "LUA_CPATH" and "LUA_PATH" + (setenv (string-append "LUA_CPATH" env-suffix) + (string-append + (string-join (map lua-cpath (list out lua-ossl)) ";") + ";;")) + (setenv (string-append "LUA_PATH" env-suffix) + (string-append + (string-join (map lua-path (list out lua-ossl)) ";") + ";;")) + + ;; Skip regression tests we expect to fail + (with-directory-excursion "regress" + (for-each (lambda (f) + (rename-file f (string-append f ".skip"))) + (append + ;; Regression tests that require network + ;; connectivity + '("22-client-dtls.lua" + "30-starttls-completion.lua" + "62-noname.lua" + "153-dns-resolvers.lua") + + ;; Regression tests that require LuaJIT + '("44-resolvers-gc.lua" + "51-join-defunct-thread.lua") + + ;; Regression tests that require Lua 5.3 + (if (not (equal? lua-version "5.3")) + '("152-thread-integer-passing.lua") + '())))) + + (apply invoke "make" "check" make-flags))))))) + (native-inputs + `(("m4" ,m4))) + (inputs + `(("lua" ,lua) + ("openssl" ,openssl))) + (propagated-inputs + `(("lua-ossl" ,lua-ossl))) + (home-page "https://25thandclement.com/~william/projects/cqueues.html") + (synopsis "Event loop for Lua using continuation queues") + (description "The cqueues extension module for Lua implements an event loop +that operates through the yielding and resumption of coroutines. It is designed +to be non-intrusive, composable, and embeddable within existing applications.") + (license license:expat))) + +(define-public lua-cqueues + (make-lua-cqueues "lua-cqueues" lua lua-ossl)) + +(define-public lua5.1-cqueues + (make-lua-cqueues "lua5.1-cqueues" lua-5.1 lua5.1-ossl)) + +(define-public lua5.2-cqueues + (make-lua-cqueues "lua5.2-cqueues" lua-5.2 lua5.2-ossl)) + (define-public lua-penlight (package (name "lua-penlight") -- 2.26.2