bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29686: gnu: aspell: Do not ignore GuixOS system profile.


From: Oleg Pykhalov
Subject: bug#29686: gnu: aspell: Do not ignore GuixOS system profile.
Date: Wed, 13 Dec 2017 09:43:19 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hello Guix,

Currently, if aspell is installed in GuixOS system profile and not in
user profile then aspell cannot find dictionaries.

(define-public aspell
  (package
    ;; …
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'install 'wrap-aspell
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((bin/aspell (string-append (assoc-ref outputs "out")
                                              "/bin/aspell")))
               (wrap-program bin/aspell
                 '("ASPELL_CONF" "" =
                   ("${ASPELL_CONF:-\"dict-dir 
${GUIX_PROFILE:-$HOME/.guix-profile}/lib/aspell\"}")))))))))
    ;; …
    ))

I have a solution on top of existing wrapper, but what is a good way to
implement the following?

--8<---------------cut here---------------start------------->8---
LIB_ASPELL=lib/aspell
HOME_PROFILE=$HOME/.guix-profile
SYSTEM_PROFILE=/run/current-system/profile

if [ -z ${GUIX_PROFILE} ]; then
    if [ -d $HOME_PROFILE/$LIB_ASPELL ]; then
        GUIX_PROFILE=$HOME_PROFILE
    elif [ -d $SYSTEM_PROFILE/$LIB_ASPELL ]; then
        GUIX_PROFILE=$SYSTEM_PROFILE
    fi
fi

export ASPELL_CONF="${ASPELL_CONF:-"dict-dir ${GUIX_PROFILE}/lib/aspell"}"
--8<---------------cut here---------------end--------------->8---

Thanks,
Oleg.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]