projects/guix·blob java-team · refs

125 lines · 5.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2016, 2017, 2018 Ludovic Courtès <[email protected]>
3;;; Copyright © 2016 Efraim Flashner <[email protected]>
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages wordnet)
21 #:use-module (guix build-system copy)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix download)
24 #:use-module (guix gexp)
25 #:use-module (guix git-download)
26 #:use-module (guix licenses)
27 #:use-module (guix packages)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages bash)
30 #:use-module (gnu packages gcc)
31 #:use-module (gnu packages tcl))
32
33(define-public wfrench
34 (package
35 (name "wfrench")
36 (version "1.2.9")
37 (source (origin
38 (method git-fetch)
39 (uri (git-reference
40 (url "https://gitlab.com/gpernot/wfrench")
41 (commit version)))
42 (file-name (git-file-name name version))
43 (sha256
44 (base32
45 "0vmgk303wbx67vhhcl36ycm8wlr334a1zayw8xdg0qs3nyn4qn09"))))
46 (build-system copy-build-system)
47 (arguments
48 (list #:install-plan #~'(("french" "share/wfrench/french"))))
49 (home-page "https://gitlab.com/gpernot/wfrench")
50 (synopsis "French word list")
51 (description "This package provides a list of French words.")
52 (license gpl3+)))
53
54(define-public wordnet
55 (package
56 (name "wordnet")
57 (version "3.0")
58 (source (origin
59 (method url-fetch)
60 (uri (string-append "http://wordnetcode.princeton.edu/"
61 version "/WordNet-" version ".tar.bz2"))
62 (sha256
63 (base32
64 "08pgjvd2vvmqk3h641x63nxp7wqimb9r30889mkyfh2agc62sjbc"))
65 (patches (search-patches
66 "wordnet-CVE-2008-2149.patch"
67 "wordnet-CVE-2008-3908-pt1.patch"
68 "wordnet-CVE-2008-3908-pt2.patch"))))
69 (build-system gnu-build-system)
70 (arguments
71 `(#:configure-flags (list (string-append "--with-tcl="
72 (assoc-ref %build-inputs "tcl")
73 "/lib")
74 (string-append "--with-tk="
75 (assoc-ref %build-inputs "tk")
76 "/lib")
77
78 ;; Provide the `result' field in `Tcl_Interp'.
79 ;; See <https://bugs.gentoo.org/show_bug.cgi?id=452034>.
80 "CFLAGS=-DUSE_INTERP_RESULT -O2")
81 #:phases
82 (modify-phases %standard-phases
83 (add-before 'build 'build-libwn-PIC
84 (lambda _
85 ;; GNU Dico links libWN.a in its wordnet.so plugin, so it needs
86 ;; PIC.
87 (invoke "make" "-C" "lib" "CFLAGS=-O2 -g -fPIC"
88 "LDFLAGS=-fPIC")))
89 (add-after 'install 'post-install
90 (lambda* (#:key inputs outputs #:allow-other-keys)
91 (let ((out (assoc-ref outputs "out"))
92 (bin (assoc-ref outputs "tk"))
93 (tk (assoc-ref inputs "tk"))
94 (tkv ,(let ((v (package-version tk)))
95 (string-take v (string-index-right v #\.)))))
96 ;; Move `wishwn' and `wnb' to BIN.
97 (for-each (lambda (prog)
98 (let ((orig (string-append out "/bin/" prog))
99 (dst (string-append bin "/bin/" prog))
100 (dir (string-append tk "/lib/tk" tkv)))
101 (mkdir-p (dirname dst))
102 (copy-file orig dst)
103 (delete-file orig)
104 (wrap-program dst
105 `("TK_LIBRARY" "" = (,dir))
106 `("PATH" ":" prefix
107 (,(string-append out
108 "/bin"))))))
109 '("wishwn" "wnb"))))))))
110 (outputs '("out"
111 "tk")) ; for the Tcl/Tk GUI
112
113 (inputs (list bash-minimal tk tcl))
114 (home-page "https://wordnet.princeton.edu/")
115 (synopsis "Lexical database for the English language")
116 (description
117 "WordNet is a large lexical database of English. Nouns, verbs,
118adjectives and adverbs are grouped into sets of cognitive synonyms (synsets),
119each expressing a distinct concept. Synsets are interlinked by means of
120conceptual-semantic and lexical relations. The resulting network of
121meaningfully related words and concepts can be navigated with the browser.
122WordNet is also freely and publicly available for download. WordNet's
123structure makes it a useful tool for computational linguistics and natural
124language processing.")
125 (license x11)))