summaryrefslogtreecommitdiff
path: root/gnu/packages/maths.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2021-09-23 12:06:13 +0200
committerLudovic Courtès <ludo@gnu.org>2021-09-24 13:48:49 +0200
commit3cdb16cb5055794fedb12cbc4415a81a3122df88 (patch)
tree839bf54400453bbf4d09f8b632421a486d4a192a /gnu/packages/maths.scm
parenta7b6c5a1270e52385a70b4192ee40ac6eb3b7c27 (diff)
gnu: fp16: Install Python files in the site directory.
* gnu/packages/maths.scm (fp16)[arguments]: New field.
Diffstat (limited to 'gnu/packages/maths.scm')
-rw-r--r--gnu/packages/maths.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 8583781f2d..6d5918a9d5 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -6891,6 +6891,29 @@ when an application performs repeated divisions by the same divisor.")
"05mm4vrxsac35hjf5djif9r6rdxj9ippg97ia3p6q6b8lrp7srwv"))
(patches (search-patches "fp16-system-libraries.patch"))))
(build-system cmake-build-system)
+ (arguments
+ `(#:imported-modules ((guix build python-build-system)
+ ,@%cmake-build-system-modules)
+ #:modules (((guix build python-build-system)
+ #:select (site-packages))
+ (guix build cmake-build-system)
+ (guix build utils))
+ #:phases (modify-phases %standard-phases
+ (add-after 'install 'move-python-files
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; Python files get installed to $includedir (!).
+ ;; Move them to the usual Python site directory.
+ (let* ((out (assoc-ref outputs "out"))
+ (include (string-append out "/include"))
+ (site (site-packages inputs outputs))
+ (target (string-append site "/fp16")))
+ (mkdir-p target)
+ (for-each (lambda (file)
+ (rename-file file
+ (string-append target "/"
+ (basename
+ file))))
+ (find-files include "\\.py$"))))))))
(native-inputs
`(("python-wrapper" ,python-wrapper)))
(inputs