diff mbox

gnu: libreoffice: Add 'libreoffice' symlink.

Message ID 20161205122551.12427-2-ng0@libertad.pw
State New
Headers show

Commit Message

ng0 Dec. 5, 2016, 12:25 p.m. UTC
* gnu/packages/libreoffice.scm (libreoffice)[arguments] Create symlink to
libreoffice in new phase.
---
 gnu/packages/libreoffice.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Hartmut Goebel Dec. 5, 2016, 12:40 p.m. UTC | #1
Am 05.12.2016 um 13:25 schrieb ng0:
> +                 (symlink
> +                   (string-append out "/lib/libreoffice/program/soffice")
> +                   (string-append bin "/libreoffice")))

That's a good idea. But why not a relative sym-link?
ng0 Dec. 5, 2016, 2:16 p.m. UTC | #2
Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 05.12.2016 um 13:25 schrieb ng0:
>> +                 (symlink
>> +                   (string-append out "/lib/libreoffice/program/soffice")
>> +                   (string-append bin "/libreoffice")))
>
> That's a good idea. But why not a relative sym-link?
>
> -- 
> Regards
> Hartmut Goebel
>
> | Hartmut Goebel          | h.goebel@crazy-compilers.com               |
> | www.crazy-compilers.com | compilers which you thought are impossible |
>
>
>

Okay, I have no preference for the symlink type or how it's
done.
Feel free to co-author your bits, there's no way I'm building
libreoffice for the 8th time in 3 days for this minor change.
Hartmut Goebel Dec. 6, 2016, 10:42 a.m. UTC | #3
Am 05.12.2016 um 15:16 schrieb ng0:
> Okay, I have no preference for the symlink type or how it's
> done.
> Feel free to co-author your bits, there's no way I'm building
> libreoffice for the 8th time in 3 days for this minor change.

Fair point :-) If I'm the only one asking for relative sym-links, please
ignore my comment.
Alex Kost Dec. 6, 2016, 6:54 p.m. UTC | #4
Hartmut Goebel (2016-12-06 11:42 +0100) wrote:

> Am 05.12.2016 um 15:16 schrieb ng0:
>> Okay, I have no preference for the symlink type or how it's
>> done.
>> Feel free to co-author your bits, there's no way I'm building
>> libreoffice for the 8th time in 3 days for this minor change.
>
> Fair point :-) If I'm the only one asking for relative sym-links, please
> ignore my comment.

I would also prefer a relative symlink (but I'm not going to build
libreoffice :-))
ng0 Dec. 6, 2016, 7:52 p.m. UTC | #5
Maybe the threaded patch can be shorter when with-directory-excursion is used?
ng0 Dec. 6, 2016, 8:04 p.m. UTC | #6
v3: uses with-directory-excursion
diff mbox

Patch

diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm
index e02e4f4cd..245e932d4 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,6 +829,15 @@  and to return information on pronunciations, meanings and synonyms.")
                  (symlink
                    (string-append out "/lib/libreoffice/program/soffice")
                    (string-append bin "/soffice")))
+               #t))
+           (add-after 'bin-install 'symlink-soffice
+             ;; Create a symlink bin/libreoffice to the executable script.
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin")))
+                 (symlink
+                   (string-append out "/lib/libreoffice/program/soffice")
+                   (string-append bin "/libreoffice")))
                #t)))
        #:configure-flags
         (list