gnu: librecad: Fix build.

* gnu/packages/engineering.scm (librecad)[arguments]: Add phase
"patch-boost-error".
This commit is contained in:
Ricardo Wurmus 2017-11-08 16:20:42 +01:00
parent b72b42cf02
commit 7e3aca2b78
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 32 additions and 18 deletions

View File

@ -96,24 +96,38 @@
(arguments (arguments
'(#:phases '(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'patch-paths ;; Without this patch boost complains that "make_array" is not a
(lambda* (#:key outputs #:allow-other-keys) ;; member of "boost::serialization".
(let ((out (assoc-ref outputs "out"))) (add-after 'unpack 'patch-boost-error
(substitute* "librecad/src/lib/engine/rs_system.cpp" (lambda _
(("/usr/share") (string-append out "/share")))))) (substitute* "librecad/src/lib/math/lc_quadratic.h"
(replace 'configure (("#include \"rs_vector.h\"" line)
(lambda* (#:key inputs #:allow-other-keys) (string-append line
(system* "qmake" (string-append "BOOST_DIR=" "\n#include <boost/serialization/array_wrapper.hpp>")))
(assoc-ref inputs "boost"))))) (substitute* "librecad/src/lib/math/rs_math.cpp"
(replace 'install (("#include <boost/numeric/ublas/matrix.hpp>" line)
(lambda* (#:key outputs #:allow-other-keys) (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
(let* ((out (assoc-ref outputs "out")) line)))
(bin (string-append out "/bin")) #t))
(share (string-append out "/share/librecad"))) (add-after 'unpack 'patch-paths
(mkdir-p bin) (lambda* (#:key outputs #:allow-other-keys)
(install-file "unix/librecad" bin) (let ((out (assoc-ref outputs "out")))
(mkdir-p share) (substitute* "librecad/src/lib/engine/rs_system.cpp"
(copy-recursively "unix/resources" share))))))) (("/usr/share") (string-append out "/share"))))))
(replace 'configure
(lambda* (#:key inputs #:allow-other-keys)
(system* "qmake" (string-append "BOOST_DIR="
(assoc-ref inputs "boost")))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
(share (string-append out "/share/librecad")))
(mkdir-p bin)
(install-file "unix/librecad" bin)
(mkdir-p share)
(copy-recursively "unix/resources" share))
#t)))))
(inputs (inputs
`(("boost" ,boost) `(("boost" ,boost)
("muparser" ,muparser) ("muparser" ,muparser)