summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-05-17 16:16:15 +0200
committerLudovic Courtès <ludo@gnu.org>2017-05-17 16:20:06 +0200
commit411ba511893feca223656122059cb12378b95c91 (patch)
treef7a4567f86cb5b3153b966087d5b7d390db22a3b /gnu
parent6d35b1c99c15f87a30fdf1a38c88db844b3e8303 (diff)
downloadguix-411ba511893feca223656122059cb12378b95c91.tar.gz
gnu: Add gspell.
* gnu/packages/patches/gspell-dash-test.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/gnome.scm (gspell): New variable.

Co-authored-by: humanitiesNerd <catonano@gmail.com>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/gnome.scm54
-rw-r--r--gnu/packages/patches/gspell-dash-test.patch16
3 files changed, 71 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index f02d18e0dd..1be412db3a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -646,6 +646,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/graphite2-non-linear-classes-even-number.patch \
   %D%/packages/patches/grep-timing-sensitive-test.patch		\
   %D%/packages/patches/gsl-test-i686.patch			\
+  %D%/packages/patches/gspell-dash-test.patch			\
   %D%/packages/patches/guile-1.8-cpp-4.5.patch			\
   %D%/packages/patches/guile-default-utf8.patch			\
   %D%/packages/patches/guile-linux-syscalls.patch		\
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index cec8baebfe..47dcc91dcd 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -51,6 +51,7 @@
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages aspell)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages base)
@@ -6136,3 +6137,56 @@ accessibility infrastructure.")
 via speech and refreshable braille.  Orca works with applications and toolkits
 that support the Assistive Technology Service Provider Interface (AT-SPI).")
     (license license:lgpl2.1+)))
+
+(define-public gspell
+  (package
+    (name "gspell")
+    (version "1.3.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://gnome/sources/" name "/"
+                                  (version-major+minor version) "/"
+                                  name "-" version ".tar.xz"))
+              (sha256
+               (base32
+                "1n4kd5i11l79h8bpvx3cz79ww0b4z89y99h4czvyg80qlarn585w"))
+              (patches (search-patches "gspell-dash-test.patch"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'pre-check
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Tests require a running X server.
+             (system "Xvfb :1 &")
+             (setenv "DISPLAY" ":1")
+
+             ;; For the missing /etc/machine-id.
+             (setenv "DBUS_FATAL_WARNINGS" "0")
+
+             ;; Allow Enchant and its Aspell backend to find the en_US
+             ;; dictionary.
+             (setenv "ASPELL_DICT_DIR"
+                     (string-append (assoc-ref inputs "aspell-dict-en")
+                                    "/lib/aspell"))
+             #t)))))
+    (inputs
+     `(("enchant" ,enchant)
+       ("iso-codes" ,iso-codes)
+       ("gtk+" ,gtk+)
+       ("glib" ,glib)))
+    (native-inputs
+     `(("glib" ,glib "bin")
+       ("pkg-config" ,pkg-config)
+       ("xmllint" ,libxml2)
+
+       ;; For tests.
+       ("xorg-server" ,xorg-server)
+       ("aspell-dict-en" ,aspell-dict-en)))
+    (home-page "https://wiki.gnome.org/Projects/gspell")
+    (synopsis "GNOME's alternative spell checker")
+    (description
+     "gspell provides a flexible API to add spell-checking to a GTK+
+application.  It provides a GObject API, spell-checking to text entries and
+text views, and buttons to choose the language.")
+    (license license:gpl2+)))
diff --git a/gnu/packages/patches/gspell-dash-test.patch b/gnu/packages/patches/gspell-dash-test.patch
new file mode 100644
index 0000000000..e737921c4b
--- /dev/null
+++ b/gnu/packages/patches/gspell-dash-test.patch
@@ -0,0 +1,16 @@
+Somehow, Aspell 0.60.6.1 and aspell-dict-en-2016.11.20-0 don't consider
+this a valid spelling.  Skip it.
+
+--- gspell-1.3.2/testsuite/test-checker.c	2017-05-17 16:02:40.832415940 +0200
++++ gspell-1.3.2/testsuite/test-checker.c	2017-05-17 16:02:50.768351895 +0200
+@@ -101,9 +101,6 @@ test_dashes (void)
+ 
+ 	checker = gspell_checker_new (lang);
+ 
+-	correctly_spelled = gspell_checker_check_word (checker, "spell-checking", -1, &error);
+-	g_assert_no_error (error);
+-	g_assert (correctly_spelled);
+ 
+ 	correctly_spelled = gspell_checker_check_word (checker, "nrst-auie", -1, &error);
+ 	g_assert_no_error (error);
+