unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ng0 <ng0@libertad.pw>
To: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: libreoffice: Add 'libreoffice' symlink.
Date: Tue, 06 Dec 2016 20:42:04 +0000	[thread overview]
Message-ID: <8760mw6b8j.fsf@we.make.ritual.n0.is> (raw)
In-Reply-To: <87wpfcssn8.fsf@gmail.com>

Alex Kost <alezost@gmail.com> 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 <jmd@gnu.org>
>>  ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
>>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>> +;;; Copyright © 2016 ng0 <ng0@libertad.pw>
>>  ;;;
>>  ;;; 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

  reply	other threads:[~2016-12-06 20:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05 12:25 [PATCH] Add libreoffice symlink to libreoffice ng0
2016-12-05 12:25 ` [PATCH] gnu: libreoffice: Add 'libreoffice' symlink ng0
2016-12-05 12:40   ` Hartmut Goebel
2016-12-05 14:16     ` ng0
2016-12-06 10:42       ` Hartmut Goebel
2016-12-06 18:54         ` Alex Kost
2016-12-06 19:52           ` [PATCH] libreoffice symlink, v2 ng0
2016-12-06 19:52             ` [PATCH] gnu: libreoffice: Add 'libreoffice' symlink ng0
2016-12-06 20:04             ` [PATCH] libreoffice symlink, v3 ng0
2016-12-06 20:04               ` [PATCH] gnu: libreoffice: Add 'libreoffice' symlink ng0
2016-12-06 20:35                 ` Alex Kost
2016-12-06 20:42                   ` ng0 [this message]
2016-12-08  9:37                     ` Alex Kost
2016-12-08 22:48                       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760mw6b8j.fsf@we.make.ritual.n0.is \
    --to=ng0@libertad.pw \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).