gnu: flann: Move .mex file to a separate "octave" output.

That way the closure of flann:out is down from 1 GiB
to 290 MiB.

* gnu/packages/maths.scm (flann)[outputs]: New field.
[arguments]: Add 'set-octave-directory' phase.
This commit is contained in:
Ludovic Courtès 2017-04-06 18:13:30 +02:00
parent 3be437398e
commit 6b6aca9b36
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -2719,6 +2719,8 @@ (define-public flann
(base32 (base32
"022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz")))) "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(outputs '("out"
"octave")) ;46 MiB .mex file that pulls Octave
(native-inputs (native-inputs
`(("unzip" ,unzip))) `(("unzip" ,unzip)))
(inputs (inputs
@ -2736,6 +2738,14 @@ (define-public flann
;; Save 12 MiB by not installing .a files. Passing ;; Save 12 MiB by not installing .a files. Passing
;; '-DBUILD_STATIC_LIBS=OFF' has no effect. ;; '-DBUILD_STATIC_LIBS=OFF' has no effect.
#:phases (modify-phases %standard-phases #:phases (modify-phases %standard-phases
(add-before 'configure 'set-octave-directory
(lambda* (#:key outputs #:allow-other-keys)
;; Install the .mex file in the "octave" output.
(let ((out (assoc-ref outputs "octave")))
(substitute* "src/matlab/CMakeLists.txt"
(("share/flann/octave")
(string-append out "/share/flann/octave")))
#t)))
(add-after 'install 'remove-static-libraries (add-after 'install 'remove-static-libraries
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))