From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: Re: [PATCH] gnu: libreoffice: Add 'libreoffice' symlink. Date: Tue, 06 Dec 2016 20:42:04 +0000 Message-ID: <8760mw6b8j.fsf@we.make.ritual.n0.is> References: <20161206195241.23575-1-ng0@libertad.pw> <20161206200444.24200-1-ng0@libertad.pw> <20161206200444.24200-2-ng0@libertad.pw> <87wpfcssn8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEMZI-0001Dl-8K for guix-devel@gnu.org; Tue, 06 Dec 2016 15:42:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cEMZE-0002fT-Ab for guix-devel@gnu.org; Tue, 06 Dec 2016 15:42:28 -0500 Received: from aibo.runbox.com ([91.220.196.211]:53822) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cEMZE-0002c9-0c for guix-devel@gnu.org; Tue, 06 Dec 2016 15:42:24 -0500 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by bars.runbox.com with esmtp (Exim 4.71) (envelope-from ) id 1cEMZC-0004Ez-9D for guix-devel@gnu.org; Tue, 06 Dec 2016 21:42:22 +0100 Received: from 4.tor.exit.babylon.network ([212.117.180.21] helo=localhost) by mailfront11.runbox.com with esmtpsa (uid:892961 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1cEMYz-0004zJ-Mz for guix-devel@gnu.org; Tue, 06 Dec 2016 21:42:10 +0100 In-Reply-To: <87wpfcssn8.fsf@gmail.com> 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" To: guix-devel@gnu.org Alex Kost writes: > ng0 (2016-12-06 20:04 +0000) wrote: > >> * gnu/packages/libreoffice.scm (libreoffice)[arguments]: Create symlink to >> libreoffice in new phase. >> --- >> gnu/packages/libreoffice.scm | 11 ++++++++++- >> 1 file changed, 10 insertions(+), 1 deletion(-) >> >> diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm >> index e02e4f4cd..5f1435745 100644 >> --- a/gnu/packages/libreoffice.scm >> +++ b/gnu/packages/libreoffice.scm >> @@ -2,6 +2,7 @@ >> ;;; Copyright © 2014 John Darrington >> ;;; Copyright © 2015 Andreas Enge >> ;;; Copyright © 2016 Efraim Flashner >> +;;; Copyright © 2016 ng0 >> ;;; >> ;;; This file is part of GNU Guix. >> ;;; >> @@ -828,7 +829,15 @@ and to return information on pronunciations, meanings and synonyms.") >> (symlink >> (string-append out "/lib/libreoffice/program/soffice") >> (string-append bin "/soffice"))) >> - #t))) >> + #t)) >> + (add-after 'bin-install 'symlink-libreoffice >> + ;; Create a symlink bin/libreoffice to the executable script. >> + (lambda* (#:key outputs #:allow-other-keys) >> + (let* ((out (assoc-ref outputs "out"))) > > This 'let*' is not needed (since you don't use 'out' variable), however Oh, thanks for catching it. > I've just noticed that there is 'bin-install' phase right before it, so > I think an additional phase is not needed at all, the required > symlinking can be done in that 'bin-install' phase. Okay, I did not want to touch that because I did think for some reason it should be separated, but what you provided as diff further below looks better than my approach. I'd be okay with this. My change is so small, you could probably create your own patch and send it to this thread. > >> + (with-directory-excursion >> + (string-append (assoc-ref outputs "out") "/bin") >> + (symlink "soffice" "libreoffice")) >> + #t))) >> #:configure-flags >> (list >> "--enable-release-build" > > Previously I thought that libreoffice provides "bin/soffice" binary, so > I "voted" for a symlink (as it would simply be "libreoffice -> > soffice"). But now I see that "soffice" is a symlink created by > 'bin-install' phase. So now I would just modify that phase like this: > > diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm > index e02e4f4..6391482 100644 > --- a/gnu/packages/libreoffice.scm > +++ b/gnu/packages/libreoffice.scm > @@ -823,11 +823,12 @@ and to return information on pronunciations, meanings and synonyms.") > ;; Create a symlink bin/soffice to the executable script. > (lambda* (#:key outputs #:allow-other-keys) > (let* ((out (assoc-ref outputs "out")) > - (bin (string-append out "/bin"))) > + (bin (string-append out "/bin")) > + (soffice (string-append > + out "/lib/libreoffice/program/soffice"))) > (mkdir bin) > - (symlink > - (string-append out "/lib/libreoffice/program/soffice") > - (string-append bin "/soffice"))) > + (symlink soffice (string-append bin "/soffice")) > + (symlink soffice (string-append bin "/libreoffice"))) > #t))) > #:configure-flags > (list > > -- > Alex -- ♥Ⓐ ng0 | ng0.chaosnet.org