From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: RFC: Build system hacks for Guix do not belong in 'source' Date: Tue, 10 Mar 2015 12:23:29 -0400 Message-ID: <87egow254u.fsf@netris.org> References: <1424552053-17323-1-git-send-email-rekado@elephly.net> <1424552053-17323-2-git-send-email-rekado@elephly.net> <878ufr6kf0.fsf@mango.localdomain> <87h9udbraa.fsf@mango.localdomain> <871tlexf9r.fsf@gnu.org> <87twy9abtb.fsf@mango.localdomain> <87lhjk61nb.fsf@gnu.org> <87h9u4akv7.fsf@mango.localdomain> <87h9u40vus.fsf@netris.org> <87zj7t8cj8.fsf@mango.localdomain> <87y4nd8cao.fsf@mango.localdomain> <87wq2x81dr.fsf@mango.localdomain> <87oao7guh3.fsf_-_@netris.org> <87vbi96yoe.fsf@mango.localdomain> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVMw7-0002tI-D2 for guix-devel@gnu.org; Tue, 10 Mar 2015 12:23:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVMw3-0004WC-Uo for guix-devel@gnu.org; Tue, 10 Mar 2015 12:23:15 -0400 Received: from world.peace.net ([50.252.239.5]:44733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVMw3-0004W2-S9 for guix-devel@gnu.org; Tue, 10 Mar 2015 12:23:11 -0400 In-Reply-To: <87vbi96yoe.fsf@mango.localdomain> (Ricardo Wurmus's message of "Tue, 10 Mar 2015 09:31:45 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ricardo Wurmus Cc: guix-devel@gnu.org Ricardo Wurmus writes: > Mark H Weaver writes: > >> I think that both the 'ldconfig -> true' hack and the LIBDIR >> substitution should be moved to a build phase for both of these >> packages. > > Attached are updated patches, moving the build hacks from snippets to a > build phase. > > ~~ Ricardo > > From abdbfec11164c61cfdb6fc88ddf9abd2e58aa027 Mon Sep 17 00:00:00 2001 > From: Ricardo Wurmus > Date: Wed, 4 Mar 2015 11:50:26 +0100 > Subject: [PATCH 1/2] gnu: zita-alsa-pcmi: set LIBDIR to "lib". > > * gnu/packages/audio.scm (zita-alsa-pcmi)[source, arguments]: Set LIBDIR to > "lib" in build phase. Remove snippet. I wouldn't write [source, arguments] here when the first sentence that follows doesn't relate to 'source' at all. Also, instead of "Remove snippet", how about "Move snippet to build phase"? Maybe something like this: --8<---------------cut here---------------start------------->8--- gnu: zita-alsa-pcmi: Move snippet to build phase and set LIBDIR. * gnu/packages/audio.scm (zita-alsa-pcmi): Move snippet to build phase and set LIBDIR. --8<---------------cut here---------------end--------------->8--- > @@ -1044,8 +1040,12 @@ interface.") > #:phases > (alist-cons-after > 'unpack > - 'enter-directory > - (lambda _ (chdir "libs")) > + 'fix-makefile > + (lambda _ > + (substitute* "libs/Makefile" > + (("ldconfig") "true") > + (("^LIBDIR =.*") "LIBDIR = lib\n")) > + (chdir "libs")) It still enters the directory, so 'fix-makefile' doesn't quite cover it. How about 'patch-Makefile-and-enter-directory' ? Also, 'chdir' returns an unspecified value, but phases must return a true value to indicate success. So please add #t after the chdir, maybe something like this: --8<---------------cut here---------------start------------->8--- (alist-cons-after 'unpack 'patch-makefile-and-enter-directory (lambda _ (substitute* "libs/Makefile" (("ldconfig") "true") (("^LIBDIR =.*") "LIBDIR = lib\n")) (chdir "libs") #t) --8<---------------cut here---------------end--------------->8--- (It is true that in Guile, "an unspecified value" is normally a true value, but it's bad practice to write code that depends on that). All of these comments apply to the other patch as well. After considering these suggestions, okay to push. Thanks! Mark