guix-commits
[Top][All Lists]
Advanced

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

01/02: gnu: aspell: Truly honor $ASPELL_DICT_DIR.


From: guix-commits
Subject: 01/02: gnu: aspell: Truly honor $ASPELL_DICT_DIR.
Date: Thu, 14 Nov 2019 16:39:00 -0500 (EST)

civodul pushed a commit to branch core-updates
in repository guix.

commit 4554d6b77e0f306a3dc33a8c1f68c9a302967a08
Author: Ludovic Courtès <address@hidden>
Date:   Thu Nov 14 22:30:24 2019 +0100

    gnu: aspell: Truly honor $ASPELL_DICT_DIR.
    
    Fixes <https://bugs.gnu.org/29686>.
    Reported by Oleg Pykhalov <address@hidden>.
    
    * gnu/packages/aspell.scm (aspell)[arguments]: Remove 'wrap-aspell' phase.
    * gnu/packages/patches/aspell-default-dict-dir.patch: Add hunk to expand
    the right-hand size of '|' in values like "<$FOO|$BAR/baz>".  Change
    DICT_DIR to refer to "$HOME" on the right-hand side.
---
 gnu/packages/aspell.scm                            | 10 +--------
 gnu/packages/patches/aspell-default-dict-dir.patch | 24 +++++++++++++++++++++-
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/aspell.scm b/gnu/packages/aspell.scm
index 4f6f1a1..f0e0fbc 100644
--- a/gnu/packages/aspell.scm
+++ b/gnu/packages/aspell.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2017, 2018 Ludovic Courtès <address@hidden>
+;;; Copyright © 2013, 2014, 2015, 2017, 2018, 2019 Ludovic Courtès 
<address@hidden>
 ;;; Copyright © 2015, 2016 Alex Kost <address@hidden>
 ;;; Copyright © 2016 John Darrington <address@hidden>
 ;;; Copyright © 2016, 2017, 2019 Efraim Flashner <address@hidden>
@@ -65,14 +65,6 @@
                  (("\"filter-path(.*)DICT_DIR" _ middle)
                   (string-append "\"filter-path" middle
                                  "\"" libdir "\"")))
-               #t)))
-         (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\"}")))
                #t))))))
     (inputs `(("perl" ,perl)))
 
diff --git a/gnu/packages/patches/aspell-default-dict-dir.patch 
b/gnu/packages/patches/aspell-default-dict-dir.patch
index 17a6ff6..5f759a6 100644
--- a/gnu/packages/patches/aspell-default-dict-dir.patch
+++ b/gnu/packages/patches/aspell-default-dict-dir.patch
@@ -8,12 +8,34 @@ However it is necessary for applications that use libaspell 
since
 
 --- a/common/config.cpp
 +++ b/common/config.cpp
+@@ -651,7 +651,20 @@ namespace acommon {
+         } else { // sep == '|'
+           assert(replace[0] == '$');
+           const char * env = getenv(replace.c_str()+1);
+-          final_str += env ? env : second;
++          if (env) {
++            final_str += env;
++          } else if (second[0] == '$') {
++            // Expand the right-hand side of '|', which starts with a
++            // reference to an environment variable.
++            auto slash = second.find('/');
++            String variable = second.substr(1, slash - 1);
++            const char * env = getenv(variable.c_str());
++            String value = env ? String(env) : "";
++            value += second.substr(slash, second.size() - slash);
++            final_str += value;
++          } else {
++            final_str += second;
++          }
+         }
+         replace = "";
+         in_replace = false;
 @@ -1349,6 +1349,9 @@ namespace acommon {
  #  define REPL     ".aspell.<lang>.prepl"
  #endif
  
 +#undef DICT_DIR
-+#define DICT_DIR "<$ASPELL_DICT_DIR|home-dir/.guix-profile/lib/aspell>"
++#define DICT_DIR "<$ASPELL_DICT_DIR|$HOME/.guix-profile/lib/aspell>"
 +
    static const KeyInfo config_keys[] = {
      // the description should be under 50 chars



reply via email to

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