summaryrefslogtreecommitdiff
path: root/gnu/packages/machine-learning.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-07-30 17:26:24 +0200
committerLudovic Courtès <ludo@gnu.org>2021-07-31 01:03:24 +0200
commit630c39d8df7557b6a0941c1d5ee879e487de0f5e (patch)
treee4b67923336d281b78a96857a7d465e942ce8970 /gnu/packages/machine-learning.scm
parentfa2d94b5e362c684da812d494463d965e601c18d (diff)
downloadguix-patches-630c39d8df7557b6a0941c1d5ee879e487de0f5e.tar
guix-patches-630c39d8df7557b6a0941c1d5ee879e487de0f5e.tar.gz
gnu: onnx: Change source to 'git-fetch'.
* gnu/packages/machine-learning.scm (onnx)[source]: Change to 'git-fetch'. Add "onnx-skip-model-downloads.patch". [arguments]: Add 'make-test-directory-writable' phase. * gnu/packages/patches/onnx-skip-model-downloads.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it.
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r--gnu/packages/machine-learning.scm31
1 files changed, 21 insertions, 10 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 75faeb8eb8..177d1aaa4f 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -585,16 +585,20 @@ in terms of new algorithms.")
(package
(name "onnx")
(version "1.9.0")
- (source
- (origin
- (method url-fetch)
- (uri (pypi-uri "onnx" version))
- (patches (search-patches "onnx-use-system-googletest.patch"
- "onnx-shared-libraries.patch"))
- (sha256
- (base32 "0yjv2axz2vc2ysniwislsp53fsb8f61y1warrr2ppn2d9ijml1d9"))
- (modules '((guix build utils)))
- (snippet '(delete-file-recursively "third_party"))))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/onnx/onnx")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32
+ "1xnii361f68x0masxgfc4ai7hh3wlxxk56aznwf4m4yr6wqx47ml"))
+ (file-name (git-file-name name version))
+ (patches (search-patches "onnx-use-system-googletest.patch"
+ "onnx-shared-libraries.patch"
+ "onnx-skip-model-downloads.patch"))
+ (modules '((guix build utils)))
+ (snippet '(delete-file-recursively "third_party"))))
(build-system python-build-system)
(arguments
'(#:phases (modify-phases %standard-phases
@@ -625,6 +629,13 @@ in terms of new algorithms.")
;; -j'.
(setenv "MAX_JOBS"
(number->string (parallel-job-count)))))
+ (add-before 'check 'make-test-directory-writable
+ (lambda _
+ ;; Make things writable for tests.
+ (setenv "HOME" (getcwd))
+ (for-each make-file-writable
+ (find-files "onnx/examples" "."
+ #:directories? #t))))
(add-after 'install 'install-from-cmake
(lambda _
;; Run "make install" in the build tree 'setup.py'