| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; |
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 7 | ;;; under the terms of the GNU General Public License as published by |
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 9 | ;;; your option) any later version. |
| 10 | ;;; |
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | ;;; GNU General Public License for more details. |
| 15 | ;;; |
| 16 | ;;; You should have received a copy of the GNU General Public License |
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | (define-module (gnu packages wordnet) |
| 20 | #:use-module (guix packages) |
| 21 | #:use-module (guix build-system gnu) |
| 22 | #:use-module (guix licenses) |
| 23 | #:use-module (guix download) |
| 24 | #:use-module (gnu packages tcl)) |
| 25 | |
| 26 | (define-public wordnet |
| 27 | (package |
| 28 | (name "wordnet") |
| 29 | (version "3.0") |
| 30 | (source (origin |
| 31 | (method url-fetch) |
| 32 | (uri (string-append "http://wordnetcode.princeton.edu/" |
| 33 | version "/WordNet-" |
| 34 | version ".tar.bz2")) |
| 35 | (sha256 |
| 36 | (base32 |
| 37 | "08pgjvd2vvmqk3h641x63nxp7wqimb9r30889mkyfh2agc62sjbc")))) |
| 38 | (build-system gnu-build-system) |
| 39 | (arguments |
| 40 | `(#:configure-flags (list (string-append "--with-tcl=" |
| 41 | (assoc-ref %build-inputs "tcl") |
| 42 | "/lib") |
| 43 | (string-append "--with-tk=" |
| 44 | (assoc-ref %build-inputs "tk") |
| 45 | "/lib") |
| 46 | |
| 47 | ;; Provide the `result' field in `Tcl_Interp'. |
| 48 | ;; See <https://bugs.gentoo.org/show_bug.cgi?id=452034>. |
| 49 | "CFLAGS=-DUSE_INTERP_RESULT") |
| 50 | #:phases (alist-cons-after |
| 51 | 'install 'post-install |
| 52 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 53 | (let ((out (assoc-ref outputs "out")) |
| 54 | (bin (assoc-ref outputs "tk")) |
| 55 | (tk (assoc-ref inputs "tk")) |
| 56 | (tkv ,(let ((v (package-version tk))) |
| 57 | (string-take v (string-index-right v #\.))))) |
| 58 | ;; Move `wishwn' and `wnb' to BIN. |
| 59 | (for-each (lambda (prog) |
| 60 | (let ((orig (string-append out "/bin/" prog)) |
| 61 | (dst (string-append bin "/bin/" prog)) |
| 62 | (dir (string-append tk "/lib/tk" tkv))) |
| 63 | (mkdir-p (dirname dst)) |
| 64 | (copy-file orig dst) |
| 65 | (delete-file orig) |
| 66 | (wrap-program dst |
| 67 | `("TK_LIBRARY" "" = (,dir)) |
| 68 | `("PATH" ":" prefix |
| 69 | (,(string-append out |
| 70 | "/bin")))))) |
| 71 | '("wishwn" "wnb")) |
| 72 | #t)) |
| 73 | %standard-phases))) |
| 74 | (outputs '("out" |
| 75 | "tk")) ; for the Tcl/Tk GUI |
| 76 | (inputs `(("tk" ,tk) |
| 77 | ("tcl" ,tcl))) |
| 78 | (home-page "http://wordnet.princeton.edu/") |
| 79 | (synopsis |
| 80 | "WordNet, a lexical database for the English language") |
| 81 | (description |
| 82 | "WordNet® is a large lexical database of English. Nouns, verbs, |
| 83 | adjectives and adverbs are grouped into sets of cognitive synonyms |
| 84 | (synsets), each expressing a distinct concept. Synsets are interlinked by |
| 85 | means of conceptual-semantic and lexical relations. The resulting network of |
| 86 | meaningfully related words and concepts can be navigated with the browser. |
| 87 | WordNet is also freely and publicly available for download. WordNet's |
| 88 | structure makes it a useful tool for computational linguistics and natural |
| 89 | language processing.") |
| 90 | (license x11))) |