Message ID | 20160822193918.27397-2-rekado@elephly.net |
---|---|
State | New |
Headers |
Received: (qmail 78667 invoked by uid 89); 22 Aug 2016 19:40:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=4414 X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Aug 2016 19:39:54 +0000 Received: from localhost ([::1]:42858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <guix-devel-bounces+patchwork=sourceware.org@gnu.org>) id 1bbv4a-00089L-Qh for patchwork@sourceware.org; Mon, 22 Aug 2016 15:39:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <rekado@elephly.net>) id 1bbv4O-00085h-E1 for guix-devel@gnu.org; Mon, 22 Aug 2016 15:39:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <rekado@elephly.net>) id 1bbv4F-0008Db-Jn for guix-devel@gnu.org; Mon, 22 Aug 2016 15:39:39 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:24888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rekado@elephly.net>) id 1bbv4F-0008DW-Bo for guix-devel@gnu.org; Mon, 22 Aug 2016 15:39:31 -0400 Received: from localhost (xd933e4c5.dyn.telefonica.de [217.51.228.197]) by mx.zohomail.com with SMTPS id 1471894768592893.2749317406021; Mon, 22 Aug 2016 12:39:28 -0700 (PDT) From: Ricardo Wurmus <rekado@elephly.net> To: guix-devel@gnu.org Subject: [PATCH 1/7] gnu: lua: Build with support for dynamic libraries. Date: Mon, 22 Aug 2016 21:39:12 +0200 Message-Id: <20160822193918.27397-2-rekado@elephly.net> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160822193918.27397-1-rekado@elephly.net> References: <20160822193918.27397-1-rekado@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ZohoMail: Z_26063301 SPT_1 Z_26062608 SPT_0 X-Zoho-Virus-Status: 2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 74.201.84.163 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." <guix-devel.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-devel>, <mailto:guix-devel-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/guix-devel/> List-Post: <mailto:guix-devel@gnu.org> List-Help: <mailto:guix-devel-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-devel>, <mailto:guix-devel-request@gnu.org?subject=subscribe> Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" <guix-devel-bounces+patchwork=sourceware.org@gnu.org> |
Commit Message
Ricardo Wurmus
Aug. 22, 2016, 7:39 p.m. UTC
* 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(-)
Comments
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.
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.
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
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.
On Tue, Aug 30, 2016 at 10:44:24AM +0200, gno wrote: > > (damn, i keep forgetting adding guix devel to CC) > I just hit 'reply-all' and hope it works.
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")))