gnu: libsvm: Update to 3.36.

* gnu/packages/machine-learning.scm (libsvm)[source]: Switch to git-fetch.
[arguments]: Use G-Expressions.
<#:phases>{install}: Simplify.
* gnu/packages/machine-learning.scm (python-libsvm)[build-system]: Switch to
pyproject-build-system.
<#:phases>: Add chdir.
[native-inputs]: Add python-setuptools, python-wheel.
[propagated-inputs]: Add libsvm, python-scipy.
* gnu/packages/bioinformatics.scm (seek)[arguments]:
Adapt #:configure-flags accordingly.

Change-Id: Icf9f1081f037fb2fcda999a0c22e20d75d63c8c0
Signed-off-by: Danny Milosavljevic <dannym@friendly-machines.com>
This commit is contained in:
Cayetano Santos 2025-08-19 20:58:39 +02:00 committed by Danny Milosavljevic
parent 92fdcfdaa3
commit 7c0fd7440e
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5
2 changed files with 42 additions and 56 deletions

View file

@ -10962,7 +10962,7 @@ distribution, coverage uniformity, strand specificity, etc.")
`(#:configure-flags `(#:configure-flags
,#~(list (string-append "-DSVM_LIBRARY=" ,#~(list (string-append "-DSVM_LIBRARY="
#$(this-package-input "libsvm") #$(this-package-input "libsvm")
"/lib/libsvm.so.2") "/lib/libsvm.so")
(string-append "-DSVM_INCLUDE=" (string-append "-DSVM_INCLUDE="
#$(this-package-input "libsvm") #$(this-package-input "libsvm")
"/include")) "/include"))

View file

@ -347,39 +347,40 @@ sparsely connected networks.")
(define-public libsvm (define-public libsvm
(package (package
(name "libsvm") (name "libsvm")
(version "3.23") (version "336")
(source (source
(origin (origin
(method url-fetch) (method git-fetch)
(uri (string-append "https://www.csie.ntu.edu.tw/~cjlin/libsvm/" (uri (git-reference
name "-" version ".tar.gz")) (url "https://github.com/cjlin1/libsvm/")
(commit (string-append "v" version))))
(sha256 (sha256
(base32 "0jpaq0rr92x38p4nk3gjan79ip67m6p80anb28z1d8601miysyi5")))) (base32 "03ns6frhfdcyl661ws1yqbzsa6m8wrmba544vlacghry2kg88hn2"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:tests? #f ; no "check" target (list
#:phases #:tests? #f ;no "check" target
(modify-phases %standard-phases #:phases
(delete 'configure) #~(modify-phases %standard-phases
(add-after 'build 'build-lib (delete 'configure)
(lambda _ (add-after 'build 'build-lib
(invoke "make" "lib"))) (lambda _
(replace 'install ; no install target (invoke "make" "lib")))
(lambda* (#:key outputs #:allow-other-keys) (replace 'install
(let* ((out (assoc-ref outputs "out")) ;no "install" target
(bin (string-append out "/bin/")) (lambda _
(lib (string-append out "/lib/")) (for-each (lambda (file)
(inc (string-append out "/include/libsvm"))) (install-file file
(mkdir-p bin) (string-append #$output "/bin")))
(for-each (lambda (file) '("svm-train" "svm-predict" "svm-scale"))
(copy-file file (string-append bin file))) (install-file "libsvm.so.4"
'("svm-train" (string-append #$output "/lib"))
"svm-predict" (symlink (string-append #$output "/lib/libsvm.so.4")
"svm-scale")) (string-append #$output "/lib/libsvm.so"))
(mkdir-p lib) (install-file "svm.h"
(install-file "libsvm.so.2" lib) (string-append #$output "/include/"
(mkdir-p inc) #$name)))))))
(install-file "svm.h" inc))))))) (native-inputs (list python-minimal-wrapper))
(home-page "https://www.csie.ntu.edu.tw/~cjlin/libsvm/") (home-page "https://www.csie.ntu.edu.tw/~cjlin/libsvm/")
(synopsis "Library for Support Vector Machines") (synopsis "Library for Support Vector Machines")
(description (description
@ -438,35 +439,20 @@ machine learning algorithms based on GPs.")
(license license:bsd-3))) (license license:bsd-3)))
(define-public python-libsvm (define-public python-libsvm
(package (inherit libsvm) (package
(inherit libsvm)
(name "python-libsvm") (name "python-libsvm")
(build-system gnu-build-system) (build-system pyproject-build-system)
(arguments (arguments
`(#:tests? #f ; no "check" target (list
#:make-flags '("-C" "python") #:tests? #f ;no "check" target
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(delete 'configure) (add-before 'build 'chdir
(replace (lambda _
'install ; no install target (chdir "python"))))))
(lambda* (#:key inputs outputs #:allow-other-keys) (native-inputs (list python-setuptools python-wheel))
(let ((site (string-append (assoc-ref outputs "out") (propagated-inputs (list libsvm python-scipy))
"/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
(list python))
(synopsis "Python bindings of libSVM"))) (synopsis "Python bindings of libSVM")))
(define-public python-mcfit (define-public python-mcfit