From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH] gnu: libreoffice: Add 'libreoffice' symlink. Date: Tue, 06 Dec 2016 23:35:07 +0300 Message-ID: <87wpfcssn8.fsf@gmail.com> References: <20161206195241.23575-1-ng0@libertad.pw> <20161206200444.24200-1-ng0@libertad.pw> <20161206200444.24200-2-ng0@libertad.pw> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEMTF-00084N-Qn for guix-devel@gnu.org; Tue, 06 Dec 2016 15:36:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cEMTB-0000hk-Rz for guix-devel@gnu.org; Tue, 06 Dec 2016 15:36:13 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:32992) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cEMTB-0000gx-Ku for guix-devel@gnu.org; Tue, 06 Dec 2016 15:36:09 -0500 Received: by mail-wm0-f65.google.com with SMTP id u144so23738919wmu.0 for ; Tue, 06 Dec 2016 12:36:09 -0800 (PST) In-Reply-To: <20161206200444.24200-2-ng0@libertad.pw> (ng0@libertad.pw's message of "Tue, 6 Dec 2016 20:04:44 +0000") 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: ng0 Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 =C2=A9 2014 John Darrington > ;;; Copyright =C2=A9 2015 Andreas Enge > ;;; Copyright =C2=A9 2016 Efraim Flashner > +;;; Copyright =C2=A9 2016 ng0 > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -828,7 +829,15 @@ and to return information on pronunciations, meaning= s 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 scrip= t. > + (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 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. > + (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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=libreoffice-link.diff 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 --=-=-= Content-Type: text/plain -- Alex --=-=-=--