From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH] gnu: Add ghmm. Date: Mon, 23 May 2016 12:52:00 +0200 Message-ID: <1464000720-4054-1-git-send-email-ricardo.wurmus@mdc-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4nT4-0001wP-Is for guix-devel@gnu.org; Mon, 23 May 2016 06:52:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4nSz-0008MT-IE for guix-devel@gnu.org; Mon, 23 May 2016 06:52:13 -0400 Received: from venus.bbbm.mdc-berlin.de ([141.80.25.30]:47681) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4nSz-0008MG-3W for guix-devel@gnu.org; Mon, 23 May 2016 06:52:09 -0400 Received: from localhost (localhost [127.0.0.1]) by venus.bbbm.mdc-berlin.de (Postfix) with ESMTP id 335F1380703 for ; Mon, 23 May 2016 12:52:07 +0200 (CEST) Received: from venus.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (venus.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ShCP1vIza4bj for ; Mon, 23 May 2016 12:52:01 +0200 (CEST) Received: from HTCAONE.mdc-berlin.net (puck.citx.mdc-berlin.de [141.80.36.101]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by venus.bbbm.mdc-berlin.de (Postfix) with ESMTPS for ; Mon, 23 May 2016 12:52:01 +0200 (CEST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/machine-learning.scm (ghmm): New variable. --- gnu/packages/machine-learning.scm | 94 +++++++++++++++++++++++++++++++++= +++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-lea= rning.scm index cbc7509..584aeae 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2015 Ricardo Wurmus +;;; Copyright =C2=A9 2015, 2016 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,12 +21,15 @@ #:use-module (guix packages) #:use-module (guix utils) #:use-module (guix download) + #:use-module (guix svn-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system r) #:use-module (gnu packages) + #:use-module (gnu packages autotools) #:use-module (gnu packages boost) #:use-module (gnu packages compression) + #:use-module (gnu packages dejagnu) #:use-module (gnu packages gcc) #:use-module (gnu packages maths) #:use-module (gnu packages pkg-config) @@ -107,6 +110,95 @@ classification.") `(("python" ,python))) (synopsis "Python bindings of libSVM"))) =20 +(define-public ghmm + ;; The latest release candidate is several years and a couple of fixes= have + ;; been published since. This is why we download the sources from the= SVN + ;; repository. + (let ((svn-revision 2341)) + (package + (name "ghmm") + (version (string-append "0.9-rc3-0." (number->string svn-revision)= )) + (source (origin + (method svn-fetch) + (uri (svn-reference + (url "http://svn.code.sf.net/p/ghmm/code/trunk") + (revision svn-revision))) + (file-name (string-append name "-" version)) + (sha256 + (base32 + "0qbq1rqp94l530f043qzp8aw5lj7dng9wq0miffd7spd1ff638wq"= )))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'enter-dir + (lambda _ (chdir "ghmm") #t)) + (add-after 'enter-dir 'fix-PYTHONPATH + (lambda* (#:key outputs #:allow-other-keys) + ;; The Python tests fail as the library is assumed to be = stored + ;; in ./build/lib.linux-i686-*. To fix this we detect th= e CPU + ;; and use it in the path. + (substitute* "configure.in" + (("AM_INIT_AUTOMAKE" line) + (string-append line "\nAC_CANONICAL_HOST\n"))) + (substitute* "ghmmwrapper/Makefile.am" + (("i686") "@host_cpu@")) + #t)) + (add-after 'enter-dir 'fix-runpath + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "ghmmwrapper/setup.py" + (("^(.*)extra_compile_args =3D \\[" line indent) + (string-append indent + "extra_link_args =3D [\"-Wl,-rpath=3D" + (assoc-ref outputs "out") "/lib\"],\n" + line + "\"-Wl,-rpath=3D" + (assoc-ref outputs "out") + "/lib\", "))) + #t)) + (add-after 'enter-dir 'disable-broken-tests + (lambda _ + (substitute* "tests/Makefile.am" + ;; GHMM_SILENT_TESTS is assumed to be a command. + (("TESTS_ENVIRONMENT.*") "") + ;; Do not build broken tests. + (("chmm .*") "") + (("read_fa .*") "") + (("mcmc .*") "") + (("label_higher_order_test.*$") + "label_higher_order_test\n")) + + ;; These Python unittests are broken as there is no gato. + ;; See https://sourceforge.net/p/ghmm/support-requests/3/ + (substitute* "ghmmwrapper/ghmmunittests.py" + (("^(.*)def (testNewXML|testMultipleTransitionClasses|t= estNewXML)" + line indent) + (string-append indent + "@unittest.skip(\"Disabled by Guix\")\n= " + line))) + #t)) + (add-before 'configure 'autogen + (lambda _ + (zero? (system* "bash" "./autogen.sh"))))))) + (inputs + `(("python" ,python-2) ; only Python 2 is supported + ("libxml2" ,libxml2))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("dejagnu" ,dejagnu) + ("swig" ,swig) + ("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool))) + (home-page "http://ghmm.org") + (synopsis "Hidden Markov Model library") + (description + "The General Hidden Markov Model library (GHMM) is a C library wi= th +additional Python bindings implementing a wide range of types of @dfn{Hi= dden +Markov Models} (HMM) and algorithms: discrete, continous emissions, basi= c +training, HMM clustering, HMM mixtures.") + (license license:lgpl2.0+)))) + (define-public randomjungle (package (name "randomjungle") --=20 2.7.3