mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 21:59:08 -05:00
gnu: Add python-libsvm.
* gnu/packages/machine-learning.scm (python-libsvm): New variable.
This commit is contained in:
parent
741115b649
commit
71f80f5487
1 changed files with 34 additions and 1 deletions
|
@ -22,7 +22,8 @@ (define-module (gnu packages machine-learning)
|
||||||
#:use-module (guix utils)
|
#:use-module (guix utils)
|
||||||
#:use-module (guix download)
|
#:use-module (guix download)
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
#:use-module (gnu packages))
|
#:use-module (gnu packages)
|
||||||
|
#:use-module (gnu packages python))
|
||||||
|
|
||||||
(define-public libsvm
|
(define-public libsvm
|
||||||
(package
|
(package
|
||||||
|
@ -63,3 +64,35 @@ (define-public libsvm
|
||||||
distribution estimation (one-class SVM). It supports multi-class
|
distribution estimation (one-class SVM). It supports multi-class
|
||||||
classification.")
|
classification.")
|
||||||
(license license:bsd-3)))
|
(license license:bsd-3)))
|
||||||
|
|
||||||
|
(define-public python-libsvm
|
||||||
|
(package (inherit libsvm)
|
||||||
|
(name "python-libsvm")
|
||||||
|
(build-system gnu-build-system)
|
||||||
|
(arguments
|
||||||
|
`(#:tests? #f ;no "check" target
|
||||||
|
#:make-flags '("-C" "python")
|
||||||
|
#:phases
|
||||||
|
(modify-phases %standard-phases
|
||||||
|
(delete 'configure)
|
||||||
|
(replace
|
||||||
|
'install
|
||||||
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
|
(let ((site (string-append (assoc-ref outputs "out")
|
||||||
|
"/lib/python"
|
||||||
|
(string-take
|
||||||
|
(string-take-right
|
||||||
|
(assoc-ref inputs "python") 5) 3)
|
||||||
|
"/site-packages/")))
|
||||||
|
(substitute* "python/svm.py"
|
||||||
|
(("../libsvm.so.2") "libsvm.so.2"))
|
||||||
|
(mkdir-p site)
|
||||||
|
(for-each (lambda (file)
|
||||||
|
(copy-file file (string-append site (basename file))))
|
||||||
|
(find-files "python" "\\.py"))
|
||||||
|
(copy-file "libsvm.so.2"
|
||||||
|
(string-append site "libsvm.so.2")))
|
||||||
|
#t)))))
|
||||||
|
(inputs
|
||||||
|
`(("python" ,python)))
|
||||||
|
(synopsis "Python bindings of libSVM")))
|
||||||
|
|
Loading…
Reference in a new issue