aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages wordnet)
  #:use-module (guix packages)
  #:use-module (guix build-system gnu)
  #:use-module (guix licenses)
  #:use-module (guix download)
  #:use-module (gnu packages)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages tcl))

(define-public wordnet
  (package
    (name "wordnet")
    (version "3.0")
    (source (origin
             (method url-fetch)
             (uri (string-append "http://wordnetcode.princeton.edu/"
                                 version "/WordNet-" version ".tar.bz2"))
             (sha256
              (base32
               "08pgjvd2vvmqk3h641x63nxp7wqimb9r30889mkyfh2agc62sjbc"))
             (patches (search-patches
                        "wordnet-CVE-2008-2149.patch"
                        "wordnet-CVE-2008-3908-pt1.patch"
                        "wordnet-CVE-2008-3908-pt2.patch"))))
    (build-system gnu-build-system)
    (arguments
     `(#:configure-flags (list (string-append "--with-tcl="
                                              (assoc-ref %build-inputs "tcl")
                                              "/lib")
                               (string-append "--with-tk="
                                              (assoc-ref %build-inputs "tk")
                                              "/lib")

                               ;; Provide the `result' field in `Tcl_Interp'.
                               ;; See <https://bugs.gentoo.org/show_bug.cgi?id=452034>.
                               "CFLAGS=-DUSE_INTERP_RESULT -O2")
       #:phases
       (modify-phases %standard-phases
         (add-before 'build 'build-libwn-PIC
           (lambda _
             ;; GNU Dico links libWN.a in its wordnet.so plugin, so it needs
             ;; PIC.
             (invoke "make" "-C" "lib" "CFLAGS=-O2 -g -fPIC"
                     "LDFLAGS=-fPIC")))
         (add-after 'install 'post-install
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
                   (bin (assoc-ref outputs "tk"))
                   (tk  (assoc-ref inputs "tk"))
                   (tkv ,(let ((v (package-version tk)))
                           (string-take v (string-index-right v #\.)))))
               ;; Move `wishwn' and `wnb' to BIN.
               (for-each (lambda (prog)
                           (let ((orig (string-append out "/bin/" prog))
                                 (dst  (string-append bin "/bin/" prog))
                                 (dir  (string-append tk "/lib/tk" tkv)))
                             (mkdir-p (dirname dst))
                             (copy-file orig dst)
                             (delete-file orig)
                             (wrap-program dst
                                           `("TK_LIBRARY" "" = (,dir))
                                           `("PATH" ":" prefix
                                             (,(string-append out
                                                              "/bin"))))))
                         '("wishwn" "wnb"))))))))
    (outputs '("out"
               "tk"))                             ; for the Tcl/Tk GUI

    (inputs (list bash-minimal tk tcl))
    (home-page "https://wordnet.princeton.edu/")
    (synopsis "Lexical database for the English language")
    (description
     "WordNet is a large lexical database of English.  Nouns, verbs,
adjectives and adverbs are grouped into sets of cognitive synonyms (synsets),
each expressing a distinct concept.  Synsets are interlinked by means of
conceptual-semantic and lexical relations.  The resulting network of
meaningfully related words and concepts can be navigated with the browser.
WordNet is also freely and publicly available for download.  WordNet's
structure makes it a useful tool for computational linguistics and natural
language processing.")
    (license x11)))
build-system cmake-build-system) (arguments `(#:test-target "tests" #:configure-flags (list (string-append "-DGUILE_INCLUDE_DIR=" (assoc-ref %build-inputs "guile") "/include/guile/2.2/") (string-append "-DGUILE_SITE_DIR=" (assoc-ref %outputs "out") "/share/guile/site/2.2/")))) (inputs (list atomspace boost cogutil gmp guile-2.2)) (native-inputs `(("cxxtest" ,cxxtest) ("python" ,python-minimal) ("pkg-config" ,pkg-config))) (home-page "https://github.com/opencog/cogserver/") (synopsis "OpenCog network server") (description "The OpenCog Cogserver is a network and job server for the OpenCog framework.") (license license:agpl3)))) (define-public attention ;; There are no releases. (let ((commit "87d43679280ce486cd6757765d2e1df6d502991d") (revision "1")) (package (name "attention") (version (git-version "0" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/opencog/attention") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "0sndslphicv6w9qpag168rqkxq5sf71l5qbfx6zhsd5bzlf5fhwv")))) (build-system cmake-build-system) (arguments `(#:test-target "tests" #:configure-flags (list (string-append "-DGUILE_INCLUDE_DIR=" (assoc-ref %build-inputs "guile") "/include/guile/2.2/") (string-append "-DGUILE_SITE_DIR=" (assoc-ref %outputs "out") "/share/guile/site/2.2/")))) (inputs (list atomspace boost cogserver cogutil gmp guile-2.2)) (native-inputs `(("cxxtest" ,cxxtest) ("python" ,python-minimal) ("pkg-config" ,pkg-config))) (home-page "https://github.com/opencog/attention/") (synopsis "OpenCog attention allocation subsystem") (description "Attention Allocation is an OpenCog subsystem meant to control the application of processing and memory resources to specific tasks.") (license license:agpl3)))) (define-public opencog ;; There are no recent releases. (let ((commit "ceac90507610cb2d0ee98f97a2086865292b1204") (revision "1")) (package (name "opencog") (version (git-version "0.1.4" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/opencog/opencog") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "1j8wv910fvrmph370wv5pv2f4bc2s9vl6i7bw3pkmwbdhxkhjbhm")))) (build-system cmake-build-system) (arguments `(#:test-target "tests" #:configure-flags (list (string-append "-DGUILE_INCLUDE_DIR=" (assoc-ref %build-inputs "guile") "/include/guile/2.2/") (string-append "-DGUILE_SITE_DIR=" (assoc-ref %outputs "out") "/share/guile/site/2.2/")))) (inputs `(("attention" ,attention) ("atomspace" ,atomspace) ("boost" ,boost) ("cogserver" ,cogserver) ("cogutil" ,cogutil) ("gmp" ,gmp) ("guile" ,guile-2.2) ("libuuid" ,util-linux "lib") ("link-grammar" ,link-grammar))) (native-inputs `(("cxxtest" ,cxxtest) ("python" ,python-minimal) ("pkg-config" ,pkg-config))) (home-page "https://github.com/opencog/attention/") (synopsis "Framework for integrated artificial intelligence") (description "OpenCog is a framework for developing AI systems, especially appropriate for integrative multi-algorithm systems, and artificial general intelligence systems. It currently contains a functional core framework, and a number of cognitive agents at varying levels of completion, some already displaying interesting and useful functionalities alone and in combination.") (license license:agpl3)))) (define-public agi-bio ;; There are no releases. (let ((commit "b5c6f3d99e8cca3798bf0cdf2c32f4bdb8098efb") (revision "1")) (package (name "agi-bio") (version (git-version "0" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/opencog/agi-bio") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "0c3q0nhmd03nvqm1ih10y28n596cjvfhkcfvzw2fmz1sn3ywdah4")))) (build-system cmake-build-system) (arguments `(#:tests? #f ; there are none #:configure-flags (list (string-append "-DGUILE_INCLUDE_DIR=" (assoc-ref %build-inputs "guile") "/include/guile/2.2/") (string-append "-DGUILE_SITE_DIR=" (assoc-ref %outputs "out") "/share/guile/site/2.2/")) #:phases (modify-phases %standard-phases (add-after 'unpack 'fix-unqualified-load (lambda* (#:key outputs #:allow-other-keys) (substitute* "bioscience/bioscience.scm" (("\\(load \"bioscience/types/bioscience_types.scm\"\\)") (format #f "(load \"~a/bioscience/types/bioscience_types.scm\")" (string-append (assoc-ref outputs "out") "/share/guile/site/2.2/opencog")))) #t))))) (inputs (list atomspace cogutil gmp guile-2.2)) (native-inputs `(("cxxtest" ,cxxtest) ("python" ,python-minimal) ("pkg-config" ,pkg-config))) (home-page "https://github.com/opencog/agi-bio") (synopsis "Genomic and proteomic data exploration and pattern mining") (description "This is a package for genomic and proteomic research using the OpenCog toolset with Guile. This includes experiments in applying pattern mining and other OpenCog components.") (license license:agpl3))))